Skip to content

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented Jul 16, 2025

Closes https://github.com/github/primer/issues/5303

Changelog

  • Remove active descendant behaviour
  • Add roving tab index
  • Add active descendant through separate indicator
  • Remove focus indicator announcements
  • Fix no items announcement

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: dd82743

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 16, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Jul 16, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.99 KB (+0.46% 🔺)
packages/react/dist/browser.umd.js 90.24 KB (+0.76% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-6330 July 16, 2025 22:27 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6330 July 21, 2025 23:56 Inactive
@pksjce pksjce changed the title Reacreare PR-5801 to remove aria activedescendant and add a roving ta… Recreate PR-5801 to remove aria activedescendant and add a roving tab index Jul 22, 2025
@pksjce pksjce force-pushed the recreate-pr-5801-remove-aria-activedescendant branch from e01ad94 to 5b99a1d Compare July 22, 2025 01:51
@github-actions github-actions bot temporarily deployed to storybook-preview-6330 July 22, 2025 02:00 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6330 July 22, 2025 02:12 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6330 July 22, 2025 05:19 Inactive
@pksjce pksjce force-pushed the recreate-pr-5801-remove-aria-activedescendant branch from 54538c5 to 847426e Compare July 23, 2025 13:38
@pksjce pksjce marked this pull request as ready for review July 23, 2025 13:38
@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 13:38
@pksjce pksjce requested review from a team as code owners July 23, 2025 13:38
@pksjce pksjce requested a review from langermank July 23, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the aria-activedescendant accessibility pattern from SelectPanel and replaces it with a roving tabindex approach to improve accessibility. The changes only affect SelectPanel when the primer_react_select_panel_with_modern_action_list feature flag is enabled.

Key changes:

  • Replace aria-activedescendant focus management with roving tabindex behavior
  • Simplify announcement logic since roving tabindex provides automatic focus announcements
  • Update keyboard navigation to directly focus list items instead of using virtual focus

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/react/src/SelectPanel/SelectPanel.tsx Fix logical operator and add item IDs for accessibility
packages/react/src/SelectPanel/SelectPanel.test.tsx Update tests to verify roving tabindex behavior and different announcement patterns
packages/react/src/FilteredActionList/useAnnouncements.tsx Simplify announcements for item count instead of active descendant tracking
packages/react/src/FilteredActionList/FilteredActionListWithModernActionList.tsx Implement roving tabindex with focus management and active indicator styling
packages/react/src/FilteredActionList/FilteredActionListEntry.tsx Remove unused onListContainerRefChanged prop from modern implementation
packages/react/src/FilteredActionList/FilteredActionList.module.css Add CSS for active item indicator
packages/react/src/ActionList/List.tsx Enable focus wrapping for FilteredActionList container
packages/react/src/ActionList/Item.tsx Add FilteredActionList to menu context and option role inference
packages/react/src/ActionList/ActionListContainerContext.tsx Add radio selection variant type
packages/react/.changeset/four-cars-attend.md Document the breaking change for SelectPanel accessibility
Comments suppressed due to low confidence (1)

packages/react/src/SelectPanel/SelectPanel.test.tsx:300

  • This test case for keyboard navigation is incomplete - it only checks that the combobox has focus after clicking, but doesn't actually test arrow key navigation as the name suggests.
        it('should support navigating through items with ArrowUp and ArrowDown', async () => {

@@ -350,7 +349,7 @@ function Panel({
if (open) {
if (items.length === 0 && !(isLoading || loading)) {
// we need to wait for the listContainerElement to disappear before announcing no items, otherwise it will be interrupted
if (!listContainerElement || !usingModernActionList) {
if (!listContainerElement && !usingModernActionList) {
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

The logical operator change from || to && appears to be a bug fix, but this changes the condition semantics significantly. The original condition !listContainerElement || !usingModernActionList would announce when either condition was true, but the new condition !listContainerElement && !usingModernActionList only announces when both conditions are true. This could prevent announcements in valid scenarios.

Suggested change
if (!listContainerElement && !usingModernActionList) {
if (!listContainerElement || !usingModernActionList) {

Copilot uses AI. Check for mistakes.

@@ -85,10 +79,12 @@ export function FilteredActionList({
[onFilterChange, setInternalFilterValue],
)

const [enableAnnouncements, setEnableAnnouncements] = useState(false)
const [selectedItems] = useState<(string | number | undefined)[]>([])
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

The selectedItems state is initialized as an empty array and never updated, making it effectively unused. This variable should either be removed or properly maintained to track selected items.

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot requested a deployment to storybook-preview-6330 July 23, 2025 13:43 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6330 July 23, 2025 13:47 Abandoned
Copy link
Member Author

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

Visuals look good! have some change requests and questions

@francinelucca francinelucca requested a review from TylerJDev July 25, 2025 02:29
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/394030

@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Aug 1, 2025
@francinelucca francinelucca added this pull request to the merge queue Aug 1, 2025
Merged via the queue into main with commit fbdcac4 Aug 1, 2025
43 checks passed
@francinelucca francinelucca deleted the recreate-pr-5801-remove-aria-activedescendant branch August 1, 2025 00:30
@primer primer bot mentioned this pull request Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants