-
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: further usability and accessibility improvements for the Lightbox #55513
Comments
#55859 introduced a couple accessibility regressions that unfortunately have been released with WordPress 6.4.
|
I don't agree with this sentiment.
The entire image is selectable; not just the button.
The transparency is dependent on the background behind the image. It's also blurred; with increased saturation, ensuring the white icon is visible on both the lighted of images, and the darkest. I think this is a subtle enough visible indicator that you can select the image to expand it, without being so dramatic (as originally designed). |
I'd kindly argue that these are subjective opinions. The point here is that the trigger button is now not accessible and violates two success criteria in WCAG 2.2. This is a fact, not a subjective opinion or sentiment. |
The button target is superficial; the entire figure is selectable. |
WCAG 2.2 guidelines are not subjective sentiments + mobile issue@richtabor I agree with @afercia on this one where it comes to the WCAG violations. It's not sentiment. The guidelines are there for good reason. I fully understand where whoever decided for the transparency came from, from an aesthetic point of view. But as much as we designers love aesthetic artful designs, web design remains a creative way to solve problems. It should not create them. Deeming this "a subtle enough visible indicator", is subjective. I may be overlooking it, but I don't see any color / transparency controls for the user who chooses the lightbox functionality. If those indeed aren't there, pushing this on users "by design" is an issue. The contrast on a light background is too low. That's not an opinion. That's a measurable contrast failure. The only reason automated testing doesn't immediately flag it, is because it's a transparent SVG.
I would kindly ask you to try navigating it yourself with your keyboard only. When you do that, you will see that then there is no indication of the entire image being focusable. (see screenshot). If that was indicated correctly, the focus would be around the entire image, not only on the button. Food for thought: The impact of this design choice on conversion It's a UI/UX matter that needs to be improved. Either by giving colour and opacity controls to the person adding in the image block, or by making the visibility of the button to be more dramatic by default. 🙏 |
@Bovelett thank you for your feedback and detailed argumentations. To me, it's time to fix this issue. I'm also changing the label 'Bug' to 'Regression' as the original change is a regression. This is the before and after reproted earlier: It's pretty clear this isn't OK. Also, from an usability and accessibility perspective, there must be a way for users to understand which images have a lightbox and which ones don't. As mentioned earlier:
I'll try a PR soon. |
Noting that #54837 aimed to improve the Lightbox buttons styling to make sure they don't conflict with the CSS of a theme that can include styles for I'd tend to think the lightbox buttons should not be styleable by themes so they should either use a very high specificity or even Twenty Thirteen default Twenty Thirteen while clicking the button to open the lightbox i.e. |
One of the issues original reported on #55428 (comment) is about the absence of any visual hint that an image can be enlarged. In a page with many images, where only a few of them open in a Lightbox, users wan't have any way to understand the difference unless they hover or focus an image. This applies to the editor canvas as well, where there's no visual hint at all not even when hovering or focusing the image. The only wai to understand an image has a lightbox is:
That is at least two clicks to understand whether an image has the lightbox enabled. Not sure that's an ideal user experience and I think there should be a clear visual hint in the editor as well. As an example, the screenshots below illustrate a series of images where some of them do have a lightbox and some don't, but there's no way to understand the difference. |
@afercia I am currently exploring enhancements for the lightbox implementation and just read through the discussion here. I have a few questions:
|
I'm not sure that would be ideal. Rather, thinking especially at the Gallery, I'd envision a routing mechanism integrated with the browser history API to allow navigation through images in a gallery. With that in place, navigating to each enlarged image would be sort of navigation to another resource so that a link wrapping the image would make more sense. Alas, so far, the Gallery doesn't allow navigation and it's only a basic implementation.
I'd definitely agree the trigger button should always be visible otherwise there's no way to distinguish which image has a lightbox and which not. Right now, users have to discover it by trying to hover or focus all the images. As an higher level consideration, I think the fundamental problem with the Interactivity API is that, so far, the HTML output is opinionated. Traditionally, WordPress has always provided ways to filter and change any HTML output. That was in the era where the front end was a theme authors responsibility. Now that the block editor shifts that responsibility to content creators and puts all the power in their hands, I think the editor should at the very least provide settings to change the output. For example, the Navigation block does provide settings to collapse the menu into an expandable panel and settings to change the button that opens the menu. In fact, the button can be set to show only an icon or text. Screenshot: Similarly, the Image (and Gallery) block should provide settings to change the output. At the very least, there should be a setting to change the trigger button from an icon-only button to a button with visible text. I'd like to remind that icon-only buttons are not accessible especially when they don't visually expose their accessible name (and there's no Tooltip to use for the front end). A setting to show text would make the front end output more accessible, leaving the responsibility of the decision to content creators. Screenshot to better illustrate: I did start some work to implement the icon/text setting but postponed it so far because of the complexity due to dealing with theme settings and global settings. Hopefully I'll be able to resume that work soon. |
Makes sense regarding gallery. How about a single image block though? There's no navigating through multiple images there, it's only to show the one image in a lightbox.
Makes sense to me, thanks! 👍
I think this would make sense to have a UI control for, and it should be totally feasible given there's pre existing art with the navigation overlay toggle as you mentioned. |
The semantic and experience for images should be consistent for single images and images in a gallery. I'm not sure wrapping a single image within a button would add value for users in the first place. An image is content and sgould not live inside an interactive control. |
Doesn't doing so clarify that you can click on the image? Currently, without being a button, there are no semantics indicating that the image opens a lightbox.
If an image should not be in a button, how should this then work for galleries, where you are saying that a lightbox would make more sense? How would users open the gallery view?
Are you suggesting that we use e.g. |
There is a separate button for that reason. The image itself opens the lightbox only with pointing devices / touch.
If there was a routing mechanism, for both single image and for galleries, I would have no big objections to consider the lightbox as sort of navigation to another resource, which would make a link Would love to hear thoughts also from others passionate about semantics and expected interaction Cc @joedolson |
I think it's reasonable to offer options where a link is appropriate, but it does depend on having a routing mechanism that makes the URL for that link navigable, and I can definitely see use cases - like sharing a link to a specific image in a gallery - where it would be desirable to link directly to the lightbox open for that image. But if there's no way to navigate to a particular view by URL, then you shouldn't trigger that view using a link. |
@joedolson Would it be reasonable to wrap the image in a link ( In other words, the lightbox would be an alternative way to view that full-size image file. |
The raw image file is a different user experience than the image in a lightbox - as a raw image, it won't have any alternative text, captions, or any other kind of accessibility-supported information. So even though that would technically fulfill the idea of providing a link target, it's providing different information depending on how you reach the URL, and I don't really think that's a good experience. |
If the link action appended a fragment identifier to the URL, and used that as a trigger to open the light box at entry, then I think that would be more equal. The fragment identifier should probably not actually target an ID attribute, so that browser-native fragment navigation would still work, but could be read from the URL to determine which lightbox to trigger. |
Thanks, that makes sense. So potentially we could use a link like Related question: When closing the lightbox, should that URL fragment be removed via browser history API, or is no change needed (i.e. it would remain)? I'm asking since out of the box, I believe clicking the link to open the lightbox would add it, but the close button wouldn't remove it. |
It should be removed, I think. |
Description
Follow up to #55428
The Image block lightbox has room for further fixes and improvements. See comment #55428 (comment)
Any further usability and accessibility concerns that may arise with more extensive testing should be reported o this ticket.
Step-by-step reproduction instructions
Please see testing instructions and discussions on
#55428
#55414
#55212
#55097
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: