Opened 108 minutes ago
Last modified 107 minutes ago
#66850 new enhancement
Editor: Support configurable viewport ranges for block visibility
| Reported by: | amazingfullstack | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
The Hide block dialog currently treats Desktop as a single range. Themes with different standard and wide desktop layouts need to control block visibility independently in each range. For example, a theme could define Desktop as greater than 782 px through 1024 px and Desktop large as greater than 1024 px.
The proposed Core change adds support for settings.viewport.ranges and renders saved ranges through the existing block visibility support. Legacy Mobile, Tablet, and Desktop rules retain their current behavior, including when a theme adds a fourth range. New rules store their resolved bounds so theme changes leave published visibility intact unless an editor updates the rule.
The editor implementation and browser test details are in Gutenberg PR https://github.com/WordPress/gutenberg/pull/87559. The Core patch passed 380 targeted PHP tests on the WordPress 7.3 development branch.
OpenAI Codex prepared the Core patch, ran the targeted tests, and drafted this ticket.
Change History (1)
This ticket was mentioned in PR #16289 on WordPress/wordpress-develop by @amazingfullstack.
107 minutes ago
#1
- Keywords has-patch has-unit-tests added
Backports the PHP changes from Gutenberg #87559. Core validates the optional theme viewport range list and generates the frontend media queries for saved rules. Existing block visibility metadata continues to use the legacy Mobile, Tablet, and Desktop breakpoints.
The targeted Core PHP suites for block visibility and theme.json passed 380 tests. The tests cover validation, merging theme layers, rendering saved bounds, and rejecting malformed rules.
Use of AI Tools
OpenAI Codex prepared the patch, tests, and PR description.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.