-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Added alt descriptions to a few icon and images #15265
Conversation
Thanks for making a pull request to jupyterlab! |
please update galata snapshots |
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
packages/launcher/src/widget.tsx
Outdated
<img | ||
src={item.kernelIconUrl} | ||
className="jp-Launcher-kernelIcon" | ||
alt={trans.__('Kernel Icon')} |
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.
Same: what is the rationale for not setting alt=""
?
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.
The reason alt is not an empty string is because we believe it is not a decorative element and adds value to the end users.
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.
In the accessibility call today, we discussed a scenario in which the text description that a kernel provides to describe itself might make it unclear in the launcher that it is a kernel. Imagine a kernel called Coconut that labels itself as just "Coconut." In that case, it might be helpful to a screen reader to announce the launcher card as "Kernel Icon coconut".
We also discussed some alternative in the call. What if the alt text were something like "Create new notebook using kernel", so then the full accessible text for a Python 3 ipykernal notebook launcher card would read like so: "Create new notebook using kernel Python 3 (ipykernel)". That seems a bit verbose to me but clear.
My chief concern in asking these questions is to avoid a common pitfall, which is: in our desire to make things better for disabled users, we actually make them worse. I want to try to avoid that.
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.
Hi @gabalafou your comment makes sense and I completely understand where you are coming from. Thanks for the feedback. I have made the change that you have recommended for the alt text being "Create new notebook using kernel".
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
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.
Thank you @j264415, this looks good from my side.
Co-authored-by: gabalafou <gabriel@fouasnon.com>
packages/apputils/src/dialog.tsx
Outdated
@@ -875,6 +875,7 @@ export namespace Dialog { | |||
iconClass="jp-Icon" | |||
className="jp-ToolbarButtonComponent-icon" | |||
tag="span" | |||
title={trans.__('Close dialog')} |
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.
Testing this last night, I realized that this "x" button already had an accessible name: "Cancel". See line 870 above. I don't understand the rationale for adding an additional title here because we end up with the following HTML tree structure:
button title=Cancel
span title=Close dialog
svg
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.
So would you recommend I take out the additional title on line 878.
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.
Perhaps.
But I'm also really trying to understand what led you to change this line in the first place. When you were working in the UI, was your assistive tech not picking up the "Cancel" title? I'm very curious to know if you were using some OS + screen reader combination that wasn't picking up the title attribute of the button or something like that. Or if there was some other underlying reason. It would be good to have as much information as possible in order to make the best decision.
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.
Hi, just tested this with the screen reader, to see if the title="close dialog"
was needed and it wasn't needed after all as it was already picking up the title="cancel"
; so I have take it out.
Clearing my review for now to avoid confusion as Gabriel raised some important points
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.
Thanks @j264415
I have a minor comment. After that this is good to go.
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
Hi @fcollonval all done! |
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.
Thanks
* upstream/main: (7628 commits) Adopt ruff format (jupyterlab#15499) Bump scipy from 1.11.3 to 1.11.4 (jupyterlab#15474) [pre-commit.ci] pre-commit autoupdate (jupyterlab#15491) Pin `actions/labeler` to v4 to fix failing CI action (jupyterlab#15496) Add npm provenance issue to the list of release postmortems (jupyterlab#15493) Fix URLs in debugger-extension (jupyterlab#15462) Bump tj-actions/changed-files from 40.0.2 to 40.2.0 (jupyterlab#15471) Bump dessant/lock-threads from 4 to 5 (jupyterlab#15472) Bump pandas from 2.1.2 to 2.1.3 (jupyterlab#15473) Bump actions/github-script from 6 to 7 (jupyterlab#15470) Bump matplotlib from 3.7.2 to 3.8.2 (jupyterlab#15475) Bump rjsf to 5.13.4 (jupyterlab#15469) Don't play with the focus when handling focus event (jupyterlab#15408) [ci skip] Publish 4.1.0a4 Updated light theme visited link colour to make text visible (jupyterlab#15406) Load custom CSS functionality and documentation (jupyterlab#14743) Added alt descriptions to a few icon and images (jupyterlab#15265) More robust galata/UI tests (jupyterlab#15355) Fix Shift + L not working in stdin (jupyterlab#15440) Upgrade releaser workflows for silent support (jupyterlab#15446) ...
This PR is to replace the #14320 addressing the requested changes from @isabela-pf and @gabalafou feedback from that PR.
References
#14320 Add more alt text descriptions
Code changes
These are the additional changes made :
Made changes to packages/apputils/src/dialog.tsx line 390 by changing the kernelIconURL alt tag to
<img src={kernelIconUrl} alt={trans.__('Project Jupyter')} />
per @isabela-pf request.Removed the title from the arguments that is being passed into
_initSvg
that were asked for from @gabalafou in the packages/ui-components/src/icon/labicon.tsx line 552 and 825.This PR also retains the changes from #14320:
User-facing changes
Icons and images have descriptive labels when you hover over them these will also be picked up by screenreaders.
Backwards-incompatible changes
None