-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Notes: Fix the focus transfer issue when switching the sidebars #72486
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
| } = useBlockComments( postId ); | ||
| useEnableFloatingSidebar( resultComments.length > 0 ); | ||
| useEnableFloatingSidebar( | ||
| unresolvedSortedThreads.length > 0 || showCommentBoard |
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.
Colocated the floating sidebar rendering logic here. The hook will close it automatically if it's no longer enabled.
|
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. |
|
Size Change: +15 B (0%) Total Size: 2.18 MB
ℹ️ View Unchanged
|
jasmussen
left a comment
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, @jasmussen Bunch of the tests started failing, it could be my changes or core syncing. I'll investigate later. |
t-hamano
left a comment
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.
This is great. I've tried a variety of things, and the focus always moves correctly.
P.S. Do we need both Backport to Gutenberg RC and Backport to WP 6.9 Beta/RC labels?
They're not required, but I thought since the feature also ships with the next Gutenberg, it would be nice to have bugfixes also cherry-picked there. |
adamsilverstein
left a comment
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.
Nice one!
8826e3c to
572c623
Compare
|
I think I found cause for e2e failures. I was accidentally setting complimentary state to I added more safe guard to I would appriciate on final testing to ensure everything is working as expected. Here's logic in question, where gutenberg/packages/interface/src/store/selectors.js Lines 32 to 42 in 1fb8a63
|
|
Flaky tests detected in 9e05b10. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18692493183
|
|
Added an e2e test coverage and will merge once all checks are green again. |
94076ce to
9b90d54
Compare
9b90d54 to
9e05b10
Compare
Co-authored-by: Mamaduka <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: adamsilverstein <[email protected]>
|
I've cherry-picked this manually onto the |
Co-authored-by: Mamaduka <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: adamsilverstein <[email protected]>

What?
See: #72431 (comment) and #72157 (comment).
PR fixes a focus transfer bug when adding the first note via the floating sidebar. Because of the condition, the sidebar was mounted too late, and the
commentSidebarRefwasn't available.I've moved the condition, and now it's all handled by the
useEnableFloatingSidebarhook.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2025-10-20.at.15.45.02.mp4