-
Notifications
You must be signed in to change notification settings - Fork 44
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
Improve accessibility of React components #1612
Conversation
Size Change: +7.91 kB (0%) Total Size: 11.4 MB
ℹ️ View Unchanged
|
Coverage Report
File Coverage
|
packages/vit-s/src/shared-plot-options/CellColorEncodingOption.js
Outdated
Show resolved
Hide resolved
export const channelSliderStyles = makeStyles(theme => ({ | ||
valueLabel: { | ||
marginTop: '7px', | ||
'& *': { |
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.
Can this selector be more specific?
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.
Yes, done in this commit: ee2c738
return ( | ||
<TableRow> | ||
<TableCell className={classes.cameraLabel}> | ||
return use3d && ( |
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.
Is this change to using rendering vs. the disabled
prop related to accessibility?
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.
It is done for the same reasons as this one: https://github.com/vitessce/vitessce/pull/1612/files#r1266860907 Let me know if I should revert it.
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.
I read the comments further and I see that both of you are on the opinion that using disabled
is better, so I reverted this change in commit e5371cb
We should also start using https://react.dev/reference/react/useId |
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 for taking on this monumental task!
I have some suggestions after reviewing tooltip
and view-types
; I will continue my review picking up from the vit-s
directory tomorrow.
To sum up my thoughts so far:
- I agree with @keller-mark re: the use of
useId
, especially for components which may appear more than once on a page; does the current solution work if there's a second vitessce instance further down the page? - I also second preferring to disable controls rather than conditionally render them. Controls popping in and out of existence is detrimental to user experience, especially for users of screen-readers.
- I think a lot of the places where
key
is currently in use may be better served with anid
instead. - Slider accessibility may be further enhanced in cases where there are multiple thumbs on one slider by having dynamic aria labels for each thumb.
packages/view-types/layer-controller/src/VectorLayerController.js
Outdated
Show resolved
Hide resolved
packages/view-types/scatterplot-gating/src/GatingScatterplotOptions.js
Outdated
Show resolved
Hide resolved
packages/view-types/scatterplot/src/shared-spatial-scatterplot/ToolMenu.js
Outdated
Show resolved
Hide resolved
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.
After reviewing the rest of the changes, the feedback so far should cover just about everything I saw, i.e.:
- Opt for
disabled
over conditional rendering - Use
id
instead ofkey
in most places where a key has been added - Consider
useId
for anything that can appear more than once on a page
…ds in HeatmapOptions
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.
Great job, thank you for making those corrections!
I have a few remaining concerns:
- I'm not sure that using
['string-1', 'string-2'].join('-')
is the best for clarity in defining ID's; could we use template strings instead? - ARIA labels should be brief (same as any input label, ideally); if there's a full sentence/if a period is needed, using
aria-description
is a good way to provide any extra context while keeping the label itself short and to the point.
Thanks for the review @NickAkhmetov. I have now addressed all your comments. In terms of the concerns you outlined:
Yes, you are totally right, I went with
Good point. I have changed the Could you take a look at this PR again and let me know if there is anything else that should be fixed? |
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.
Great work, thank you for making those revisions! I have no further concerns; if @keller-mark has no additional comments, this should be good to merge in my opinion! 👏
packages/view-types/layer-controller/src/RasterChannelController.js
Outdated
Show resolved
Hide resolved
packages/view-types/scatterplot-gating/src/GatingScatterplotOptions.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Mark Keller <7525285+keller-mark@users.noreply.github.com>
Fixes #1467 and Fixes #787
Background
Change List
PopperMenu
clickable on touch screenChecklist
vitessce-python
andvitessce-r
if this is a release PR