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

Desktop: Resolves #11621: Accessibility: Add status update after update #11634

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

pedr
Copy link
Collaborator

@pedr pedr commented Jan 13, 2025

Resolves #11621

Summary

While searching notes on Desktop there was no feedback on screenreaders on how many resulting notes were available, if any.

This PR addresses this behaviour by adding an aria-controls tag to the list of notes and a role "status" to the message of an empty note list.

Testing

  1. Start Joplin with a screen reader
  2. Press F6 to navigate to the search field
  3. Make a search
  4. The screen reader should be able to dictate the change in the results, announcing something similar to "Multidash selected list with 77 items" (for orca screen reader) or the default message shown when no notes are available.

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Jan 13, 2025

The accessibility tester is failing in CI — it looks like the aria-controls='search-results' is being added to the plugins screen in addition to the main screen.

Error: expect(received).toEqual(expected) // deep equality

- Expected  -  1
+ Received  + 40

- Array []
+ Array [
+   Object {
+     "description": "Ensure all ARIA attributes have valid values",
+     "help": "ARIA attributes must conform to valid values",
+     "helpUrl": "https://dequeuniversity.com/rules/axe/4.10/aria-valid-attr-value?application=playwright",
+     "id": "aria-valid-attr-value",
+     "impact": "critical",
+     "nodes": Array [
+       Object {
+         "all": Array [
+           Object {
+             "data": Array [
+               "aria-controls=\"search-results\"",
+             ],
+             "id": "aria-valid-attr-value",
+             "impact": "critical",
+             "message": "Invalid ARIA attribute value: aria-controls=\"search-results\"",
+             "relatedNodes": Array [],
+           },
+         ],
+         "any": Array [],
+         "failureSummary": "Fix all of the following:
+   Invalid ARIA attribute value: aria-controls=\"search-results\"",
+         "html": "<input type=\"text\" placeholder=\"Search for plugins...\" spellcheck=\"false\" aria-controls=\"search-results\" class=\"sc-eeDRCY sc-dtBdUo bKptan Qsarb\" value=\"\">",
+         "impact": "critical",
+         "none": Array [],
+         "target": Array [
+           ".sc-eeDRCY",
+         ],
+       },
+     ],
+     "tags": Array [
+       "cat.aria",
+       "wcag2a",
+       "wcag412",
+       "EN-301-549",
+       "EN-9.4.1.2",
+     ],
+   },
+ ]
 
       26 | 	await waitForAnimationsToEnd(page);
       27 | 	const results = await createScanner(page).analyze();
     > 28 | 	expect(results.violations).toEqual([]);
          | 	                           ^
       29 | };

Note that the automated accessibility tests can be run locally with yarn test-ui wcag from packages/app-desktop.

Thank you for working on this!

@personalizedrefrigerator personalizedrefrigerator added the accessibility Related to accessibility label Jan 13, 2025
@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: Accessibility Resolves #11621: Add status update after update Desktop: Resolves #11621: Accessibility: Add status update after update Jan 13, 2025
@personalizedrefrigerator personalizedrefrigerator added the desktop All desktop platforms label Jan 13, 2025
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator left a comment

Choose a reason for hiding this comment

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

For the most part, this looks good to me! I've left two (minor) comments.

Thank you for working on this!

@@ -302,6 +302,7 @@ const NoteList = (props: Props) => {
onKeyUp={onKeyUp}
onDrop={onDrop}
onContextMenu={onContainerContextMenu}
id='search-results'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
id='search-results'
id='notes-list'

Since this <div> is also used for displaying the notes list (when not searching), an ID of notes-list might make more sense.

@@ -198,7 +198,7 @@ const NoteList = (props: Props) => {

const renderEmptyList = () => {
if (props.notes.length) return null;
return <div className="emptylist">{getEmptyFolderMessage(props.folders, props.selectedFolderId)}</div>;
return <div className="emptylist" role="status">{getEmptyFolderMessage(props.folders, props.selectedFolderId)}</div>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

(Optional) Consider leaving a comment that explains why role='status' is used here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility desktop All desktop platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search result count announcements. (SC 4.1.3)
2 participants