Skip to content
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

Merged
merged 23 commits into from
Nov 29, 2023

Conversation

j264415
Copy link
Contributor

@j264415 j264415 commented Oct 12, 2023

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:

  • Added alt and title description to images and icons

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

@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@j264415 j264415 changed the title addition of alt description part 2 addition of alt description Oct 12, 2023
@j264415 j264415 changed the title addition of alt description Addition of alt descriptions Oct 12, 2023
@j264415 j264415 changed the title Addition of alt descriptions Added alt descriptions to Icon and Images Oct 16, 2023
@j264415 j264415 marked this pull request as ready for review October 16, 2023 10:27
@j264415
Copy link
Contributor Author

j264415 commented Oct 16, 2023

please update galata snapshots

packages/help-extension/src/index.tsx Outdated Show resolved Hide resolved
packages/ui-components/src/icon/labicon.tsx Outdated Show resolved Hide resolved
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
packages/help-extension/src/index.tsx Outdated Show resolved Hide resolved
packages/launcher/src/widget.tsx Show resolved Hide resolved
<img
src={item.kernelIconUrl}
className="jp-Launcher-kernelIcon"
alt={trans.__('Kernel Icon')}
Copy link
Contributor

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=""?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@j264415 j264415 Nov 3, 2023

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".

packages/ui-components/src/icon/labicon.tsx Outdated Show resolved Hide resolved
j264415 and others added 3 commits November 2, 2023 16:55
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
@krassowski krassowski added this to the 4.1.0 milestone Nov 2, 2023
krassowski
krassowski previously approved these changes Nov 2, 2023
Copy link
Member

@krassowski krassowski left a 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>
@@ -875,6 +875,7 @@ export namespace Dialog {
iconClass="jp-Icon"
className="jp-ToolbarButtonComponent-icon"
tag="span"
title={trans.__('Close dialog')}
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@krassowski krassowski dismissed their stale review November 3, 2023 10:28

Clearing my review for now to avoid confusion as Gabriel raised some important points

Copy link
Member

@fcollonval fcollonval left a 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.

packages/launcher/src/widget.tsx Outdated Show resolved Hide resolved
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
@j264415
Copy link
Contributor Author

j264415 commented Nov 28, 2023

Thanks @j264415

I have a minor comment. After that this is good to go.

Hi @fcollonval all done!

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@krassowski krassowski changed the title Added alt descriptions to Icon and Images Added alt descriptions to a few icon and images Nov 29, 2023
@krassowski krassowski merged commit 937bdc3 into jupyterlab:main Nov 29, 2023
76 of 78 checks passed
chisangajm3 added a commit to chisangajm3/jupyterlab that referenced this pull request Dec 18, 2023
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants