- Notifications
You must be signed in to change notification settings - Fork 17
Proposal for supporting wide widget controls #89
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
Conversation
| Heh. Dig the subtle messages to me in the screenshots. :) I think this is a good solution — I'm still a little uneasy about having a different UX for wide widgets, but this works. I'll play with the positioning of the controls so they're closer in context to the widget-top — and maybe add a pointer on the controls to help make the connecting between them and the widget being edited. Nice work. |
| @shaunandrews I updated my sample single widget plugin as depicted in the screenshots 😉 https://gist.github.com/westonruter/7141599 |
| Awesome. Shaun
|
| Awesome! it worked well with my own widget plugin. I noticed black tinymce widget had some trouble showing up properly, might be due to it not loading its scripts on the customizer screen. What is supposed to happen when a user has a wide widget control open and they then click 'add widget'? |
😄 Yes. The Black TinyMCE plugin isn't coded in a way that makes it compatible, it seems. I looked at the source briefly, and it seems maybe that it just needs to be updated to use the right hooks, but that's just the impression I had. |
A widget added to a sidebar leaves its widget_id in the sidebar even when the widget goes away, for example due to a plugin deactivation. Now any such widget remants will get filtered out when sent to the client. Without this fix, a JavaScript error would be thrown: > Uncaught TypeError: Cannot read property 'transport' of undefined
| @PeterKnight fixed that issue in 05f0e15 |
Prevents abundance of expanded widget controls from cluttering up the customizer. Solves problem of wide widget controls from appearing over each other. When one wide widget is expanding while another is collapsing, the expanding one will always have a higher z-index than the collapsing one.
Fixed-positioned widget-inside keeps position when scrolling, resizing the window, and when reordering widgets in the sidebar. The widget control remains in view even when the widget-top is scrolled out of view.
| @shaunandrews @PeterKnight please review the latest changes. The vertical position of the wide widget control now is kept in sync with the vertical position of the widget-top. If the widget-top is scrolled up out of view, then the widget controls remain stuck to the top of the screen. Likewise, if the widget-top is scrolled to the bottom, the widget controls will only go so far as the bottom of the screen. The idea is that the widget control should never get scrolled out of view while it is open: Note also that now only one widget control may be opened at a time. I think this is actually as it keeps the customizer from getting cluttered with lots of expanded controls, and it makes it easier when multiple wide widget controls are expanded. |
| I like these latest improvements a lot, the workflow is much better and working great so far on my install. I'm guessing next step is a better experience for when the widget control overlaps the widget in the preview? |
| @PeterKnight I was kinda hoping that the ability to scroll the wide widget control up and down over the preview would allow the user to easily get it out of the way. If it is still stuck in the way, it could always be collapsed for a quick peek. Do you have any other recommendations? Two other thoughts are:
|
| The problem with having the user scroll both widget control and widget into view is that it can be impossible to do. Take the black tinymce widget plugin,it takes up a lot of space and if the widget is inside a left sidebar, I can barely get a glimpse of it and that's with a 23inch monitor and maximized browser. Transparency, I gave that a go but I don't think it would ultimately work, it wouldn't fly with accessibility folks I think because they'd say its giving up readability. In terms of dragging the control. I think that works but it's another little thing for a user to learn to do. It would also be strange to do it considering that dragging widgets used to be a pain point in the main widget screens. On top of that, would the drag position be saved when the user decides to refresh the entire customizer page? One alternative that shouldn't be too hard to test now is by doing a little calculating with jquery position and having the controls positioned left, above, or right of the widget in the preview depending on the screen size & height, widget width, and controls width & height. For example, twenty fourteen has a narrow left sidebar, it would be intuitive to place the widget control to the right of that. I'd love to see how that stacks up in some user tests. I was thinking it might be nice to collapse the sidepanel at the same time so a user can maximum the screen real estate. An added benefit there would be that singular focus given to editing a widget. |
Or widgets can appear in the center column or take up the entire page, for that matter. For a very large widget, such as Black TinyMCE, it's the nature of the beast for them to be hard to fit in the UI. Given that the user can always just collapse the widget to see any widget in the preview that may be covered by the wide widget control, I think that this is going to be acceptable for now. We can open additional issues/tickets for how to improve the previewability of changes to widgets with wide controls, but I think we've got a suitable solution in place right now to propose for merging into WordPress core. @shaunandrews @MichaelArestad thoughts? If you agree that we're on the right track and this is an acceptable solution to move forward with, I'll merge the PR. |
Refresh position of wide widget when another widget collapses (or expands)
Add support wide widget controls
| Any additional tweaks can be added to the |
| Awesome. I'll take a look sometime tommorrow when I get back to Colorado. (Unless plane has wifi)-Michael On Sat, Feb 8, 2014 at 9:17 PM, Weston Ruter notifications@github.com
|

When a wide widget control is collapsed, the triangle arrow that normally points downward instead points rightward:
When a wide widget control is expanded, the arrow switches to be leftward pointing, to indicate the direction it will collapse.
When you focus on a wide widget control, the corresponding
widget-topwill highlight to indicate which widget it is part of:If there are multiple wide widget controls open at a time, hovering over the control or the widget title will indicate the two are connected:
Todos:
z-indexFixes #18