Skip to content

fix firefox/all screen reader flow #15082 #16172

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Ingi-Hong
Copy link
Contributor

@Ingi-Hong Ingi-Hong commented Apr 10, 2025

One-line summary

Realized I accidentally closed the last PR so reopening this one. My attempt at fixing the a11y issues brought up in the original issue. It extends off of #15293 which I thought was 99% of a solution and worth exploring further. This is my first time trying to fix a screen reader specific issue so feedback is appreciated!

Significant changes and points to review

This change focuses the header of the active step after the innerHTML is set. This ensures the focus only occurs when the user is navigating through the steps, and not on a full page load.

In #15293 the #installer-help and #browser-help modals were not working, due to the innerHTML being set and losing all attached listeners. Now after the innerHTML is set the modal listeners are re-attached.

Issue / Bugzilla link

#15082

Testing

Works with Orca, have not tested with other screen readers.

@Ingi-Hong Ingi-Hong requested review from a team as code owners April 10, 2025 17:13
Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.05%. Comparing base (85f003a) to head (4f2bf13).
Report is 102 commits behind head on main.

Files with missing lines Patch % Lines
bedrock/firefox/views.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16172      +/-   ##
==========================================
+ Coverage   79.81%   80.05%   +0.24%     
==========================================
  Files         160      158       -2     
  Lines        8495     8495              
==========================================
+ Hits         6780     6801      +21     
+ Misses       1715     1694      -21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ingi-Hong Ingi-Hong marked this pull request as draft April 10, 2025 17:46
@Ingi-Hong Ingi-Hong marked this pull request as ready for review April 10, 2025 18:01
@robhudson
Copy link
Contributor

If this is based off of #15293 it would be nice to keep that 1 commit intact and add your changes in a 2nd commit. That would help review the changes between the two.

@Ingi-Hong
Copy link
Contributor Author

@robhudson sure, should I close this PR and restart off that branch or is there an easy way to merge that history into this branch?

@janbrasna
Copy link
Contributor

BTW I think testing with the actual assistive technology first is essential, e.g. I was not able to get any change announced in VoiceOver using this focusable/tabindex angle or jumping to actual anchors added at that headings etc.; so I started trying live areas, but content changes also in the other column so that made it a bit harder to get the assertive announcements reliable/right (while also not replacing itself as part of whatever's being swapped in DOM asynchronously at the same time…)

I've only rebased Rob's commit to current codebase and it still applies cleanly, and started trying various things on top of it (compare/main...janbrasna:df21080) … and you're right, one of the things to sort out first is the lost listeners. I also noticed the innerHTML may need changing to outerHTML to get the correct markup given the partial returned?

@Ingi-Hong
Copy link
Contributor Author

To be honest I just assumed it would work, was planning on testing later this week when I could get my hands on a mac. I'll convert this into a draft and experiment on top of it.

@Ingi-Hong Ingi-Hong marked this pull request as draft April 10, 2025 19:10
@janbrasna
Copy link
Contributor

@Ingi-Hong Your assumption was nonetheless correct!;) I did quickly test this in Firefox and Safari on macOS with VoiceOver and the headings are indeed announced as they should! 🎉 This strategy looks promising.

@Ingi-Hong
Copy link
Contributor Author

I'm curious - how did you implement it with tabindex originally?

@Ingi-Hong Ingi-Hong closed this Apr 11, 2025
@Ingi-Hong Ingi-Hong reopened this Apr 11, 2025
@Ingi-Hong
Copy link
Contributor Author

Hi @reemhamz, since you opened the original issue would you willing to test this out locally?

@reemhamz
Copy link
Contributor

reemhamz commented Apr 11, 2025

I no longer work on bedrock, but maybe @stephaniehobson can take a look if you need a front-ender

@Ingi-Hong Ingi-Hong marked this pull request as ready for review April 13, 2025 18:45
@robhudson robhudson added a11y Issues related to accessibility Frontend HTML, CSS, JS... client side stuff labels Apr 22, 2025
@maureenlholland maureenlholland added the Needs Review Awaiting code review label Apr 23, 2025
@maureenlholland
Copy link
Collaborator

Sorry for the delay. I think this is an improved experience. I tested on VoiceOver & NVDA and got the expected announcements.

Going to push to demo and see if we can get a member of the accessibility team to review

@robhudson
Copy link
Contributor

FYI: I updated the 2nd commit to remove the extra spacing that was added so the diff is a bit cleaner.

Copy link
Contributor

@janbrasna janbrasna left a comment

Choose a reason for hiding this comment

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

I did test this over time in a few browsers in VoiceOver and it works beautifully. Really nice job! And the async flow is really nice in general — I also tinkered with its history state and it all seems happy.

(I only noticed one unrelated issue with no close button description announced after opening the help modals, but that's to track separately if you don't have a quick fix to slap onto this while testing…)

"I'm curious - how did you implement it with tabindex originally?"

@Ingi-Hong Ah, so I was lazy and just scripted the tabindex values in the first place, which might be kinda fragile, but I was also actually trying to focus one heading above (figting with its disabled state at that moment, hence why scripting the values) to actually announce what got selected as a confirmation, only then to flow naturally to the heading below etc. … failing that, I went to include the left column with its changes too as live regions, to announce the change of product (Beta, Developer etc.) picked up there… and it went overboard from that;) This looks much more promising in not trying to be too smart, and just honestly moving the focus after each selection to the next active anchor.

@robhudson Thanks! Yep noticed that too, there seemed to be actually an attempt to fix some whitespace in the license preamble, but a lot of unrelated things got reformatted with it too. Much easier to spot any changes now. That said, I think there might be some unintended changes left, that don't belong in the PR:

Comment on lines -12 to -15
{%- block page_desc -%}
{{ ftl('firefox-all-everyone-deserves-access-v2') }}
{%- endblock -%}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this may have been removed unintentionally(?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up setting the string directly in main.html. Would it be best to define page_desc in base.html?

I'm not overly familiar with jinja, but it looks like I could use set for this.

Comment on lines 12 to 13
<p>{{ ftl('firefox-all-everyone-deserves-access-v2', fallback="'firefox-all-everyone-deserves-access") }}</p>
<p>{{ ftl('firefox-all-everyone-deserves-access-v2') }}</p>
{% if product %}
Copy link
Contributor

Choose a reason for hiding this comment

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

This one too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the fallback as it doesn't exist in the current version of main. It must be from an older version of main that Rob branched from.

@Ingi-Hong
Copy link
Contributor Author

Will squash once I get the sign off!

@Ingi-Hong
Copy link
Contributor Author

Ingi-Hong commented Jun 14, 2025

I only noticed one unrelated issue with no close button description announced after opening the help modals, but that's to track separately if you don't have a quick fix to slap onto this while testing

Tried to take this on in the latest commit. As it stands, it announces the same message per step navigation. If you think multiple readouts of the same message is redundant, we can manipulate the sr-only area with javascript. Everytime we move steps we can set the innerHTML to trigger a screen reader readout. The screen reader will only read the message out once, since the inner content will only change once.

Like this: https://stackoverflow.com/a/69741469

@Ingi-Hong Ingi-Hong requested a review from janbrasna June 14, 2025 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Issues related to accessibility Frontend HTML, CSS, JS... client side stuff Needs Review Awaiting code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants