note-editor icon indicating copy to clipboard operation
note-editor copied to clipboard

a11y: announce when link popup appears

Open abaevbog opened this issue 9 months ago • 1 comments

Per https://forums.zotero.org/discussion/122292/feature-request-allow-alt-enter-to-open-links-in-notes-for-accessibility, screen reader users have no way of knowing that the popup is there, and that shift-tab would allow them to edit/open/remove the link.

Addresses: zotero/zotero#5199

This adds an announcement that screen readers read out instructing the user to Shift-Tab to get to the link popup. This is what the announcement sounds like. The actual phrasing may need to be tweaked a bit to be more informative?

https://github.com/user-attachments/assets/b5c68080-ce7f-4f5d-8da8-f32dd1c99eba

abaevbog avatar Apr 11 '25 00:04 abaevbog

With the last update, the aria-live announcement will be set using document.l10n available in zotero desktop, or from strings.js otherwise.

While working on this, I realized that we probably want to add similar handling to the citation popup as well. The idea is very similar - if one relies on screen reader, there is almost no way to know that you can edit a citation. So I added announcements for citation popup as well. Escape will now refocus the editor from citation popup too.

To keep the main editor.js file clean, I moved the handling of this aria-live logic and selecting where to get the string into its own UI component. This feels like the cleanest approach to me. I expect it will also be the easiest to extend later, if we need to add more announcements there.

abaevbog avatar Apr 16 '25 22:04 abaevbog