-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Try to improve featured image style and accessibility #3829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an accessibility perspective, having two buttons that do the same thing but have different text is not ideal.
The first button says: "No image selected"
The second button says: "Add image"
That's potentially confusing and duplicates the controls for no purpose other than visuals. Also, the "placeholder" with text "No image selected" indicates the current state, not the available action of the button.
This was discussed at length for the customizer in https://core.trac.wordpress.org/ticket/34323 and my argumentation there can be summarized in "If the placeholder is clickable, what's the purpose of the "Select Image" button?"
Then, the image widget recently implemented a clickable div but that's not ideal and should be improved.
For Gutenberg, I'd recommend to consider if there's really the need of 2 separate controls that do the same thing.
What if we keep just the "placeholder" button using as text "Add image"? the state can be inferred, there's probably no need to explicitly say "No image selected".
As per the labels, I think the default ones come from the core get_post_type_labels()
function.
There's a lot to this, so I appreciate your time. Would the following work? State: No featured image:
State: Featured image added:
Alternately, can you sketch out (just on paper or in text) what you would consider the ideal flow, accessibility wise? Thanks. |
Perfect.
Not so ideal for accessibility. In WordPress, we've removed the title attribute that was used on the featured image, together with tons of other title attributes. In this case using both aria-label and title attribute with the same text would be redundant (both would be announced). |
I'd be okay with a non-clickable image and two buttons below. But before I do anything, I feel like I should get a sanity check from @karmatosed and @melchoyce on this. I believe in the media widget, the dashed area is also a dropzone...? |
Yes it is 😬 see my previous comment:
|
Reminder: about the alt attribute, see some important considerations in #1520 (can be addressed there, I guess) |
This is an attempt to fix #1116. It redesigns the Featured Image panel to more closely resemble both the visual style and the markup/accessibility of the Image widget. One problem this PR has right now, is that I'm not quite sure how to update/tweak the labels, that appear to be using a `postLabel` function. As such when building this the labels were wrong. Any idea what this might be, @youknowriad
44f37ec
to
2efe7bb
Compare
Looking closer at the labelling, I think maybe I can't easily change the labels (seems like they're coming from the REST API), so I'll probably take another stab at this one in light of that. Feature wise, though I'd love input by @melchoyce as I know you worked on the media widget. |
I constantly see people clicking the images and the placeholder in usability tests. I'm on support this week and can't spend time on core, but remind me after the new year and I'll try to dig up some examples. |
As discussed at length in the context of https://core.trac.wordpress.org/ticket/34323 users click the "placeholder" because it looks like an actionable control 🙂 so I'd say it's a design issue in the first place. Maybe the purpose of the placeholder should be clarified first: what it should be/do, exactly? If it's meant to just inform users about the state, then it should not look like an actionable control. |
I would +1 bringing this as close to the media widget in core as we have right now. Interested in what you can bring example wise to this @melchoyce when you are back. |
@jasmussen is this still on your radar? 🙂 Seems a good improvement. See #1116 (comment) |
Yes still on my radar, thanks. It was recently unblocked so will take another stab as soon as I can. 👍 |
This commit reproduces #3829, but with slightly better code. The rebase was also too complex.
Closing this in favor of #7200, which is a replacement for this. |
* Try improving the a11n of the featured image feature This commit reproduces #3829, but with slightly better code. The rebase was also too complex. * Try customizing the labels instead of relying on those from the postLabel * Fix modal title, and let blocks align next to each other * Address feedback. * Fix modal title. * Address feedback, restore postLabel. * Tweak "Remove" button. * Revert last button. * Clean up CSS. * Add isScary prop to button. * isScary to isDestructive
This is an attempt to fix #1116.
It redesigns the Featured Image panel to more closely resemble both the visual style and the markup/accessibility of the Image widget.
One problem this PR has right now, is that I'm not quite sure how to update/tweak the labels, that appear to be using a
postLabel
function. As such when building this the labels were wrong. Any idea what this might be, @youknowriadScreenshots of how it should look (labels were wrong, so those are edited in the Chrome inspector):
As a reminder, this is how the Image widget looks: