-
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
Zoom out: show patterns when clearing block selection #61428
Conversation
Size Change: +54 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
let sectionRootClientId; | ||
|
||
if ( __unstableGetEditorMode() === 'zoom-out' ) { | ||
sectionRootClientId = unlock( |
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 wonder if we should do this earlier - in usePatternCategories, or even in InserterMenu?
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 think doing it here in usePatternsState is fine - we're already using the blockEditorStore
here so I don't think it feels too late. I looked at doing it earlier and it felt kind of out of place in usePatternCategories, InserterMenu, and BlockPatternsTab - it seems to require more code as we're not already calling the store in these files.
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 wonder if actually we want to create a new selector for this, so we can access it in different places.
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.
Trying that here: #61464
Should we revert changes from #61002 if/when we land this? |
Closing in favour of #61464 |
What?
Why?
When in zoom out mode, and no block is selected, the block editing mode for the root is disabled, so we need to use the section root instead. Patterns should be inserted at the "section root", not the root of the document.
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast