Repository navigation
Conversation
|
Size Change: +242 B (0%) Total Size: 8.44 MB 📦 View Changed
|
|
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. |
| // Apply the scroll effect to the sidebar ref. | ||
| useEffect( () => { | ||
| if ( commentSidebarRef?.current ) { | ||
| return scrollToCanvasEffect( commentSidebarRef.current ); |
There was a problem hiding this comment.
This isn't how ref effects work; you should either attach events inside the effect or pass scrollToCanvasEffect as ref to the element.
There was a problem hiding this comment.
I've made some changes based on your feedback in 71e0695. Is this approach correct?
|
Flaky tests detected in 4177a22. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27125351488
|
…k selection The floating comments sidebar forwards wheel events to the editor canvas, but previously the canvas was looked up via the selected block. When no block was selected, the lookup returned null and wheel forwarding stopped working. Resolve the canvas from the first block in the editor so scroll forwarding keeps working regardless of selection state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@Mamaduka Thanks for the reply! Personally, I believe this PR is a good enhancement, despite the implementation of the new scroll sync logic. The current floating note area does not accept mouse scrolling. Therefore, to view the notes below, we need to move the mouse pointer to the editor canvas and then scroll. trunkbefore.mp4this PRafter.mp4 |
|
Thanks for the additional details, @t-hamano! I think logic can be moved into the new |
# Conflicts: # packages/editor/src/components/collab-sidebar/comments.js
|
@Mamaduka Thanks for the review!
I think we could have achieved a similar outcome with significantly less code 👍 |
|
Thanks for the update, @t-hamano! This generally works okay, but before we move forward, it would be nice to consider UX and whether it's worth hijacking native wheel behavior. Currently, there's no indicator for the user that this action will scroll the panel + content. cc @jameskoster Some technical notes:
Info dump from AI
Real-world example: Firefox on Windows/Linux with a classic notched mouse wheel emits Chrome/Safari normalize to pixel mode for most input, so they're fine — but Firefox is the canary here, and it's a supported browser. |
|
I agree that this is a nice enhancement. It certainly aligns with my UX expectation.
This sounds more like an accessibility question. cc @WordPress/accessibility. |
|
From an accessibility perspective, I think that this is OK, for a couple of reasons:
There may be side effects from this that we haven't anticipated; but personally, as soon as there's any part of the notes panel that's outside of the viewport, I expect to be able to scroll the notes panel using the mouse wheel, regardless of the lack of a scroll bar. I wasn't able to view the videos; they don't seem to be present at the moment, and haven't run the PR. Is scrolling forwarded directly, so it's equal, or does it forward based on whether the current note is attached to a new block? |
This change applies only to floating notes (All Notes sidebars have native scrolling), where each note is attached to a block. So I would say it's equal scroll - you scroll floating notes, and it also scrolls the canvas to show related blocks. |
…pixels Lets a scrollable element inside the floating sidebar (e.g. a tall thread) consume the wheel until it hits its edge, then resumes canvas scroll. Also normalizes `WheelEvent.deltaY` by `deltaMode` so Firefox's line/page-mode events scroll the canvas at native speeds instead of crawling a few pixels per notch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
I made two changes:
This is a video on Windows OS using Firefox. It seems to be working well. Recording.2026-05-04.184042.mp4 |
|
Seems #77433 closed #73653 - do we still need this PR @t-hamano ? Later edit - it seems we do :D because this is clearly an enhancement. I think this is connected to my input and the PR about the background color in #74112 (comment) As it is today it's extremely jarring that the canvas which is not separated in any way from the floating notes does not scroll if I hover over the floating note area. |
|
I believe this PR is still necessary to resolve some of the issues in #80449. See #80449 (comment) |
🤖 PR meta 🤖📦 Bundle sizeSize Change: +287 B (0%) Total Size: 8.21 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
draganescu
left a comment
There was a problem hiding this comment.
not sure if its a me problem but on Chrome 152.0.7977.84 (Official Build) (arm64) on macos I get this weird sluggins scroll if I scroll while hovering the notes float area
scroll-slow.mp4
draganescu
left a comment
There was a problem hiding this comment.
It was a theme issue - themes that fiddle with scroll behavior should not interfere with this work.
| canvas, | ||
| panel.ownerDocument.defaultView | ||
| ); | ||
| canvas.scrollBy( 0, deltaYInPixels ); |
There was a problem hiding this comment.
| canvas.scrollBy( 0, deltaYInPixels ); | |
| canvas.scrollBy( { top: deltaYInPixels, behavior: 'instant' } ); |
This makes it so that themes that set html { scroll-behavior: smooth } do not interfere with this behavior.
|
Also #79864 kinda resolves this - except for scrolling over a card. |
The floating panel becomes a real scroller mirrored with the canvas, and the canvas root gets a min-height so it can scroll to the lowest thread. Wheel, keys, Tab and scrollIntoView() work natively. Fixes #80449. Supersedes #73655. Co-authored-by: Aki Hamano <t-hamano@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Cllosing this in favor of #83852 |
The floating panel becomes a real scroller mirrored with the canvas, and the canvas root gets a min-height so it can scroll to the lowest thread. Wheel, keys, Tab and scrollIntoView() work natively. Fixes #80449. Supersedes #73655. Co-authored-by: Aki Hamano <t-hamano@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Trying one approach to solving #73653.
What?
This PR propagates mouse scroll events to the editor canvas, making it easier to bring overflowing floating note content into view.
Why?
Floating notes are auto-aligned to the block position, and even if they overflow, the note sidebar is not scrollable, so you have to move your mouse cursor to the editor canvas and scroll there, which is a bit tedious.
Testing Instructions
Screencast
a3d14bd058fa3048c56c6845ab3e95ee.mp4