-
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
Navigation Link: Improve accessibility by removing non-interactive tooltips #68628
Navigation Link: Improve accessibility by removing non-interactive tooltips #68628
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@himanshupathak95 thanks for wokring on this! However, I wouldn't use an
I'd suggest to do this:
|
Thanks @afercia, for the suggestion. I have removed the labels as suggested. Please let me know if there is a way to improve further 🚀 |
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.
Everything looks good to me.
The only thing I would consider to change is luminous-vivid-amber
because it doesn't reach a sufficient color contrast ratio with the white background. What about using vivid-red
for both invalid and draft?
To recap what this PR does: it removes the incorrect usage of tooltips currently used to communicate the link state in case the link is missing, invalid or still pointing to a deleted or trashed / trashed page. Screenshots of the removed tooltips: These states are already sufficiently communicated by the visible label. Screenshots from this PR (amber suggested to be changed to red): |
Hey @afercia, I have changed the wavy underline color from amber to red as per the suggestion. Please let me know if there is still room for improvement. |
@afercia In my opinion, if the problem with the amber color is the low contrast with a white background, maybe we can use a darker intermediate color? ( like mustard ) I feel the |
@himanshupathak95 Yes I would agree that, conceptually, they are two different cases. However, that is based on the idea that the 'wavy underline' should communicate the type of warning. Should it? Wouldn't be simpler to always use the red 'wavy underline' as a visual hint for something that needs attention / fix? More or less, like the spellchecker red wavy underline, which doesn't tell what is wrong and it's just a signal of potential error. |
Thanks, @afercia for the wonderful explanation. It makes sense now that I see it that way. I understand that the wavy underline serves as a universal signal for "needs attention”. The underline draws attention while the text itself can communicate the specific issue. The current implementation aligns with this idea - |
@himanshupathak95 thanks for the screenshot, that illustrates very well the good job you did in this PR. I'm going to have a final look and merge it, thanks! |
I noticed the padding of the underline was inconsistent in the default placeholder 'Add link' and the draft/invalid labels:
In the last commits I restored the original markup because the After: @himanshupathak95 can you please check I didn't break anything 🙂 when you have a chance, thanks! |
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.
LGTM
padding-bottom: 0.1em; | ||
} | ||
|
||
|
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.
@afercia Is the extra new line here intentional or can it be removed?
Thanks a lot, @afercia, for noticing the inconsistent padding and fixing it 🙇🏻 The changes test well for me. I think the PR is ready to ship once we remove the extra new line (if it was not intentional) 🚀 |
Oh 🤦🏻 |
Just to be sure, does the |
I think the |
Good point but it's an existing issue and should be addressed separately. For example, the blue wavy underline for the default 'Add link' placeholder is barely visible on a dark background. Screenshot with Twenty Twenty-Four > Maelstrom variation: Re I will create a new issue for the wavy underline on dark background. |
That's certainly true.
This CSS variable appears to be used in various places in the Gutenberg project to represent an "error" or "invalid" state (Example). Therefore, I would like to submit a follow-up PR that uses this variable. |
@himanshupathak95 Have you tried the following format? &.is-invalid,
&.is-draft {
span {
--wp-underline-color: #{$alert-red};
}
} |
No, I didn't try this back then, but now I tested it and it's working. |
@himanshupathak95 Would you like to submit a follow-up PR? You worked on this issue, so you probably know more about it than anyone else 🙂 |
Thanks for asking, @t-hamano, Yes, I will raise a PR shortly |
Are you referring to the |
Yes, I just found that out. I got confused, apologies. |
Fixes: #68597
What?
Improves accessibility in the Navigation Link block by replacing tooltips with visual states for invalid and draft links.
Why?
The current implementation misuses tooltips to show additional information about link states. This creates accessibility issues.
Testing Instructions
Test Missing Link State:
Test Invalid Link State:
Verify:
Test Draft Link State:
Verify:
Screencast
Before
Screen.Recording.2025-01-15.at.11.52.35.mov
After
Screen.Recording.2025-01-15.at.11.48.17.mov