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

fix accessibility #2705

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

fix accessibility #2705

wants to merge 14 commits into from

Conversation

arthur-lemeur
Copy link
Collaborator

@arthur-lemeur arthur-lemeur commented Dec 11, 2024

Fixes #2698
Fixes #2700
Fixes #2709
Fixes #2710
Fixes #2711
Fixes #2715
Fixes #2714
Fixes #2718
Fixes #2724
Fixes #2735
Fixes #2728
Fixes #2729
Fixes #2731

(PS : The "Tag" element from React Aria does not allow for a "title" attribute ([https://react-spectrum.adobe.com/react-aria/TagGroup.html#tag]), I updated the "textValue" attribute (rendered as "aria-label") to be localised instead. According to the documentation, this is the attribute used for accessibility on this element.)

@gautierchomel
Copy link
Member

gautierchomel commented Dec 11, 2024

Aria is used by assistive technologies and, therefore, targets a subset of readers with accessibility needs. It is always better to have an accessible name available for all readers (as title) instead of a specific user agent category.

@gautierchomel
Copy link
Member

Any way I can't find the "textValue" attribute (rendered as "aria-label") in that PR.

Copy link
Member

@gautierchomel gautierchomel left a comment

Choose a reason for hiding this comment

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

If title does not refer to the HTML argument title="", then it should have another name to avoid confusion.

src/renderer/reader/components/ReaderMenu.tsx Outdated Show resolved Hide resolved
@gautierchomel gautierchomel self-requested a review December 11, 2024 14:01
@arthur-lemeur arthur-lemeur changed the title fix missing titles for accessibility in annotations menu fix accessibility Dec 12, 2024
Copy link
Member

@gautierchomel gautierchomel left a comment

Choose a reason for hiding this comment

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

Not sure if Zen mode replace Full screen. In this case, the old key should be deleted.

@@ -1043,7 +1043,7 @@ const AnnotationList: React.FC<{ annotationUUIDFocused: string, resetAnnotationU
</div>
</summary>
<TagList items={selectDrawtypesOptions} className={stylesAnnotations.annotations_filter_taglist}>
{(item) => <Tag id={item.name} className={stylesAnnotations.annotations_filter_drawtype} textValue={item.name}><SVG svg={item.svg} /></Tag>}
{(item) => <Tag id={item.name} className={stylesAnnotations.annotations_filter_drawtype} textValue={item.title}><SVG svg={item.svg} /></Tag>}
Copy link
Member

Choose a reason for hiding this comment

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

Why not reuse similar pattern to the annotation panel selector?

title={`${type === "solid_background" ? __("reader.annotations.type.solid") : type === "outline" ? __("reader.annotations.type.outline") : type === "underline" ? __("reader.annotations.type.underline") : type === "strikethrough" ? __("reader.annotations.type.strikethrough") : __("reader.annotations.type.solid")}`}

@@ -1043,7 +1043,7 @@ const AnnotationList: React.FC<{ annotationUUIDFocused: string, resetAnnotationU
</div>
</summary>
<TagList items={selectDrawtypesOptions} className={stylesAnnotations.annotations_filter_taglist}>
Copy link
Member

Choose a reason for hiding this comment

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

This taglist element is rendered as a non semantic div.
Checkboxes with labels would be more appropriate.

Copy link
Member

Choose a reason for hiding this comment

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

added those keys to the localisation table in the support pages edrlab/thorium-reader-doc@c7453f8

Copy link
Member

Choose a reason for hiding this comment

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

Not sure if Zen mode replace Full screen. In this case, the old key should be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment