Repository navigation
Conversation
🤖 PR meta 🤖📦 Bundle sizeSize Change: +1.01 kB (+0.01%) Total Size: 8.66 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Navigates the list via UP/DOWN arrow keys from action buttons in
|
This was referenced Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
getdave
force-pushed
the
add/navigation-overlay-tablet
branch
from
November 18, 2026 08:40
4f16610 to
22f82e8
Compare
This branch has not been deployed
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.
What?
Adds a Tablet option to the Navigation block's Overlay Visibility control. With Tablet selected, the menu collapses into the overlay at the theme's tablet breakpoint and below, and shows its links inline above it. The breakpoint comes from
settings.viewport.tabletin theme.json, which is the same value the editor's Tablet preview and Responsive styles use.Why?
Controlling when the Navigation block collapses has been one of the longest-running requests for the block. #45274 tried a free-form pixel breakpoint per block. In review, talldan pointed out that this would give the Navigation block a third breakpoint of its own, separate from the viewport breakpoints that themes can now set in theme.json (#79104), and one you can't preview precisely in the editor. They suggested starting with a Tablet value that follows the theme's breakpoints, which is what this PR does.
Following the theme's breakpoints means:
How?
getOverlayViewports()(JS) andblock_core_navigation_get_overlay_viewports()(PHP) turnoverlayMenuinto a map of the viewports where the overlay shows. Responsive markup, the always-shown state, the generated CSS and the overlay template part preview all read from that map. PR 3 adds a filter around it.get_viewport_media_queries(). The class that scopes them is a hash of the rules, so identical blocks share one class and the rules print once.has-overlay-viewportsclass. The opt-out uses:where(), so the default rules keep exactly the specificity they had before, and theme CSS that overrides the breakpoint today keeps working.useStyleOverride. They're CSS media queries, so in the iframed canvas the device previews and resizing behave like the front end. If the canvas isn't iframed, they follow the browser window, as other responsive styles do.Known issue: the Mobile label
The existing Mobile option collapses below a fixed 600px. The editor's Mobile viewport is 480px by default, so "Mobile" now means two different widths depending on where you look. This PR deliberately leaves Mobile as it is so existing sites don't change, but we need to decide how to resolve it. Ideas welcome.
Compatibility
viewportparameter. That gap already exists on trunk.For theme authors
Tablet blocks get two new classes on the
navelement,has-overlay-viewportsand a hashedwp-navigation-overlay-*class that scopes the generated rules. Those rules are deliberately more specific than the static 600px ones. CSS that overrides the breakpoint today keeps working for blocks set to Mobile, but it won't affect blocks set to Tablet, which followsettings.viewportinstead.Dev note
This PR and PR 3 share a dev note, drafted alongside PR 3, because the Tablet option and the multilingual filter need explaining together.
Testing Instructions
"settings": { "viewport": { "mobile": "480px", "tablet": "60em" } }to your theme'stheme.jsonand check the switch moves to 960px, in both the editor and the front end. Set both values, because a theme that sets only one loses the other default.Automated tests:
npm run test:unit -- packages/block-library/src/navigationnpm run test:unit:php:base -- --filter Render_Block_Navigation_Testnpm run test:e2e -- test/e2e/specs/editor/blocks/navigation-overlay-viewports.spec.tsUse of AI Tools
Written with Claude Code (Claude Opus 5.5) and opened as a draft. I still need to review it myself before it's ready for review.
🤖 Generated with Claude Code