Skip to content

Image block: Revise Lightbox UI to remove reference to Behaviors #53403

Closed

Description

@artemiomorales

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:

  1. How are we going to surface the lightbox as a setting of the image block?
  2. How are users going to activate the lightbox?
  3. Will the lightbox come activated by default?
  4. Will it be a global setting for all images?
  5. How will the user deactivate the lightbox on a specific Image?

Activity

  1. added
    Needs Design
    [Block] Image
    [Feature] Interactivity API
    on Aug 7, 2023
  2. jasmussen commented on Aug 8, 2023

    @jasmussen
    Contributor

    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

  3. removed their assignment
    on Aug 8, 2023
  4. removed their assignment
    on Aug 8, 2023
  5. SaxonF commented on Aug 16, 2023

    @SaxonF
    Contributor

    Does it make sense to just add a Lightbox option under image link?

    image
  6. jasmussen commented on Aug 16, 2023

    @jasmussen
    Contributor

    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.

  7. jameskoster commented on Aug 16, 2023

    @jameskoster
    Contributor

    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.

  8. Poliuk commented on Aug 16, 2023

    @Poliuk
    1. Will the lightbox come activated by default?

    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.

  9. jasmussen commented on Aug 18, 2023

    @jasmussen
    Contributor

    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?

  10. artemiomorales commented on Aug 18, 2023

    @artemiomorales
    ContributorAuthor

    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:

    • 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 👍

  11. jameskoster commented on Aug 21, 2023

    @jameskoster
    Contributor

    Here's a potential UI control for this:

    lightbox
    • 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?

    Frame 11
  12. 34 remaining items

  13. artemiomorales commented on Aug 29, 2023

    @artemiomorales
    ContributorAuthor

    @jameskoster @richtabor Ok to clarify, this would be the design in the global styles, right?

    global-styles-lightbox-design-v2

    And this would be the design in the block settings?

    block-settings-lightbox-design-v3

    Please confirm if this is the approach we can take and if so, @michalczaplinski and I will continue working on the implementation 😄

  14. jameskoster commented on Aug 29, 2023

    @jameskoster
    Contributor

    @artemiomorales yes, that looks right :)

  15. moved this to 🏗️ In Progress in WordPress 6.4 Editor Taskson Aug 29, 2023
  16. added
    [Type] Enhancement
    on Aug 30, 2023
  17. added
    [Status] In Progress
    and removed
    Needs Design
    on Aug 30, 2023
  18. artemiomorales commented on Sep 1, 2023

    @artemiomorales
    ContributorAuthor

    @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 duotone to the Global Styles:

    duotone-push-to-global.mp4
  19. SaxonF commented on Sep 3, 2023

    @SaxonF
    Contributor

    I'm not sure it makes sense for the lightbox and am leaning towards no.

    I'd +1 this

  20. artemiomorales commented on Sep 6, 2023

    @artemiomorales
    ContributorAuthor

    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 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! 🙏

  21. jameskoster commented on Sep 7, 2023

    @jameskoster
    Contributor

    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?

  22. michalczaplinski commented on Sep 7, 2023

    @michalczaplinski
    Contributor

    This problem is essentially #49278, no?

    That's right!

    This problem is essentially #49278, no?

    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

  23. youknowriad commented on Sep 7, 2023

    @youknowriad
    Contributor

    @michalczaplinski Fine by me 👍

  24. removed
    [Status] In Progress
    on Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] Image[Feature] Interactivity API[Type] Enhancement

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions