You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image block: Revise Lightbox UI to remove reference to Behaviors #53403
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:
How are we going to surface the lightbox as a setting of the image block?
How are users going to activate the lightbox?
Will the lightbox come activated by default?
Will it be a global setting for all images?
How will the user deactivate the lightbox on a specific Image?
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.
A global setting caters to the "set and forget" idea.
A global setting per image – possibly controlled in the media library – is a helpful affordance for applying a behavior to all instances of a given image.
A local per pattern/container setting?
A local per block setting that overrides all of the previous options.
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?
After 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:
Remove the lightbox's theme.json support for now
Rename the lightbox labels to remove references to "behaviors" in the global styles
Revise the UI in the image block settings (we need a new design for this)
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?
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 👍
How familiar is “Lightbox” as a term? The label may instead read “Enlarge image on click” which would produce a shorter help text.
I added a “None” option for animation to facilitate simpler designs.
@jasmussen I know you mentioned combining animation effects, but I'm not sure we need that here? Zooming and fading together would look a bit strange imo.
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?
Right now how we've implemented it is that the block setting inherits from the global styles and theme.json, and the global styles inherits from the theme.json, and while the value can be overridden, the inheritance isn't shown explicitly in the UI.
Here are Riad's concerns in more detail:
The reason I'm insisting here is because this setting is going to create a precedent both in terms of UI and behavior, it's the first "block attribute" that can be enabled globally in theme.json and modified locally as well. (I think layout is similar but its UI is probably not the best).
Also, in global styles, we already have several issues that were raised because of this: in global styles, in most UI, we have "reset" links to reset to the theme.json provided values but we don't have the UI to explicitely reset styles to "undefined". (We need to solve that at some point and your work here is going to help us I believe).
I mention this here to give visibility on this and allow other folks to weigh in, thanks! 🙏
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?
Activity
jasmussen commentedon Aug 8, 2023
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
SaxonF commentedon Aug 16, 2023
Does it make sense to just add a Lightbox option under image link?
jasmussen commentedon Aug 16, 2023
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.
jameskoster commentedon Aug 16, 2023
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.
Poliuk commentedon Aug 16, 2023
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.
jasmussen commentedon Aug 18, 2023
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?
artemiomorales commentedon Aug 18, 2023
Update
After 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 👍
jameskoster commentedon Aug 21, 2023
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?
34 remaining items
artemiomorales commentedon Aug 29, 2023
@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 😄
jameskoster commentedon Aug 29, 2023
@artemiomorales yes, that looks right :)
artemiomorales commentedon Sep 1, 2023
@jameskoster @jasmussen
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
duotoneto the Global Styles:duotone-push-to-global.mp4
SaxonF commentedon Sep 3, 2023
I'd +1 this
artemiomorales commentedon Sep 6, 2023
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
theme.json, and the global styles inherits from thetheme.json, and while the value can be overridden, the inheritance isn't shown explicitly in the UI.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! 🙏
jameskoster commentedon Sep 7, 2023
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?
michalczaplinski commentedon Sep 7, 2023
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
youknowriad commentedon Sep 7, 2023
@michalczaplinski Fine by me 👍