CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add ability to toggle meta box pane open and closed #71623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Size Change: +266 B (+0.01%) Total Size: 1.94 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I'm not sure this PR is still under development, but it's much better than the metabox in trunk:
3264be6dbad1b23e568e12120cc7c50e.mp4
However, I think a fundamental user request is to be able to move content and meta boxes simply by scrolling with the mouse.
In addition to this PR, it would be great if we could incorporate your Wheel meta boxes plugin to make things even smoother. What do you think?
Thanks for taking this for a spin. I had found a few things to fix and just pushed some updates. The most recent concern I had is the a11y of the toggle button. I didn't test with a screen reader but it's showing up like this when inspecting its accessibility properties in Chrome: Its child content seems to be part of its accessible text and if screen readers read all that when just the button is focused then it's trouble. For one thing, the arrow keys dow't work when that button is focused. It could be made to work but then it brings up other questions. At the moment I'm thinking to move the separator back outside of the toggle button and just overlay it.
I'm in favor of it but do have some concerns. It's not an expected UX pattern and perhaps there could be cases where folks find it more frustrating than helpful because perhaps it's easily triggered unintentionally on their device. I'd almost wish to experiment with ways to make the feature more discoverable and optional through something like a more menu: I'm not sure if you were suggesting we try adding the behavior in this PR. |
That's interesting. After shipping this PR, we can work on further improvements to the metabox UI |
Flaky tests detected in 85f6c22. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17747359176
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple of UX points I'd like to draw attention to.
const isToggleInferred = | ||
maxDelta < 1 || ( duration < 144 && maxDelta < 5 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toggle button is also usable as a resize handle. If no movement happens while clicking it's treated as intent to toggle. Further, small and quick movements while clicking on the toggle button will still be treated as a toggle instead of a resize. I'd appreciate any testing, scrutiny and feedback around this. I've really only tested with mouse input so far. I'd like to test with touchpad and see if the movement threshold should be larger for "coarse" input methods like that.
// Halves the available max height until a user height is set. | ||
usedMax = isAutoHeight && isUntouched ? max / 2 : max; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR, if the meta box pane’s height preference had not yet been set it would fit to its content while having a maximum height of half the available space. This was to avoid it taking over the entire available height and obscuring the canvas unexpectedly. Now that the open/closed preference is also in effect and the pane is closed by default (preference is unset). I decided that the initial maximum height might as well be removed. The half height maximum could be retained but I doubt it has much benefit now.
Maybe I'm missing something, but is it possible to remove the separator and aggregate all mouse and keyboard actions into a button? It looks like this: 7cd61dd5d1503714102129739e63da4b.mp4 |
Yes, it's possible. I imagine we'd want to keep the In case it wasn't clear, my concern about the arrow keys not working on the toggle button was in relation to the way the a11y text of the button was falsely indicating that by including the text of the child separator. I moved the separator out of the button and that's no longer an issue. The arrow keys always worked with the separator focused. We can make them work from the toggle button as well without having to combine both buttons but I doubted it was helpful. |
Thanks for the detailed explanation. If there is a concern about a11y, let's keep the current approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing, everything works as expected. Screen readers will read the information correctly.
I also tested it on iOS 26 and it works smoothly.
ScreenRecording_09-17-2025.19-29-12_1.MP4
Co-authored-by: stokesman <presstoke@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
In the interest of #59246.
What?
Why?
How?
Testing Instructions
General
With unset height preference
Window resizes that switch between the resizable pane to toggle-only
auto
(visually it takes over the entire content area unless its contained meta boxes are very short in which case it fits to their height).Testing Instructions for Keyboard
Screenshots or screencast