Repository navigation
Administration: Remove admin menu auto-fold and use the responsive menu below 961px - #14219
Draft
abhishekfdd wants to merge 1 commit into
Draft
abhishekfdd wants to merge 1 commit into
abhishekfdd wants to merge 1 commit into
Conversation
…ve menu below 961px. The admin menu no longer collapses automatically to the icon-only state between 783px and 960px. Instead, the responsive admin menu, opened from the toolbar menu toggle, is now used at 960px and below. Folding the menu remains available as a user choice through the collapse button and the `mfold` user setting. The `auto-fold` body class is kept and is now always added, as it scopes the responsive admin menu styles and is used by plugins and the block editor. The `unfold` user setting is no longer read or written. Only the admin menu breakpoint moves. The toolbar height, content padding and metabox sortables keep their existing 782px breakpoint. See #66018.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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.
Removes the automatic icon-only fold of the admin menu between 783px and 960px. At 960px and below, the admin menu now uses the existing responsive (toggle) menu. Folding remains available as a user choice above 960px via the collapse button and the
mfolduser setting.Scope: only the admin menu breakpoint moves to 960px. Toolbar height, content padding and metabox sortables keep the 782px breakpoint (option 1 from comment:3, see comment:9).
Changes
admin-menu.css: merges the 960px auto-fold block and the 782px responsive block into one 960px responsive menu block, keeping rule order so ≤782px output is unchanged. Removes rules made dead by the merge. Shows the toolbar menu toggle at ≤960px at regular toolbar size; the large touch sizing stays at ≤782px. Hides#collapse-menuat ≤960px.common.js: responsive trigger andsetMenuState()use 960px, sowp-menu-state-setreportsresponsiveat ≤960px and never an automaticfolded. The collapse button only togglesfolded/mfold;unfoldis no longer read or written.wpResponsive.activate()callsmaybeDisableSortables()so metabox drag and drop stays enabled between 783px and 960px.admin-header.php: always addsauto-foldto the body, since the responsive menu styles are scoped to it and plugins and Gutenberg'seditor-left()mixin target it.Testing
Compared against unpatched trunk at 700, 850, 960, 961 and 1100px in Chromium:
aria-expanded="true"; Escape closes it. Metabox sortables stay enabled. No flash of the full menu on first paint.editor-left()mixin; details on the ticket.Trac ticket: https://core.trac.wordpress.org/ticket/66018
Use of AI Tools
AI assistance: Yes
Tool(s): Claude (Anthropic)
Model(s): Claude Opus 5.5
Used for: Investigating the auto-fold and breakpoint code paths, drafting the implementation. I reviewed the changes, verified the behavior locally, and take responsibility for the code.
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.