Skip to content

Conversation

@pan-kot
Copy link
Member

@pan-kot pan-kot commented Aug 21, 2025

Description

The PR makes it possible to nest STSN providers. The use cases that we have are:

  1. Rendering a button group inside table cells;
  2. Rendering a button group inside tree view items (we are adding keyboard nave in there, too).

The idea of the change is rather simple: at any given point in time only one provider can be active. The active provider is the outer-most provider with navigationActive=true. If the outer provider changes state from true to false - the nested provider becomes active instead. This allows a dynamic switch of navigation contexts (e.g. when a tree toggle is focused - the tree navigation is engaged; when the focus is inside a tree item - the button group which can be rendered inside receives control). In some cases, it is not even necessary to do the switching. Thus, the table navigation controller is already capable of handling the nested button group navigation on its own, the only difference is that the button group focus is no longer looped.

Screen.Recording.2025-08-22.at.13.25.55.mov

Rel: AWSUI-61152, [AaSEAuz8NXla]

How has this been tested?

  • Added new unit tests for nested STSN providers
  • Enhanced test page for table navigation
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.

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.08%. Comparing base (41a377b) to head (8783184).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3781    +/-   ##
========================================
  Coverage   97.07%   97.08%            
========================================
  Files         835      835            
  Lines       24197    24202     +5     
  Branches     8069     8479   +410     
========================================
+ Hits        23490    23496     +6     
+ Misses        702      658    -44     
- Partials        5       48    +43     

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

@pan-kot pan-kot force-pushed the nested-stsn-providers branch from 1fca2aa to 09a8244 Compare August 21, 2025 13:16
@pan-kot pan-kot changed the title chore: Nested STNS providers support chore: Nested STSN providers support Aug 21, 2025
@pan-kot pan-kot force-pushed the nested-stsn-providers branch from 09a8244 to 2453a8e Compare August 21, 2025 14:38
@pan-kot pan-kot force-pushed the nested-stsn-providers branch from 2453a8e to 8783184 Compare August 21, 2025 14:57
@pan-kot pan-kot marked this pull request as ready for review August 22, 2025 11:27
@pan-kot pan-kot requested a review from a team as a code owner August 22, 2025 11:27
@just-boris just-boris removed the request for review from a team August 25, 2025 10:36
@gethinwebster
Copy link
Member

Would this be a good time to also centralize these two implementations? https://github.com/cloudscape-design/component-toolkit/tree/main/src/internal/single-tab-stop

@pan-kot
Copy link
Member Author

pan-kot commented Aug 26, 2025

Would this be a good time to also centralize these two implementations? https://github.com/cloudscape-design/component-toolkit/tree/main/src/internal/single-tab-stop

Let's merge this one first as a dependency for the tree view impl. I will follow it up by opening a pr to the toolkit and then later once toolkit changes are released - replacing the components based implementation with the toolkit imports.

Edit: created PR: cloudscape-design/component-toolkit#155

@pan-kot pan-kot added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@pan-kot pan-kot added this pull request to the merge queue Aug 26, 2025
Merged via the queue into main with commit 42a9704 Aug 26, 2025
39 checks passed
@pan-kot pan-kot deleted the nested-stsn-providers branch August 26, 2025 18:05
pan-kot added a commit that referenced this pull request Aug 28, 2025
pranshuteotia pushed a commit to pranshuteotia/components that referenced this pull request Sep 3, 2025
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