Skip to content

Conversation

@Sidnioulz
Copy link
Member

@Sidnioulz Sidnioulz commented Dec 3, 2025

What I did

  • Fixes a recent regression introduced by b10fed8 that blocks some KB nav events (ArrowUp/ArrowDown) on the reset option
  • Adds a non-regression test

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. Go to http://localhost:6006/?path=/story/select-component--full-arrow-navigation, notice it works
  2. Open the viewport tool and navigate with ArrowDown and ArrowUp, it works too

Documentation

ø

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • New Features

    • Added an interactive story demonstrating full arrow-key navigation through select options (including looping and reset behavior).
  • Bug Fixes

    • Improved keyboard navigation in select components to correctly handle the reset option when moving up/down, ensuring accurate next/previous indexing during arrow-key navigation.

✏️ Tip: You can customize this high-level summary in your review settings.

@Sidnioulz Sidnioulz requested a review from ghengeveld December 3, 2025 11:52
@Sidnioulz Sidnioulz added bug ui accessibility ci:normal a11y: keyboard Accessibility issues related to keyboard navigation or shortcuts labels Dec 3, 2025
@nx-cloud
Copy link

nx-cloud bot commented Dec 3, 2025

View your CI Pipeline Execution ↗ for commit 0560aeb

Command Status Duration Result
nx run-many -t compile --parallel=3 ✅ Succeeded 52s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-05 12:06:08 UTC

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 3, 2025

📝 Walkthrough

Walkthrough

Select keyboard navigation now treats reset-type options specially when computing the active index; a new Storybook story FullArrowNavigation (duplicated in the diff) was added to exercise ArrowDown/ArrowUp navigation and looping.

Changes

Cohort / File(s) Summary
Storybook story addition
code/core/src/components/components/Select/Select.stories.tsx
Added FullArrowNavigation story demonstrating ArrowDown/ArrowUp keyboard navigation through options (Tadpole → Pollywog → Frog), including looping and backward navigation. The story appears twice in the diff (duplicate declaration).
Reset option handling
code/core/src/components/components/Select/Select.tsx
Updated currentIndex computation in moveActiveOptionDown and moveActiveOptionUp to detect when activeOption.type === 'reset' and locate the reset option via option.type === 'reset'; otherwise fallback to value comparison. This changes next/previous index resolution when a reset option is selected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Attention areas:
    • Remove or confirm the duplicate FullArrowNavigation story.
    • Validate option.type === 'reset' detection matches all reset-option shapes used elsewhere.
    • Check edge cases: empty options, only-reset option, duplicate reset-like entries, and consistent behavior between up/down navigation.

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
code/core/src/components/components/Select/Select.stories.tsx (1)

432-471: FullArrowNavigation story effectively exercises arrow key cycling; consider adding a reset variant

This story is a solid non-regression test for forward/backward ArrowUp/ArrowDown navigation and wrap-around in the simple single-select case. To more directly cover the regression described around ArrowUp/ArrowDown on the reset option, you might optionally add a twin story (or extend this one with different args) that enables onReset so the reset option is present, then asserts that arrow navigation still works correctly when that reset option is the active item.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a60c55c and eefb784.

📒 Files selected for processing (2)
  • code/core/src/components/components/Select/Select.stories.tsx (1 hunks)
  • code/core/src/components/components/Select/Select.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use ESLint and Prettier configurations that are enforced in the codebase

Files:

  • code/core/src/components/components/Select/Select.tsx
  • code/core/src/components/components/Select/Select.stories.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable TypeScript strict mode

Files:

  • code/core/src/components/components/Select/Select.tsx
  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{ts,tsx,js,jsx,mjs}: Use server-side logger from 'storybook/internal/node-logger' for Node.js code
Use client-side logger from 'storybook/internal/client-logger' for browser code
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/components/components/Select/Select.tsx
  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions that need to be tested from their modules

Files:

  • code/core/src/components/components/Select/Select.tsx
  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier with --write flag to format code before committing
Run ESLint with yarn lint:js:cmd to check for linting issues and fix errors before committing

Files:

  • code/core/src/components/components/Select/Select.tsx
  • code/core/src/components/components/Select/Select.stories.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-11-05T09:37:25.920Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/tooltip/WithTooltip.tsx:54-96
Timestamp: 2025-11-05T09:37:25.920Z
Learning: Repo: storybookjs/storybook — In code/core/src/components/components/tooltip/WithTooltip.tsx, the legacy WithTooltip implementation is intentionally reintroduced for backward compatibility and is deprecated; maintainers (per Sidnioulz) do not want maintenance or improvements on it. Prefer WithTooltipNew/Popover; avoid suggesting changes to WithTooltip.* going forward.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-11-05T09:36:55.944Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-10-01T15:24:01.060Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32594
File: code/core/src/components/components/Popover/WithPopover.tsx:7-9
Timestamp: 2025-10-01T15:24:01.060Z
Learning: In the Storybook repository, "react-aria-components/patched-dist/*" (e.g., "react-aria-components/patched-dist/Dialog", "react-aria-components/patched-dist/Popover", "react-aria-components/patched-dist/Tooltip") are valid import paths created by a patch applied to the react-aria-components package. These imports should not be flagged as broken or invalid until a maintainer explicitly states they are no longer acceptable.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
🧬 Code graph analysis (2)
code/core/src/components/components/Select/Select.tsx (1)
code/core/src/components/components/Select/helpers.tsx (1)
  • externalToValue (63-68)
code/core/src/components/components/Select/Select.stories.tsx (3)
code/core/src/csf-tools/CsfFile.ts (1)
  • meta (964-966)
code/core/src/node-logger/logger/logger.ts (1)
  • step (197-202)
code/core/src/test/testing-library.ts (1)
  • userEvent (123-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: normal
  • GitHub Check: nx
  • GitHub Check: nx
  • GitHub Check: nx
  • GitHub Check: nx
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/core/src/components/components/Select/Select.tsx (1)

328-332: Reset option handling in keyboard navigation looks correct

Branching on activeOption.type === 'reset' and matching by option.type === 'reset' avoids collisions with user options that have value: undefined, while preserving the existing value-based comparison for regular options. The findIndex fallback behaviour when no reset option is present also remains safe.

Also applies to: 355-359

@Sidnioulz Sidnioulz added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Dec 5, 2025
@Sidnioulz Sidnioulz force-pushed the sidnioulz/fix-select-reset-option-kb-nav branch from eefb784 to 87fad82 Compare December 5, 2025 08:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
code/core/src/components/components/Select/Select.stories.tsx (1)

432-471: Consider adding a reset option to test the actual regression scenario.

The test comprehensively covers arrow navigation and looping, but doesn't include a reset option. Since this PR fixes a regression specifically related to keyboard navigation when a reset option is present, consider adding onReset and defaultOptions to the args to ensure the test exercises the fixed code path.

Example enhancement:

 export const FullArrowNavigation = meta.story({
+  args: {
+    onReset: fn(),
+    defaultOptions: 'tadpole',
+  },
   play: async ({ canvas, step }) => {
     const selectButton = await canvas.findByRole('button');
     await step('Open select', async () => {
       selectButton.focus();
       await userEvent.keyboard('{ArrowDown}');
-      expect(selectButton).toHaveTextContent('Tadpole');
+      expect(selectButton).toHaveTextContent('Pollywog');
     });

This would test navigation when the reset option is the first item in the list, directly exercising the regression fix.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eefb784 and 87fad82.

📒 Files selected for processing (2)
  • code/core/src/components/components/Select/Select.stories.tsx (1 hunks)
  • code/core/src/components/components/Select/Select.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use ESLint and Prettier configurations that are enforced in the codebase

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
  • code/core/src/components/components/Select/Select.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable TypeScript strict mode

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
  • code/core/src/components/components/Select/Select.tsx
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{ts,tsx,js,jsx,mjs}: Use server-side logger from 'storybook/internal/node-logger' for Node.js code
Use client-side logger from 'storybook/internal/client-logger' for browser code
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
  • code/core/src/components/components/Select/Select.tsx
code/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions that need to be tested from their modules

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
  • code/core/src/components/components/Select/Select.tsx
code/**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier with --write flag to format code before committing
Run ESLint with yarn lint:js:cmd to check for linting issues and fix errors before committing

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
  • code/core/src/components/components/Select/Select.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-11-05T09:36:55.944Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
🧬 Code graph analysis (1)
code/core/src/components/components/Select/Select.tsx (1)
code/core/src/components/components/Select/helpers.tsx (1)
  • externalToValue (63-68)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: normal
🔇 Additional comments (2)
code/core/src/components/components/Select/Select.tsx (2)

328-332: LGTM! Correct handling of reset options in navigation.

The updated logic properly distinguishes between reset and regular options when computing the current index. When the active option is a reset option, it correctly identifies it by type rather than value, which fixes the regression where keyboard navigation was blocked on reset options.


355-359: LGTM! Consistent with moveActiveOptionDown.

The logic correctly mirrors the fix in moveActiveOptionDown, ensuring consistent behavior for both up and down arrow navigation when a reset option is active.

@Sidnioulz Sidnioulz force-pushed the sidnioulz/fix-select-reset-option-kb-nav branch from 87fad82 to 0560aeb Compare December 5, 2025 11:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
code/core/src/components/components/Select/Select.stories.tsx (1)

432-471: Consider adding a test that specifically includes a reset option.

The PR description states this fixes "keyboard navigation events (ArrowUp/ArrowDown) on the reset option." While this test verifies that general arrow navigation works correctly (good for preventing regressions), it doesn't directly test arrow navigation through a reset option.

Consider adding a companion story that exercises the specific bug scenario:

export const FullArrowNavigationWithReset = meta.story({
  args: {
    defaultOptions: 'frog',
    onReset: fn().mockName('onReset'),
  },
  play: async ({ canvas, step }) => {
    const selectButton = await canvas.findByRole('button');
    await step('Open select and navigate with arrows', async () => {
      selectButton.focus();
      await userEvent.keyboard('{ArrowDown}');
      expect(await screen.findByRole('listbox')).toBeInTheDocument();
    });

    await step('Navigate through reset option with ArrowUp', async () => {
      await userEvent.keyboard('{Home}'); // Go to reset option
      const resetOption = await screen.findByRole('option', { name: 'Reset selection' });
      expect(document.activeElement).toBe(resetOption);
      
      await userEvent.keyboard('{ArrowDown}'); // Should navigate to first regular option
      const tadpoleOption = await screen.findByRole('option', { name: 'Tadpole' });
      expect(document.activeElement).toBe(tadpoleOption);
      
      await userEvent.keyboard('{ArrowUp}'); // Should navigate back to reset option
      expect(document.activeElement).toBe(resetOption);
    });
  },
});

Minor: Consider verifying listbox state during navigation.

The test doesn't explicitly verify whether the listbox is open during the arrow navigation steps. Adding an assertion like expect(await screen.findByRole('listbox')).toBeInTheDocument() after the first step would make the test's assumptions clearer.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87fad82 and 0560aeb.

📒 Files selected for processing (2)
  • code/core/src/components/components/Select/Select.stories.tsx (1 hunks)
  • code/core/src/components/components/Select/Select.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/core/src/components/components/Select/Select.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use ESLint and Prettier configurations that are enforced in the codebase

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable TypeScript strict mode

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{ts,tsx,js,jsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{ts,tsx,js,jsx,mjs}: Use server-side logger from 'storybook/internal/node-logger' for Node.js code
Use client-side logger from 'storybook/internal/client-logger' for browser code
Do not use console.log, console.warn, or console.error directly unless in isolated files where importing loggers would significantly increase bundle size

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Export functions that need to be tested from their modules

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
code/**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

code/**/*.{js,jsx,json,html,ts,tsx,mjs}: Run Prettier with --write flag to format code before committing
Run ESLint with yarn lint:js:cmd to check for linting issues and fix errors before committing

Files:

  • code/core/src/components/components/Select/Select.stories.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Follow existing patterns and conventions in the Storybook codebase
📚 Learning: 2025-11-05T09:38:47.712Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Select/Select.tsx:200-204
Timestamp: 2025-11-05T09:38:47.712Z
Learning: Repo: storybookjs/storybook — Guidance: Until Storybook 11 is released, do not suggest using React.useId anywhere (e.g., in code/core/src/components/components/Select/Select.tsx) to maintain compatibility with React 17 runtimes. Prefer advising: accept a caller-provided props.id and, if needed, generate a client-only fallback id to minimize SSR hydration issues — but avoid useId. Resume prompting for useId after Storybook 11.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-11-05T09:36:55.944Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/Tabs/Tabs.stories.tsx:222-227
Timestamp: 2025-11-05T09:36:55.944Z
Learning: Repo: storybookjs/storybook PR: 32458 — In code/core/src/components/components/Button/Button.tsx (React/TypeScript), ButtonProps includes ariaLabel?: string | false and the component maps it to the DOM aria-label. Convention: ariaLabel is mandatory on all Button usages — provide a descriptive string for icon-only buttons; set ariaLabel=false when the button’s children already serve as the accessible name. Do not suggest using a raw aria-label prop on Button call sites.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-11-05T09:37:25.920Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32458
File: code/core/src/components/components/tooltip/WithTooltip.tsx:54-96
Timestamp: 2025-11-05T09:37:25.920Z
Learning: Repo: storybookjs/storybook — In code/core/src/components/components/tooltip/WithTooltip.tsx, the legacy WithTooltip implementation is intentionally reintroduced for backward compatibility and is deprecated; maintainers (per Sidnioulz) do not want maintenance or improvements on it. Prefer WithTooltipNew/Popover; avoid suggesting changes to WithTooltip.* going forward.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
📚 Learning: 2025-10-01T15:24:01.060Z
Learnt from: Sidnioulz
Repo: storybookjs/storybook PR: 32594
File: code/core/src/components/components/Popover/WithPopover.tsx:7-9
Timestamp: 2025-10-01T15:24:01.060Z
Learning: In the Storybook repository, "react-aria-components/patched-dist/*" (e.g., "react-aria-components/patched-dist/Dialog", "react-aria-components/patched-dist/Popover", "react-aria-components/patched-dist/Tooltip") are valid import paths created by a patch applied to the react-aria-components package. These imports should not be flagged as broken or invalid until a maintainer explicitly states they are no longer acceptable.

Applied to files:

  • code/core/src/components/components/Select/Select.stories.tsx
🧬 Code graph analysis (1)
code/core/src/components/components/Select/Select.stories.tsx (3)
code/core/src/csf-tools/CsfFile.ts (1)
  • meta (964-966)
code/core/src/node-logger/logger/logger.ts (1)
  • step (197-202)
code/core/src/test/testing-library.ts (1)
  • userEvent (123-126)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: normal
  • GitHub Check: nx
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (1)
code/core/src/components/components/Select/Select.stories.tsx (1)

432-471: Note: No duplicate story declaration found.

The AI summary mentions that "The new story appears twice in the diff, resulting in two identical FullArrowNavigation story declarations at different insertion points," but I only observe a single FullArrowNavigation export in the provided code. This may have been a diff rendering artifact or the duplicate may have been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y: keyboard Accessibility issues related to keyboard navigation or shortcuts accessibility bug ci:normal patch:yes Bugfix & documentation PR that need to be picked to main branch ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants