Editor: Center navigation (and template parts/patterns) in canvas view mode#75735
Closed
Editor: Center navigation (and template parts/patterns) in canvas view mode#75735
Conversation
Co-authored-by: jeryj <967608+jeryj@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Center Navigation Preview in Site Editor Nav View
Editor: Center navigation (and template parts/patterns) in canvas view mode
Feb 19, 2026
Contributor
|
Not quite. Closing and creating myself instead of directing copilot for this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the Site Editor nav view (
canvas=view), the navigation preview renders top-left aligned — then visually jumps to centered when entering edit mode. This is both hard to read and disorienting.Root cause: The iframe centering CSS (
display:flex; align-items:center; justify-content:centeron.block-editor-iframe__html) was gated entirely onenableResizing, which is explicitly disabled in preview/view mode (! isPreview). Centering and resizing were conflated in a single flag.Change —
packages/editor/src/components/visual-editor/index.js:isNavigationOrDesignPostType(wp_navigation,wp_template_part,wp_block) from theenableResizingconditionisNavigationOrDesignPostType(view and edit modes) rather thanenableResizing(edit mode only)enableResizingand themin-height:0!importantguard on.is-root-containerare unchanged — resizing remains edit-mode onlyThe same fix benefits template parts and patterns in their respective view-mode previews, which share the same rendering path.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
translate.wordpress.org/home/REDACTED/work/_temp/ghcca-node/node/bin/node node i18n-cache/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.