-
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
Improvements to how blocks with a 'disabled' editing mode behave #51148
Conversation
- Prevent DefaultAppender from appearing in a disabled block. - Disable selection (using user-select: none) in disabled blocks. - Prevent blocks from being inserted into a disabled block via global inserter. - Prevent disabled blocks from being removed via keyboard shortcut. - Prevent disabled blocks from being moved via List View drag and drop. - Prevent block overlay from appearing on a disabled block.
Size Change: -5 B (0%) Total Size: 1.39 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.
Works as advertised. With the diff applied:
✅ Prevent DefaultAppender
from appearing in a disabled block.
✅ Disable selection (using user-select: none
) in disabled blocks.
✅ Prevent blocks from being inserted into a disabled block via global inserter.
✅ Prevent disabled blocks from being removed via keyboard shortcut.
✅ Prevent disabled blocks from being moved via List View drag and drop.
✅ Prevent block overlay from appearing on a disabled block.
Tested without patch and can't detect any regressions in editing or template locking
…dPress#51148) - Prevent DefaultAppender from appearing in a disabled block. - Disable selection (using user-select: none) in disabled blocks. - Prevent blocks from being inserted into a disabled block via global inserter. - Prevent disabled blocks from being removed via keyboard shortcut. - Prevent disabled blocks from being moved via List View drag and drop. - Prevent block overlay from appearing on a disabled block.
Hello folks, this PR made the "type" performance 30% worse, I think we should definitely look into that. |
Will look into it! |
Quick update on fixing the performance regression here. I've merged a few PRs that should reduce the number of times that various components re-render while typing: #51628 The main problem introduced by this PR though is that we're now calling
Will open a PR to address these two issues. |
Thanks for the follow-ups @noisysocks I appreciate it. It's a bit unfortunate that we had this unexpected change in the metrics recently so we can't see the impact of these improvements on the graph so smoothly. |
I've fixed codevitals.run (I had to remove some wrong intermediate numbers). It seems the numbers are not back to where they were before for the typing metric. Do you think #51675 will do the trick? |
I think #51675 will definitely be the most impactful change millisecond wise. Let's merge it and see what happens 😅 |
I think that's fixed it @youknowriad. The spike at the end seems to be from codevitals getting confused and thinking that 7f4d64b6 comes after a8ce505d. |
@noisysocks Thanks indeed. For the order, I do have a "date" saved to be able to order properly but I just discovered that we're always saving the same wrong date. Something to be fixes there 👍 |
…dPress#51148) - Prevent DefaultAppender from appearing in a disabled block. - Disable selection (using user-select: none) in disabled blocks. - Prevent blocks from being inserted into a disabled block via global inserter. - Prevent disabled blocks from being removed via keyboard shortcut. - Prevent disabled blocks from being moved via List View drag and drop. - Prevent block overlay from appearing on a disabled block.
What?
Follows #50643.
Split out of #50857.
Various improvements to how blocks that have
useBlockEditingMode( 'disabled' )
behave.DefaultAppender
from appearing in a disabled block.user-select: none
) in disabled blocks.Why?
See #50857.
How?
Mostly the changes are at the model level (
canInsertBlockType
,canMoveBlock
,canRemoveBlock
, etc.). Most of the block editor uses these methods to determine which bits of UI to display.Testing Instructions
pbpaste | git apply
.