-
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
ContextPopover: Component to manage controls within Sidebar #23486
Comments
I love the idea of focusing the controls so I only have to see the controls relevant to what I'm trying to change. That will be a big win. One added benefit is that it greatly reduces the complexity in the block sidebar -- perhaps so much that we could remove the need for most of the accordions. It can be tedious to constantly open and close the accordions. As for the design, I think it would be good to try a few iterations. On these items: I wonder if it would be good to make the colors/gradients circles, images as a cropped rectangle, and maybe even a text preview somehow (particularly useful when we get into typefaces). Those are likely separate issues, but definitely worth exploring. Looking at the modal: I wonder if styles similar to the inserter (heavier borders) could help. And maybe make it edge to edge over the sidebar? |
I didn't change any other design 😊 . I left the current Color components alone. I had a brief chat with @LevinMedia and Figma was brought up. Where it's rendered off to one side. There's some benefits to this. It looks like Figma takes it one step further... allowing you to drag the Modal/Popover 😊 |
This is exactly what I was going to suggest. It feels like similar to the way block previews work in the sidebar Inserter. |
@shaunandrews Yiiisss!! I feel like we're onto something :D |
That's a great idea. Would love that. |
I've created a deploy preview for my experiments! https://itsjonq.xyz/iframe.html?id=components-contextpopover--default Have a play ✌️ |
Haiii! I haven't forgotten about this. I attempted to code this today. Unfortunately, I ran into some limitations with our current In my prototypes, I used If we want to move forward, we'd have to either...
|
Hi there! 👋
Hope you all are doing well! I'm submitting a feature request for a new component (ContextPopover) to help simplify and improve the experience with Block (inspector) controls that appear in the sidebar.
Overflow
(Above: Screenshot of Paragraph blocks color settings)
Certain block settings may render a lot of control UI. These controls often grow over time, whether it's from core enhancements or from theme settings (e.g. color palette).
Controlling Overflow
(Above: Screenshot of color settings simplified with ContextPopover)
My idea is to hide some of that visual complexity in a popover/modal like experience with a new
<ContextPopover />
component.When collapsed, it only shows the most important information. In the above example, a preview of the color value and the attribute it is assigned to.
If we need to modify one of the values, the item can be clicked, which renders a Popover card positioned relatively to the original item. Other things in the sidebar fade away into the background. This brings focus to the settings we're currently editing.
Here is an initial comparison between the current sidebar controls, and one simplified with ContextPopover:
In practice, it may look and feel something like this:
(Above: GIF demoing the interaction experience of ContextPopover)
Screencast Demo/Walkthrough
I recorded a quick screencast sharing my thoughts:
https://www.loom.com/share/68b587b57bc64c2f8b06ad6dc61691c9
Implementation + A11Y
I suggest we leverage
Popover
from Reakit (shoutouts to @diegohaz ) to a lot of the heavy lifting in regards to interaction and a11y. From a UI perspective, we have some pieces already, such as a<Card />
component from@wordpress/components
.We'll need to work out a nice component API that can seamlessly manage the "Trigger" (the element the user clicks) and the Content (the stuff that renders within the popover).
Feedback
I'd love to hear your thoughts! ❤️
Thank you!!
The text was updated successfully, but these errors were encountered: