Skip to content

Conversation

@NathanZlion
Copy link
Member

@NathanZlion NathanZlion commented Dec 23, 2025

Description

Fix Accessibility issue for focus on the tutorial panel component. When a user exits/dismisses a tutorial, focus is automatically restored to the tutorial panel header to maintain proper keyboard navigation flow.

Related links, issue AWSUI-61570

How has this been tested?

  • Tested Locally
  • Added integration test to check behavior and run it locally
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.

const headerRef = useRef<HTMLHeadingElement>(null);
const previousTutorialRef = useRef(context.currentTutorial);

// Restore focus to the tutorial panel header when exiting a tutorial
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to use the onExitTutorial event more directly rather than observing for changes here, it should make the code a bit clearer to read and avoid needing useEffect

@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.13%. Comparing base (8c37834) to head (1c03849).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4131   +/-   ##
=======================================
  Coverage   97.13%   97.13%           
=======================================
  Files         873      873           
  Lines       25562    25572   +10     
  Branches     9240     9241    +1     
=======================================
+ Hits        24830    24840   +10     
  Misses        685      685           
  Partials       47       47           

☔ 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.

@NathanZlion NathanZlion marked this pull request as draft December 24, 2025 08:24
@NathanZlion NathanZlion force-pushed the fix/tutorial-focus-on-dismiss branch from f498833 to 967e1cd Compare December 24, 2025 11:25
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.

3 participants