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: Live announce resultState in ProgressBar #3229

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

johannes-weber
Copy link
Member

@johannes-weber johannes-weber commented Jan 28, 2025

Description

Before this change, the resultState was not live-announced when displayed becaue the content of the aria-live container did not change.

With this change, the InternalLiveRegion componnt takes care about the live announcement, once the resultState is rendered.

Related links, issue #, if available: AWSUI-60207

How has this been tested?

  • tested manually using Voice Over on Mac.
  • How can reviewers test these changes efficiently?
    • Open the with-updates demo page, enable VO and click the "Start" button. Live announcement is happening once the loading is done.
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.45%. Comparing base (ae3d6be) to head (7ea6ad9).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3229   +/-   ##
=======================================
  Coverage   96.45%   96.45%           
=======================================
  Files         790      790           
  Lines       22299    22299           
  Branches     7664     7595   -69     
=======================================
  Hits        21508    21508           
  Misses        739      739           
  Partials       52       52           

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

@johannes-weber johannes-weber changed the title chore: Live announce resultState in ProgressBar fix: Live announce resultState in ProgressBar Jan 29, 2025
@johannes-weber johannes-weber force-pushed the a11y-add-live-region-to-progress-bar branch 2 times, most recently from 0538f0f to 2facfb8 Compare January 29, 2025 10:54
@@ -253,8 +261,10 @@ describe('Progress updates', () => {
expect(wrapper.find(`.${liveRegionStyles.root}`)?.getElement().textContent).toBe(`${label}: 0%`);
rerender(<ProgressBar label={label} value={2} />);

// 6 seconds passed, live region has a new value
jest.advanceTimersByTime(6000);
act(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Wrapped with an act because state updates are happening (https://github.com/cloudscape-design/components/blob/main/src/progress-bar/index.tsx#L55) when running the timers. This removes the related act warning when running the tests.

@johannes-weber johannes-weber marked this pull request as ready for review January 29, 2025 11:18
@johannes-weber johannes-weber requested a review from a team as a code owner January 29, 2025 11:18
@johannes-weber johannes-weber requested review from avinashbot and removed request for a team January 29, 2025 11:18
@johannes-weber johannes-weber added this pull request to the merge queue Feb 3, 2025
Merged via the queue into main with commit 7a16ac8 Feb 3, 2025
38 checks passed
@johannes-weber johannes-weber deleted the a11y-add-live-region-to-progress-bar branch February 3, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants