-
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
Image block: Revise Lightbox UI to remove reference to Behaviors #53403
Comments
Indeed, experiences suggest the feature is mainly useful for images. This might require some deep thought, not just on lightbox, but on behaviors in general. CC: @WordPress/gutenberg-design |
I think we discussed that on a previous issue. The benefit is that the lightbox should be mutually exclusive with hyperlinks, i.e. you should have one not the other. The main challenge is that for images, much of the time the lightbox can/should be a "set it and forget it" thing that ideally you don't have to set on each image block. @jameskoster had some thoughts here recently. |
It would be good to determine how granular control needs to be.
The last two seem the least useful to me, but I'm sure there will be scenarios where the per block control will be needed. |
As many users might already be using other plugins to add something similar to our Lightbox to their images, what if we wait for 1 release to activate behaviors by default? So my proposal is that for 6.4, we would ship the lightbox disabled by default, and for the following WP release, we will switch it to activated by default. |
It’s on the radar to explore a great UI for, both long term and near term. That said, for the first version I would think we can lean into having only the Global Styles UI as a place where you can set itfor all image blocks in a central location. This is the is the most important thing to get right (and why it could make sense as a future exploration to explore this toggle living in a Settings page). There’s another exciting future challenge related to the UI (which overlaps with filters): what if I want both fade and zoom? This isn't blocking, but good to keep in mind for parallel UI design work. It's also important is to have the Lightbox feature out there, as a way to test and refine the general behaviors system, so I’m keen to see it ship. But one thing that would be really good to figure out for 6.3, however, is to only fire the lightbox when it’s relevant. Consider a testimonials page that features a slew of decorative logos in a row, just unlinked image blocks as you might see on the WordPress Enterprise page. In that case, even with the lightbox applied to images by default, it would be nice if those weren't zoomable. What’s a good heuristic to omit those from the lightbox? Can we fire the lightbox only if the image would actually be scaled up when zoomed? Can we fire it only if scaled up beyond a certain threshold? |
UpdateAfter reviewing the current implementation for the lightbox UX with the design folks across the theme.json, global styles, and image block settings, it looks like we'll be taking the following approach:
Regarding this point, it's possible that we'd create confusion if the lightbox were enabled for some images but automatically disabled for others, so it seems like allowing users to configure this manually at the block level will be the approach we take. @jameskoster mentioned being able to create a design for the revised UI in the image block settings and will aim to have an update on that next week 👍 |
Here's a potential UI control for this:
In terms of placement, I lean slightly towards the Settings panel (rather than Advanced), but that’s not a strong opinion. Is it definitely too early to introduce a Behaviors panel? |
Thanks for exploring. I could see something like this living in global styles, but for each individual image block, especially since in most cases this is a global "set it and forget it" setting, this feels much too prominent, both in terms of having its own panel, being visible by default, and even surfacing the animation. Regarding that, behaviors have a potential to bring some magic to the frontend of block themes, where so far most of the magic has been happening on the back end. In some cases that means generic interfaces that can work across a variety of JS powered behaviors, like parallax or modal or something else, in other cases (like the lightbox) it really makes sense to have it only for the Image block. To that end, there are a few considerations here we need to balance:
Is it time for making the Settings panel actually into a ToolsPanel, and have the lightbox control be a non-default control which, according to your most recent idea around inheritance, could maybe be surfaced by default if the global setting is on by default? Edit: looks like my comment had been truncated! I've edited for clarity. |
That's fair.
Yes that's pretty much what I am proposing. So initially:
I suppose this means it has to go in Settings (which is currently a Toolspanel for Image blocks). Advanced is not, and may never be. When we have better inheritance handling in the future:
How do y'all feel about the toggle label? Is "Lightbox" familiar enough, or should we use the more explicit "Enlarge image on click" (or similar)? |
Sounds good, I guess the main open design question here, and this is the same issue for "Drop Cap", is: can we make it a one-click action to add the control from the ellipsis menu, rather than "add then toggle?" I don't know that lightbox is clear enough, I'd agree on expanding that. Perhaps "Zoom in on click"? Keep it short enough to not wrap. |
Close! Do we actually need the help text? I'd rather start without it and add it when we know it's needed. And should width/height/resolution show up in the tools panel dropdown? Even if they are defaults that can't be untoggled? Finally, while closed, this issue puts Alternative text in a collapsed separate panel: #38068 I'd also omit the animation picker here. I think it's too close to canonize it as a segmented control, as I could see this aspect evolving quite a bit to be almost global stylesy in nature. Just like you have a single place to change global typography, colors, spacing variables, you might also have a single place to define what types of animation are applied across both lightboxes and other aspects, and you'd need to be able to combine, mix, match, and perhaps even choose type of easing. Because this is such a rabbit hole, it seems best to either keep the drop-down in global styles only for now, or even just default to zoom until such a time as we are further with the system. |
Good thoughts, both, and I can get on board with all of it. |
We already debated renaming the Lightbox into something else. The conclusion was that we should keep the term Lightbox, so I'd prefer if we stick to that decision. On top of that, I don't think "Zoom in on click" is accurate, we are not really zooming but "expanding the image on click". Sharing this just in case we want to add some extra explanation in addition to the "Lightbox" label. |
@jameskoster Thanks for these designs! To be clear, this is the design we'd see by default in the global styles, right? And the toggle would be hidden by default in the block settings, but one could enable it like this? And this is the action one would need to take to disable the lightbox for a particular block? |
Love the explorations here! My 2c:
Thinking a step ahead, I could imagine a situation where users want extra options, such as toggling displaying the captions in the lightbox or changing the background color. With that in mind introducing a Behaviors (or "Lightbox") panel could already now make sense. |
Do we want to remove the animation picker altogether? In case this wasn't clear before: The Lightbox's |
I'm a bit skeptical of adding a dedicated panel for this, at least in the local context. We've worked long and hard to reduce the amount of bespoke panels in favor of reusable panels. If we do add a bespoke panel just for the image block, let's at least decide that it will form the foundation of a future generic "Behavior" panel, like Jay suggested initially. To that end, I personally still think that Advanced is the place for this, but if @jameskoster and @richtabor above both agree on a new panel, I'll defer to them. |
The problem with adding it under advanced is that we won't have access to "Reset to default", and as Artemio explained above we need that to
Adding it as a new setting would also work. And won't prevent the need of adding a dedicated panel for the Lightbox. @jasmussen would this solution work for you? Looks like it will for @richtabor |
Great! I'd like @artemiomorales to confirm that this change fits all the needs we discussed yesterday, but I think we have it.
Yes, let's keep it. I agree with you, that it will help to the more technical users. And for those who are not familiar with the term, we have the "expand on click". |
That latest mockup feels to me like a great i1, nice work! |
I think that would work, but does that entail adding a new "Settings" panel in the Global Styles for the Image block? This is what I referred to in my earlier comment with "However, in the Global Styles, there is no "Settings" panel. There is only a "Styles" panel". |
"Expand on click" feels better solo. I don't think a double-label is necessary. I wouldn't expect technical/advanced users to trip up here. |
I think that's fine.
Agreed. The Aspect Ratio ToolsPanelItem works like this for reference. |
Okay, I've added a note in the issue where we were discussing the naming |
@jameskoster @richtabor Ok to clarify, this would be the design in the global styles, right? And this would be the design in the block settings? Please confirm if this is the approach we can take and if so, @michalczaplinski and I will continue working on the implementation 😄 |
@artemiomorales yes, that looks right :) |
Do we want to add Push to Global Styles for the lightbox setting? I'm not sure it makes sense for the lightbox and am leaning towards no. Notably, users cannot push the duotone-push-to-global.mp4 |
I'd +1 this |
A heads up that we've received feedback from @youknowriad on the design of the UI. Right now how we've implemented it is that the block setting inherits from the global styles and Here are Riad's concerns in more detail:
I mention this here to give visibility on this and allow other folks to weigh in, thanks! 🙏 |
This problem is essentially #49278, no? I think the designs in #49278 (comment) should work for this, but I don't know that it's something we'd implement for a single control? |
That's right!
I think the designs in #49278 (comment) should work for this, but I'm also skeptical of implementing this for a single control. I also anticipate some back-and-forth on the details, which might make it hard to ship in time for 6.4. I would prefer to ship the design we already have for 6.4, and we can work on the updated controls for the next release. What do you think? cc @youknowriad |
@michalczaplinski Fine by me 👍 |
What problem does this address?
As we've explored implementing an image lightbox, it's become increasingly clear that the feature is specific to the image, so we should revise the UI to be tailored to the image block accordingly instead of being encompassed under the concept of Behaviors.
What is your proposed solution?
Let's design a simplified UX for the lightbox that makes sense in the context of just the image block.
Questions:
The text was updated successfully, but these errors were encountered: