-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Notes: Hide pinned sidebar when there are no notes #72872
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: -9 B (0%) Total Size: 2.45 MB
ℹ️ View Unchanged
|
|
@Mamaduka - this empty pinned sidebar state will never show after this change: gutenberg/packages/editor/src/components/collab-sidebar/comments.js Lines 310 to 326 in b41c908
|
|
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. |
|
The test failures seem to be coming from focus loss, eg here is the first one: gutenberg/test/e2e/specs/editor/various/block-comments.spec.js Lines 69 to 70 in b41c908
When testing manually, after submitting the new note, I briefly see the note disappear, then reappear and regain focus. That seems off, ideally the new note form would transform into the new thread without that refresh. Are we already working on that? in any case, introducing a brief delay before the focus check might fix this? Screencast - everything but selecting "... Add note" is done with the keyboard: Screen.Recording.2025-11-01.at.11.56.16.AM.mov |
Yes, that's how it should seem for a user. Internally, that's not how it's happening. The notes query will be re-triggered and re-render the whole tree, also rendering our new note. It's odd that the first focus test started failing after this change. It was working normally for the pinned sidebar. |
I was able to validate the issue manually by using --debug and pausing the test in-flight. I see focus is not restored to the thread. When I was testing locally I did not see this issue. I noticed it does not happen with the second block created, adding a second block to the first test fixed it. |
|
@Mamaduka The first test failure is odd, it fails to refocus on the first block. I verified by interrupting the test, but when I try with the same dev environment manually following the steps, focus works fine. I adjusted the test to add a second block, where you can see the focus test passes. The other two failures had to do with testign resolved notes which disappear in the floating mode. For these, I added |
|
Flaky tests detected in db347d4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19059318654
|
|
@Mamaduka I was able to validate the test failure is legitimate. it is reproducable If you throttle the network connection focus is not restored to the first new note: Screen.Recording.2025-11-03.at.4.54.03.PM.movOne thing you can see in the video that happens for the first note only is the sidebar disappears entirely briefly. Once there is one note in place, adding the second note is slightly different. the sidebar never disappears and the focus is set properly on the note i just created: Screen.Recording.2025-11-03.at.4.58.01.PM.mov |
e1fd087 to
195c449
Compare
…ppears and re-appears Fix a focus issue on inital note save
f997401 to
8dd8e05
Compare
|
Thanks for debugging, @adamsilverstein! The manual repro step gives me some ideas why it might be happening - #72872 (comment). I'll continue debugging further. P.S. Sorry, I accidentally removed your commits with rebasing :( I've restored those changes, except for the real failure, which we've to fix. |
|
I figured it out actually, the issue is with the mutation observer - it is observing the sidebar that disappears and reappears. I have a fix in place I will force push for your review... |
|
Thank you, @adamsilverstein! Confirmed that fix is working correctly and all e2e tests are now passing locally. @t-hamano, do you mind doing a review? I think a fresh perspective would help us here. If everything is fine, we can merge this for beta 3. |
|
This pull request seems to be working correctly, but I want to double-check whether we should proceed with it. See #72771 (comment) |
|
I think it was mentioned in associad PRs for that issue, that we should supersede it with this one. I don't have a strong opinion here, but we also don't have time for lengthy arguments for the WP 6.9 release cycle. We should either merge this or punt them. |
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.
Spectacular!
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.
Yes, let's prioritize this PR for now 👍
|
There was a conflict while trying to cherry-pick the commit to the wp/6.9 branch. Please resolve the conflict manually and create a PR to the wp/6.9 branch. PRs to wp/6.9 are similar to PRs to trunk, but you should base your PR on the wp/6.9 branch instead of trunk. |
|
@Mamaduka, do you have the bandwidth to manually cherry-pick this PR into the |
|
@t-hamano, working on it 👍 |
Co-authored-by: Mamaduka <[email protected]> Co-authored-by: adamsilverstein <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: jeryj <[email protected]> Co-authored-by: jeffpaul <[email protected]> Co-authored-by: desrosj <[email protected]>
|
Here's the manual backport PR - #72961. |
Co-authored-by: adamsilverstein <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: jeryj <[email protected]> Co-authored-by: jeffpaul <[email protected]> Co-authored-by: desrosj <[email protected]>
|
Can we avoid the manual backports by rebasing or merging trunk before merging commits? |
|
@adamsilverstein All modifications related to the notes should have been backported, so conflicts should not generally occur. In this PR, a conflict occurred due to differences between the trunk: gutenberg/packages/editor/src/components/editor/index.js Lines 112 to 119 in 5a123f7
wp/6.9: gutenberg/packages/editor/src/components/editor/index.js Lines 90 to 95 in e9d0e14
|
What?
Closes #72750.
Also closes #72785
PR hides "All notes" sidebar, when there are no notes for larger screens. It's still enabled for mobile screens, since it's only way to interact with notes there.
Why?
See #72750.
Testing Instructions
E2e tests cover behavior.
Testing Instructions for Keyboard
Same.