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

semantic (HTML5/ARIA) page structure in Journalist Interface #5987

Closed
20 tasks done
Tracked by #5972
cfm opened this issue Jun 10, 2021 · 5 comments · Fixed by #6165
Closed
20 tasks done
Tracked by #5972

semantic (HTML5/ARIA) page structure in Journalist Interface #5987

cfm opened this issue Jun 10, 2021 · 5 comments · Fixed by #6165
Assignees
Labels
a11y Issues related to accessibility
Milestone

Comments

@cfm
Copy link
Member

cfm commented Jun 10, 2021

Description

Accessibility Lab recommendations include:

  • h1...hn hierarchy
  • HTML5 section elements
  • ARIA roles ("landmarks"), labels, and descriptions

Our findings include:

  • moving decorative img elements to CSS styles on semantic elements
  • Keep in mind per @eloquence in Review and prioritize 2019 accessibility report findings #5972 (comment):

    One thing we may want to look into for the next round of changes is how to minimize the need to re-translate strings - e.g., should we generate our own translations in cases where only HTML elements or attributes change (can we do so in the main repo and then import these into Weblate?).

User Research Evidence

WCAG 1.3.1 per #5972.

Progress

To invert the way things are usually done :-):

  1. First pass: Refactor for semantic markup (test in developer tools and screen-readers) and keep journalist.js in sync
    • decorative img/hr/etc. elements: comment out as FIXMEs to move to CSS styles on semantic elements
    • linters pass
    • tests pass
  2. Second pass: Audit in validators and accessibility tools (axe, WAVE), e.g.:
    • h1...hn hierarchy
    • HTML5 section elements
    • ARIA roles ("landmarks"), labels, and descriptions
  3. Accessibility-focused review of draft PR before continuing further
  4. Review string changes for translation per Review and prioritize 2019 accessibility report findings #5972 (comment)
  5. Third pass: CSS and images broken in first pass (test visually in Tor Browser)
  6. Write and run through test plan in refactors Journalist Interface for semantic HTML5/ARIA markup #6165
Path First Pass Second Pass Third Pass
securedrop/journalist_templates
├──_confirmation_modal.html
├──_source_row.html
├──_sources_confirmation_final_modal.html
├──_sources_confirmation_modal.html
├──account_edit_hotp_secret.html
├──account_new_two_factor.html
├──admin.html
├──admin_add_user.html
├──admin_edit_hotp_secret.html
├──admin_new_user_two_factor.html
├──base.html
├──col.html
├──config.html
├──delete.html
├──edit_account.html
├──error.html
├──flashed.html
├──index.html
├──js-strings.html
├──locales.html
├──login.html
└──preferences_saved_flash.html

Specific cases

add_user.html

  • h1 should not be .visually-hidden

col.html

  • Listing of a source collection could be a semantic table
  • securedrop/journalist_templates/col.html: p.breadcrumbs is a set of unstructured inline elements; could be ul styled with li:{before,after} selectors
  • div dialogs are still being read (unlike those in index.html)

index.html

  • List of sources could be a semantic table
    • td.filename should wrap more elegantly (or not at all)
@cfm cfm added the a11y Issues related to accessibility label Jun 10, 2021
@cfm cfm self-assigned this Jun 10, 2021
@cfm cfm changed the title semantic (HTML5/ARIA) page structure: Journalist Interface semantic (HTML5/ARIA) page structure in Journalist Interface Jun 10, 2021
cfm added a commit that referenced this issue Jun 22, 2021
These ALT attributes are effectively an accessibility shim, to
provide the desired narration of flashed messages pending a
more–semantically-minded refactoring in #5986 and #5987.

See discussion in
<#5996 (comment)>.
cfm added a commit that referenced this issue Jun 22, 2021
These ALT attributes are effectively an accessibility shim, to
provide the desired narration of flashed messages pending a
more–semantically-minded refactoring in #5986 and #5987.

See discussion in
<#5996 (comment)>.
cfm added a commit that referenced this issue Jun 22, 2021
These ALT attributes are effectively an accessibility shim, to
provide the desired narration of flashed messages pending a
more–semantically-minded refactoring in #5986 and #5987.

See discussion in
<#5996 (comment)>.
@cfm
Copy link
Member Author

cfm commented Dec 14, 2021

@eloquence, per #5972 (comment), here is the translation distance incurred by the draft of #6165:

cfm@ozymandias securedrop % make translate
Updating translations...
[...]
cfm@ozymandias securedrop % git diff --compact-summary securedrop/translations/messages.pot
 securedrop/translations/messages.pot | 119 ++++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 85 insertions(+), 34 deletions(-)

A handful of these will be case changes that we can edit in bulk in the individual .po catalogs before starting localization for the v2.2.0 release. The rest we'll just need to give translators adequate time to work with, especially from updated screenshots.

@eloquence
Copy link
Member

Thanks, that's helpful! For the string changes we can apply across language immediately, should that be done as part of #6165 already or are there good reasons to hold off on that?

@cfm
Copy link
Member Author

cfm commented Dec 14, 2021 via email

@cfm
Copy link
Member Author

cfm commented Dec 23, 2021

#6165 now has a test plan, and I've updated this ticket with the things that I've caught (so far) and will fix incrementally while FPF is off between now and New Year's.

@cfm
Copy link
Member Author

cfm commented Jan 5, 2022

As outlined above, #6165 will be ready for review tonight pending CI. Of note, but out of scope of the current accessibility effort: The Journalist Interface’s style sheets tend to be more logical and DRYer than the Source Interface’s, but there’s still room for more consistency. For example:

  • Button-related styles could be refactored to be agnostic as to whether they are styling an a or a button element.
  • Buttons’ icon adornments could be streamlined by using generic selectors like [classname^="icon-"] and then adding icon-specific background properties: e.g., .icon-foobackground-image: url(foo.png).

More broadly, with the completion of this second accessibility refactoring, I see an opportunity to use a UI framework, if one exists that can be bundled acceptably or rendered server-side, to translate the current UI into reusable components, much as we’re doing in Qt for the SecureDrop Client. Such a further refactoring would make the UI more maintainable going forward, including by taking the current template-level accessibility improvements and baking them in at the component level.

@eloquence eloquence added this to the 2.2.0 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues related to accessibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants