-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Show/Hide BlockToolbarPopover via CSS #56910
Conversation
…en since that means a different thing to playwright
…__experimentalOnIndexChange
Once the block toolbar popover is mounted, it will remain mounted until the block id changes. This is a lot of extra work to delay this mounting. It could be a performance improvement in one sense, but the top toolbar and mobile toolbars get remounted each time a block changes, so I lean towards removing all this work and keeping the code simpler.
Ideally, this metric should be similar to the performance of the typing metric of when the toolbar is not mounted (typing perf results).
Size Change: -211 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in 8cab8f6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7144595768
|
This reverts commit 06b687d.
I think this PR isn't worth continuing. While in theory it is simpler, it doesn't equate to a performance gain. The BlockPopover seems heavy enough that it being mounted while typing slows things down too much. I did performance checks on typing in different conditions and the best typing results were those where no block popover was mounted. I thought it would have been the BlockToolbar being mounted that impacted it, but even having a BlockPopover with no toolbar in it was slower than a mounted Top Toolbar.
|
POC at this point. If we can get the typing metric down for when the block toolbar is mounted, we could simplify the code further by removing the "don't mount it until typing stops" part.
What?
Instead of unmounting/remounting the BlockToolbarPopover, once it is mounted, keep it mounted until the block id changes.
Why?
How?
Instead of unmounting/remounting the popover when typing stops, show/hide it via CSS.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast