-
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
Widget Editor: relationship between the Edit and Preview toggle buttons is not obvious #25960
Comments
I am going to add an idea that just came off the top of my head....(I am not saying it is a good or bad idea, and maybe I am just adding it to create some inspiration/brain storming session...) Why? Cons Perhaps the question that ends up is should we add any icons/features directly into the widget title bar to show something that affects all the widgets in a specific widget area? Or perhaps are there any features that should be added into the sidebar widget area settings? |
Would that also affect the HTML block or any other block that may not be a widget but uses this switch as a pattern? Also having an "Edit" and "Preview" option in the area bar seems to state that it would affect everything in the area, not just widgets. As a user would I expect to see a change in regular blocks that I've added there too? My goal with the Legacy Widget is to have that block automatically switch to a Preview state when unselected as long as it has the necessary amount of info filled out to render the frontend version of the widget in the widget area. This should help alleviate this problem. |
Here is an associated/duplicate issue: #26182 |
I'll flag I had the same confusion with the Edit/Preview thinking it was a button I needed to click to be able to edit the widget. The ticket I had opened #26229, if being handled here can possibly be closed. |
Because of the location of that Preview btn, I would expect it to work just like in the Post Editor and push me to a frontend preview of the site. At that point how does it know which page to push the user to? Not all pages would show all the widget areas from the widget screen. For this reason, I think a Preview btn needs to be tied to the widget itself, or an easier way as I suggested above to automatically switch the widget to preview mode. |
This is how I understand your suggestion, Mark.
That sounds like a good and simple approach. |
Also recorded in the feedback on the Call for Testing post: https://make.wordpress.org/core/2020/09/30/call-for-testing-the-widgets-screen-in-gutenberg-9-1/
This feedback is great! It's obvious this is an issue for users, so reaching a solution here would be very beneficial. |
As indicated here: #11952 there were issues when we were using icons only. The Edit icon (ie. pencil) didn't translate well for people in some 10up usability tests. I ran through several iterations to try some ideas out. None of them feel solid. But in an effort to keep the toggle interaction, Iteration 1 felt the most intuitive. I'm still preferable to the Edit and Preview buttons though... I'll keep iterating. |
Nice I like those @mapk |
I love it @mapk that embodies the feeling of a toggle exactly without losing much of the design or going into a vastly new direction. It has my vote out of all of them. |
@ItsJonQ is this something you'd be able to take a look at? |
@mapk I could help with this. The UI/interaction you folks have designed is similar to Apple's Segmented Control. The grouping of 🍬 TrickyThe tricky part is the auto-expanding width animation. For reference, I've created a SegmentedControl modelled after iOS in G2 Components. Although we technically have Button components and a ButtonGroup pattern, to achieve this effect, I advise that we need a brand new component. ⚙️ MechanicsDiving into the mechanics a bit... How it works is the background (in the case of your design, the "black" part), needs to be it's own layer. Let's call it "Backdrop". The text content float on top of it. The "Backdrop" would then need to calculate it's width/position based on the current selection, as well as the next selection on change (e.g. going from Edit -> Preview). I'm not sure how the Figma was mocked for this. But I suspect something similar had to be done (with a dedicated rectangle shape for the background). I'm just leaving these notes for design/dev awareness. 🔨 Building itIf you folks feel like this is the way to go, then we can build it 💪 . I believe a good component library should have some form of SegmentedControl anyway. If the effort I described is out of scope (for animation handling, etc...), one path we can take is to use the existing Would love to hear your thoughts! |
Thanks @ItsJonQ! I took a look at the Button Group which I believe is this control here from the Cover block: This might do as long as it can be resized to work well within the block toolbar. While I'd love the addition of the animation on a Segmented Control component, I'm willing to try a Button Group as an MVP right now. Basically, we need to solve the problem which is that these two buttons, "Edit" and "Preview" don't appear to work together as a toggle. A side note: the Button Group isn't looking right in Story Book. BTW, you're correct on the Figma implementation of the prototype. It's a background that resizes and animates after click. |
This sounds like a good approach to me. |
#30889 removes this interaction altogether. |
Describe the bug
It took me a while to figure out how the 'Edit' and 'Preview' toggle buttons work. At first, I thought this was a bug, where I was able to activate the 'Preview' toggle but not turn it off.
I think that part of my confusion comes from two things:
Instead, the toggle action uses two separate buttons, and I think this can lead to confusion, as it did for me.
Expected behavior
I'd recommend sticking to the toggle button pattern we already use in the block editor and use only one button to switch between 'Edit' and 'Preview' modes.
The text was updated successfully, but these errors were encountered: