-
Notifications
You must be signed in to change notification settings - Fork 4.5k
List View: Delay block highlighting when moving the mouse over the items #70732
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
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: +16 B (0%) Total Size: 1.89 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.
Code-wise this looks good and tests ok. The debounce time seems like too much to me, though, it almost gives the feeling of the UI underperforming.
@@ -97,6 +97,10 @@ function ListViewBlock( { | |||
insertBeforeBlock, | |||
setOpenedBlockSettingsMenu, | |||
} = unlock( useDispatch( blockEditorStore ) ); | |||
const debouncedToggleBlockHighlight = useDebounce( | |||
toggleBlockHighlight, | |||
250 |
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.
Oh wow, 250 feels like a lot 😅:
Screen.Recording.2025-07-16.at.20.07.24.mov
I wonder if it makes sense to use a smaller debounce wait time, like 20 or 50. Would that be a better compromise
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.
Changed wait
time to a 100
. It feels more responsive now. Let me know if you would prefer a 50
delay.
Screencast
CleanShot.2025-07-17.at.07.22.18.mp4
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, this is better, but IMO 50 hits the mark more effectively in terms of responsiveness and performance.
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'd personally adjust to 50
, but leaving it to your judgment.
Thanks!
Thanks for the review, @tyxla! I don't have a strong opinion here, so let's go with 50ms. |
…ems (WordPress#70732) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
What?
Related #70666.
Similar to #44325.
PR adds a slight delay before highlighting the block on canvas when moving the mouse over the List View items.
Why?
Previously, moving the mouse was constantly dispatching Redux actions. Similar constant updates for the
block-editor
store can be pricey, as highlighted in #70666.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2025-07-15.at.16.52.12.mp4