-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles: Make search more responsive for block type list #56139
Conversation
Size Change: +404 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
packages/edit-site/src/components/global-styles/screen-block-list.js
Outdated
Show resolved
Hide resolved
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.
Besides the typo this is good to land, thanks! In my testing this is a great improvement for the search. 🚀 I'm curious if we can find similar cases in our codebase and do the same.
I think @tyxla did a similar optimization for the Inserter but with debouncing. Maybe we can swap that. The “native” solution should be more performat. |
What?
PR improves perceived performance when searching for a block in the Global Styles block types list.
The screencasts below are without CPU throttling, but the difference is more visible when it's enabled.
Why?
Searching for a block type was sluggish.
How?
See: https://react.dev/reference/react/useDeferredValue#deferring-re-rendering-for-a-part-of-the-ui
Testing Instructions
Testing Instructions for Keyboard
Same
Screenshots or screencast
CleanShot.2023-11-15.at.16.49.43.mp4
CleanShot.2023-11-15.at.16.50.31.mp4