-
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
Close inspector on pattern category select #60004
Conversation
Size Change: +123 B (0%) Total Size: 1.72 MB
ℹ️ View Unchanged
|
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 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. |
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.
This is working well for me @draganescu 👍
Screen.Recording.2024-03-20.at.11.36.26.AM.mp4
Initially I thought I'd have to add it to the post editor but then I saw we auto close the inspector the moment the inserter is open there. This should be unified too I think.
Agreed.
The e2es failures are unrelated and due to docker startup failure so I've just kicked them off again.
I think that only happens on smaller screens. I would love to see user feedback on this change. Personally, I would be annoyed that I have to re-open the sidebar every time I browse patterns. |
I can confirm this. Turns out I had dev tools open to the right while testing earlier. |
@@ -65,6 +68,9 @@ export default function InserterSidebar() { | |||
insertionPoint.insertionIndex | |||
} | |||
__experimentalFilterValue={ insertionPoint.filterValue } | |||
__experimentalOnPatternCategorySelection={ | |||
isRightSidebarOpen ? closeGeneralSidebar() : undefined |
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.
isRightSidebarOpen ? closeGeneralSidebar() : undefined | |
isRightSidebarOpen ? closeGeneralSidebar : undefined |
We should pass the function.
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.
Nice, a solid exploration. Can we try it only when zoomed-out?
@richtabor I think this has value w/o zoom out as well since inserting patterns is a more "splashy" effect on the canvas and more space to see it is better. |
Let's give it a try like this. |
Closely related to #59775, as that effort enables zoom out when viewing patterns. |
Yea, I feel that too. Why I was thinking about engaging this behavior in zoom-out mode. The difference here is that selecting a pattern category engages a third sidebar area on the canvas, that will remain open per #59741 as you add patterns to the page. This feels a bit much: |
I agree it's a bit much and it's made visible by the drag and drop e2e test failure in my PR. One idea could be to hide the inserter temporarily while dragging. When the inserter is open, the main value of the "canvas" is when you're dragging, otherwise it's not that important. |
Downside there is that the canvas will shift once you initiate a drag, which I don't think will be ideal. |
I will update the behaviour to only occur in zoom out mode. |
f4f65a9
to
a7c4d19
Compare
* close inspector on pattern category select * send stable references to the pattern category click handler * fix passing the callback not calling it, add behavior to post editor * only toggle if zoom out mode experiment is on
@@ -45,6 +46,7 @@ function InserterMenu( | |||
showMostUsedBlocks, | |||
__experimentalFilterValue = '', | |||
shouldFocusBlock = true, | |||
__experimentalOnPatternCategorySelection = NOOP, |
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.
This seems like a new public API. Just a reminder to stop adding prefixed experimental APIs like that. It's preferred to add private APIs going forward. 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.
Yes, good point! 🤦🏻 I copied #56773 verbatim. Would a linter that says no when we use __experimental
help ... probably not 😁
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.
There are is still time to make it private for 6.6, no?
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.
Oh yes!
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.
Opened #62110 but I am a bit unclear how to proceed with privatizing a component that was public but marked experimental - since that will create a public experimental and a private experimental component :/
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.
Alternative PR here: #62130. Would love some testing to land this for 6.6.
What?
Close #59963
Why?
How?
Mostly copy #56773
Testing Instructions
Initially I thought I'd have to add it to the post editor but then I saw we auto close the inspector the moment the inserter is open there. This should be unified too I think.
Testing Instructions for Keyboard
N/A
Screenshots or screencast
hide-inspector.mp4