-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Top Toolbar: Fix 'collapsed' state synchronization #59267
Conversation
Size Change: +20 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 5b32de9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8000492105
|
Thanks for noticing and getting a PR in! I have a #58979 that adds a hook to make it more reliable to know the state if the toolbar is showing or not. I believe that PR would fix this as well. Would you be willing to give it a review? 🙏🏻 |
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. |
@jeryj, I'm sure happy to help with testing and reviews. However, I think we should avoid cherry-picking extensive refactoring like that in the WP beta releases. We can merge this as a stopgap fix for WP 6.5 and continue work on #58979. Update: The refactor PR currently doesn't include a side-effect fix. |
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.
LGTM !
- Block toolbar expands whenever a new block is selected
- No unnecessary vertical separators are displayed when a post title is selected.
I also think it's better to backport only smaller regression fixes to WP6.5 for now.
9910ace44615e910b8edc0606b441567.mp4
Agreed! I’d rather not include include the larger refactor as well.
|
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jeryj <jeryj@git.wordpress.org>
I just cherry-picked this PR to the cherry-pick-wp-6-5-beta-3 branch to get it included in the next release: ed1e641 |
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jeryj <jeryj@git.wordpress.org>
What?
Fixes #59263.
PR fixes 'collapsed' state synchronization for the Top Toolbar in the post editor.
Why?
The side-effect should react to every block selection state, not only when there is block selection or not.
How?
blockSelectionStart
to reset the block toolbar's collapsed state.is-collapsed
class. The toolbar always collapses when there's no block selection.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2024-02-22.at.10.27.49.mp4