Skip to content

fix(apollo-vertex): hide command separator from listbox semantics - #1390

Closed
ruudandriessen wants to merge 1 commit into
mainfrom
fix/vertex-command-separator-role
Closed

ruudandriessen wants to merge 1 commit into
mainfrom
fix/vertex-command-separator-role

Conversation

@ruudandriessen

Copy link
Copy Markdown
Collaborator

Summary

axe aria-required-children flags the command component: CommandSeparator renders [role=separator] inside cmdk's role="listbox" list, and a listbox may only own option/group.

CommandSeparator now renders its own div with role="none" instead of Command.Separator. It keeps cmdk's visibility behaviour (hidden while a search is active unless alwaysRender is set) via useCommandState. Classes and data-slot are the same, so it looks identical.

Upstream status

  • cmdk 1.1.1 (Mar 2025) is the latest release, and there are no newer commits that touch the separator. Command.Separator sets role="separator" after spreading props, so you can't override it with role.
  • The listbox ARIA problems are tracked upstream in Role "listbox" causes some aria issues dip/cmdk#179 (open).
  • shadcn's current new-york-v4 command component still wraps CommandPrimitive.Separator unchanged, so it has the same violation.
  • An upgrade can't fix this, so the fix is local. apollo-wind's command.tsx has the same pattern and is out of scope here.

Notes

  • CommandSeparatorProps is now an explicit interface (div props + alwaysRender). The asChild prop inherited from cmdk's primitive is no longer accepted. Nothing in the repo used it.
  • The cmdk-separator attribute is no longer rendered. Nothing in the repo selects on it.
  • vitest.config.ts now uses Vite's resolve.tsconfigPaths instead of a single @ alias. Without it, registry components that import other registry components (@/components/ui/dialog) can't be loaded in tests.

Test plan

  • New registry/command/command.test.tsx: no [role=separator] in the DOM, the separator sits inside the listbox with role="none", it's hidden while searching, and it's shown when alwaysRender is set
  • Ad hoc axe-core 4.11 aria-required-children run: violation with Command.Separator, none with the new CommandSeparator
  • pnpm typecheck, pnpm lint (oxlint type-aware), pnpm test, pnpm -w knip, package build, registry build

No changeset: the repo doesn't use changesets.

cmdk's Command.Separator hardcodes role="separator" after spreading props, so
it cannot be overridden. Inside the role="listbox" list this fails axe
aria-required-children. cmdk 1.1.1 is the latest release and the issue is
still open upstream (dip/cmdk#179); shadcn new-york-v4 uses the same
primitive.

CommandSeparator now renders its own div with role="none" and reproduces
cmdk's visibility logic (hidden while searching unless alwaysRender) via
useCommandState. The asChild prop from cmdk's primitive is no longer
accepted.

Vitest now resolves tsconfig paths so registry components that import
other registry components can be tested.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:44
@ruudandriessen
ruudandriessen requested a review from a team as a code owner October 16, 2026 11:44
@github-actions github-actions Bot added the size:L 100-499 changed lines. label Oct 16, 2026
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing October 16, 2026 11:44 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex October 16, 2026 11:44 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design October 16, 2026 11:44 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs October 16, 2026 11:44 Destroyed
@github-actions

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1947 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1713
ISC 91
Apache-2.0 56
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Removing the public asChild prop breaks compatibility for existing consumers.

1 open finding
What changed in this PR

Fixes Apollo Vertex command-list accessibility by removing separator semantics from the listbox.

Changes:

  • Replaces cmdk’s separator with a presentation-only element while preserving search visibility.
  • Adds separator regression tests.
  • Enables TypeScript path resolution in Vitest.
File Description
packages/​apollo-vertex/​vitest.config.ts Enables TypeScript path resolution for tests.
packages/​apollo-vertex/​registry/​command/​command.tsx Updates separator semantics and visibility handling.
packages/​apollo-vertex/​registry/​command/​command.test.tsx Tests separator roles and search visibility.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +128 to +130
interface CommandSeparatorProps extends React.ComponentProps<"div"> {
alwaysRender?: boolean;
}
@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — — — —
@uipath/apollo-react — — — — —
@uipath/apollo-ui-icons — — — — —
@uipath/apollo-vertex 66.8% 100.0% (3/3) 326.0 KB 1.84 MB +78 B
@uipath/apollo-wind — — — — —
@uipath/ap-chat — — — — —

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

✅ No stories are affected by this PR's changes; nothing to compare. Logs

Updated (PT): Oct 16, 2026, 04:52:18 AM

@ruudandriessen

Copy link
Copy Markdown
Collaborator Author

Closing: we want to keep the shadcn command component as upstream ships it. The separator role issue is in cmdk (dip/cmdk#179) and will be handled as a lintapple exception instead.

@ruudandriessen
ruudandriessen deleted the fix/vertex-command-separator-role branch October 16, 2026 12:21

This branch was successfully deployed

No deployments
preview/apollo-docs — 8aff3301 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-design — 8aff3301 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-vertex — 8aff3301 Deployed Oct 16, 2026 by github-actions[bot]
preview/apollo-landing — 8aff3301 Deployed Oct 16, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants