Skip to content

Conversation

zlateska
Copy link
Contributor

@zlateska zlateska commented Sep 2, 2025

Proposed changes

Add patterns to the correct position within the Post Content block when editing in Template mode (Site Editor).

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Visual

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 15:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug where patterns were being inserted at uncertain positions within the Post Content block when in Template mode. The change ensures patterns are consistently added to the top of the Post Content block.

  • Modified the block insertion logic to always use index 0 when in Template mode
  • Added new block editor selectors to support the fix
  • Removed the dynamic insertionIndex calculation for Template mode scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

@zlateska zlateska changed the title Add patterns to the top of Post Content if in Template mode Add patterns to the correct index inside Post Content if in Template mode Sep 2, 2025
@newfold-labs newfold-labs deleted a comment from Copilot AI Sep 2, 2025
@zlateska zlateska requested a review from wpalani September 2, 2025 16:11
@zlateska zlateska merged commit a7ac3fb into main Sep 2, 2025
15 checks passed
@zlateska zlateska deleted the fix/pattern-insertion-template-mode branch September 2, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants