-
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
Open inserter sidebar when clicking on inserter buttons on zoom-out mode #61434
Conversation
Size Change: +556 B (+0.03%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
rootClientId: sectionRootClientId, | ||
insertionIndex, | ||
tab: 'patterns', | ||
category: 'all', |
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.
We should probably make these private symbols
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @dean@fs276ed391.tkyc007.ap.nuro.jp. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
For what it's worth, I give a ✅ to Ella's changes, let's get someone else's approval too |
This comment was marked as resolved.
This comment was marked as resolved.
@jeryj Where do you think focus should go once you click the quick inserter? |
Also, it currently does not open the "All" category, when the inserter is already open. We should have it behave consistently, i.e. always open the "All" category. As an aside, it may need to only open the patterns tab, not the a category—but let's get it consistent with "all" first, then we can decide which works better. |
I would say the first focusable within the patterns tab panel. Right now that would be the Pattern Search input.
I think just the pattern tab without the categories open. It's a really big visual jump and easy to lose context of what is happening. Focusing the search when it opens will be a cleaner experience I think. |
e1f2b05
to
7cc2bda
Compare
Flaky tests detected in 9906c57. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8996947065
|
b0f5bb9
to
7024e02
Compare
@@ -41,15 +60,39 @@ function ZoomOutModeInserters( { __unstableContentRef } ) { | |||
key={ index } | |||
previousClientId={ clientId } | |||
nextClientId={ blockOrder[ index ] } | |||
__unstableContentRef={ __unstableContentRef } | |||
className="block-editor-button-pattern-inserter" |
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.
Do we still need this class name?
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 don't think so, it can go
It's a step forward; not the end-goal. A few notes:
|
While ac1bbad enforces patterns to insert after the previous one inserted, it negates the opening of the inserter with the "All" category selected. |
Works well. Thanks! |
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.
Looks good. Let's try an iteration that does not open "All" and focuses on search unseated.
Hey, @MaggieCabrera The new e2e test introduced here looks to be flaky - #61806. |
I'll look into it as soon as I can |
I think I know the cause of the issue: Opening the Pattern tab in the inserter closes the "Styles" sidebar and exits the "zoom-out" mode, and the "Add pattern" buttons are no longer visible. I thought that the Patterns tab in the inserter enabled "zoom-out" mode as well, so I'm not sure if this is a regression in core or just a broken test. cc @draganescu, @jeryj |
What?
Alternative to #61316
Partially addresses #59739
We are exploring not changing the text of the button yet, we want the plus button to instead of opening the quick inserter, it opens the inserter with the patterns tab selected and the All category opened instead.
Why?
In zoom out mode it makes more sense to leverage the full inserter instead of the quick one, since it's a better experience for building with patterns.
How?
We use a Button component instead of the Inserter component to open the inserter sidebar
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast