Skip to content

[Component Audit] CommandPaletteInput: expose accurate search semantics - #7321

Merged
cixzhang merged 10 commits into
mainfrom
night-watch-component-audit/CommandPaletteInput/2026-10-11
Oct 15, 2026
Merged

cixzhang merged 10 commits into
mainfrom
night-watch-component-audit/CommandPaletteInput/2026-10-11

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

User impact

Standalone CommandPaletteInput fields now expose searchbox semantics instead of claiming an expanded combobox with no popup. Inside CommandPalette, the query stays a combobox and its role, popup state, list relationship, autocomplete mode, and active descendant can no longer be overwritten by passthrough props. Screen-reader users hear "Search commands" (translated) as the field's name, or the caller's label, never the placeholder.

Owner decision

The spec owner settled the default name and approved this pull request's CommandPaletteInput.spec.md on 2026-10-14: the default accessible name is a fixed, localizable "Search commands", and a placeholder is never the name ("Merge the specs", 19:31 PT; "Can you resolve the not merging specs", 19:33 PT, applying the recommended options). The record is authority: current, and its DEC-1 records the default name.

What changed

  • Distinguish no-popup standalone searchbox semantics from popup-backed combobox semantics while preserving standalone caller-owned roles and ARIA relationships. A popup attribute the caller passes counts as caller-owned even while its value is undefined, and a passed value reaches the field unchanged, so a field wired to its own toggling popup stays a combobox and an explicitly undefined aria-expanded is omitted, as in the released field. aria-owns and any aria-haspopup other than false also count as caller popup attributes, so a field wired to its popup only through them stays a combobox; aria-haspopup="false" keeps a searchbox.
  • Keep renderable trailing content, including numeric 0, inside the trailing layout group and omit empty React nodes.
  • Name the field aria-label, then label, then the translated "Search commands"; placeholder text is never the name.
  • Inside CommandPalette the field owns role, aria-expanded, aria-autocomplete, aria-controls, and aria-activedescendant; other ARIA props, including aria-haspopup and aria-owns, pass through (AR3 names them).
  • Add focused contract tests, dedicated Storybook states, a curated RTL target, aligned docs, a patch changeset, and the current CommandPaletteInput.spec.md component contract.

Authority and compatibility

  • Accessibility basis: WCAG 2.2 4.1.2, the WAI-ARIA combobox pattern, spec:AST-020/FR1,FR2, and spec:AST-056/AR2.
  • Passthrough precedence: architecture:public-component-api/INV5.
  • Compatibility basis for this patch: spec:AST-017/FR1,FR3,FR5; callers that connect the standalone field to their own popup retain their role and ARIA relationships, so the no-popup correction has no released victim.
  • The default-name change is an accessibility behavior fix under spec:AST-017/FR53: no app code changes, and the Changeset names the old default (the placeholder), the new one ("Search commands"), and label as the way to keep a specific name. The standalone semantics change names the old default (an expanded combobox), the new one (searchbox), and role="combobox" as the way back.
  • Open P5 owner decision, not changed here: the released primary callback is onValueChange(value) while onChange(event) carries the native event.

Overlap and record boundary

  • Search terms: CommandPaletteInput, command-palette-input, query field, searchbox, combobox, aria-expanded, aria-controls, native passthrough; over current records and open pull requests.
  • Canonical owner until now: component:CommandPalette (CommandPalette.spec.md), which listed the native query field among the parts it owns. This change narrows that line to composition and points the field's semantics and native passthrough at component:CommandPaletteInput.
  • Why the field needs its own record: CommandPaletteInput is exported and used on its own, with no CommandPalette context. Its standalone semantics (searchbox without a popup, caller-owned combobox with one) and its passthrough routing apply where no palette exists, so the aggregate record, whose scope is the composed palette and its popup context, cannot govern them. The aggregate keeps the popup context, composition, and the open query-field theming question.
  • Overlapping open work:
    • [Component Audit] CommandPalette: protect nested layers and text entry #6950 edits CommandPalette.spec.md (result-surface anatomy and keyboard rows) and the same CommandPaletteInput.tsx lines: it gates the contextual aria-expanded, aria-controls, and aria-activedescendant on selectable results, guards IME composition keys, and gives the field a default name that does not come from the placeholder. It changes only the contextual branch; this pull request owns the standalone branch and keeps the contextual branch's values. Whichever lands second rebases: the contextual gating and IME guard carry over unchanged, and both pull requests now give the same default name from the same catalog key.
    • [Component Audit] CommandPaletteEmpty: make empty-state evidence trustworthy #7094 edits CommandPalette.spec.md for Empty only; no shared lines.

Audit score

Rubric: 1.16.6 · mode: Night Watch

  • Before: 74.8 / C, 4 open BLOCKs, rendered design not measured.
  • After: 87.5 / C, 2 open BLOCKs (A1 accessible-name migration; P5 callback naming), rendered design not measured.
  • Sensitivity: resolve P5 alone → 93.3 / C; resolve A1 alone → 94.2 / C; resolve both → 100 / A.

Test plan

  • pnpm vitest run packages/core/src/CommandPalette/CommandPaletteInput.test.tsx packages/core/src/theme/themingTargets.test.ts — 451 passed.

  • pnpm vitest run packages/core/src/CommandPalette after merging main — 109 passed, including a caller popup that toggles aria-expanded={open || undefined} and an explicitly undefined aria-expanded; both fail against the previous head.

  • pnpm vitest run packages/core/src/CommandPalette — 114 passed, including fields wired only through aria-owns, aria-haspopup="listbox", and aria-haspopup={true} (combobox) and aria-haspopup false (searchbox); the three combobox cases fail against the previous head.

  • pnpm -F @astryxdesign/core build — passed.

  • pnpm -F @astryxdesign/storybook build — passed.

  • pnpm lint:strict — 0 errors; existing repository warnings only.

  • pnpm check:knowledge and pnpm check:changesets — passed.

  • Full pnpm test encountered unrelated CLI filesystem/time-limit failures under the concurrent local run; the deterministic failed CLI suites pass in isolation. Exact-head Actions remains authoritative.

  • Browser, accessibility, RTL, and visual evidence: pending exact-head Actions. No local browser result is credited.

  • pnpm vitest run packages/core/src/CommandPalette at this head — 116 passed. The default-name, custom-placeholder, and contextual-name tests fail when the name falls back to the placeholder.

Writing rubric results

  • R1 narration: compatibility wording was rewritten as present-tense classification and guarantees.

  • R2 research: none.

  • R3 evidence: facts and standards, not changes.

  • R4 rejected alternatives: none.

  • R5 change references: none.

  • R6 open questions: OQ1 callback migration remains genuinely unanswered; the aggregate CommandPalette contract retains its existing query-field theming question.

  • Rerun over both records after merging main and resolving the CommandPalette.spec.md ownership line: R1–R5 clean (no narration, research, change references, or pull-request links; scanned for the R1 terms and #+digits, /pull/, /issues/); R6 unchanged.

  • Rerun for the default-name decision and the promotion to current (CommandPaletteInput.spec.md): R1 ORD3, AR1, AR3, and the compatibility lines state present behavior; the "released fallback" and "known BLOCK" sentences are gone. R2 none. R3 none. R4 one, inside DEC-1, one line. R5 none. R6 OQ1 unchanged.

@vercel

vercel Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 15, 2026 3:45am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 11, 2026
@astracat-bot

astracat-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 15, 2026, 4:18 AM UTC

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

44 of 460 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 238,081
Chat Full AI Chat probe dark 237,048
Markdown Default probe light 159,625
Markdown Default probe dark 158,986
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
TableRowExpansion Detail Panel neutral dark 5,150
TableRowExpansion Detail Panel neutral light 4,068

and 24 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes: the searchbox default for standalone fields and the palette-owned combobox semantics are the right fix, and the tests and accessibility audit pass, but two things need attention before this lands.

  • Popup props passed as undefined (for example aria-expanded={open || undefined}) are treated as absent, so a standalone field wired to its own popup flips between searchbox and combobox, or reports a closed popup as expanded; treating a present key as caller-owned and passing its value through unchanged, with a toggling-popup test, would fix it.
  • The new CommandPaletteInput.spec.md and the ownership edit to CommandPalette.spec.md need the overlap search and boundary explanation the knowledge-contract rules ask for in the PR description, including how this coordinates with #6950, which edits the same lines and record.

[Automated review]

Comment on lines +190 to +198
const callerOwnsPopup =
!ctx &&
(props.role === 'combobox' ||
props['aria-expanded'] != null ||
props['aria-autocomplete'] != null ||
props['aria-controls'] != null ||
props['aria-activedescendant'] != null);
const standaloneRole =
props.role ?? (callerOwnsPopup ? 'combobox' : 'searchbox');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caller ownership is inferred from non-null values, so a caller that passes its popup props as undefined while closed (for example aria-expanded={open || undefined} with aria-controls={open ? id : undefined}) gets role="searchbox" while closed and combobox once open. With an always-present aria-controls, aria-expanded={undefined} becomes "true". The released field kept combobox and omitted an explicitly undefined aria-expanded. Checking key presence ('aria-expanded' in props, and so on) and passing present values through unchanged keeps those callers stable; a test that toggles a caller popup would pin it.

- Search orchestration and the current Input, List, Item, Group, Group heading,
Empty, and Footer parts and targets.
- The native Query field rendered inside the default Input.
- Composition of the native Query field rendered inside the default Input; the field's semantics and native passthrough are owned by `component:CommandPaletteInput`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This moves the query field's semantics to a new record. Please add the overlap receipt the knowledge-contract rules ask for in the PR description — search terms, the canonical owner (this file), and overlapping open work such as #6950, which edits this record and the same CommandPaletteInput.tsx lines — and say why the standalone field needs its own record.

…-audit/CommandPaletteInput/2026-10-11

# Conflicts:
#	packages/core/src/CommandPalette/CommandPalette.spec.md

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval of this pull request waits on a maintainer: the new draft CommandPaletteInput.spec.md adds requirements that no current spec states yet — standalone searchbox semantics with caller-owned combobox popups, palette-owned semantics over passthrough props, empty endContent handling, the placeholder-name order and the victim-free patch classification — and the pull request moves the query field's ownership out of CommandPalette.spec.md, so a maintainer needs to approve or reject those. Independently, please treat aria-owns and aria-haspopup (other than "false") as caller popup attributes too: today a standalone field wired to its own popup only through them changes from combobox to searchbox, which contradicts the new docs and the patch's victim-free premise, and a test like the toggling-popup case would pin it. Otherwise the runtime fix is well evidenced: the focused suites pass, the new semantics tests fail against the previous implementation, and the accessibility audit of both new stories reports no violations.

[Automated review]

Comment on lines +195 to +201
const callerOwnsPopup =
!ctx &&
(props.role === 'combobox' ||
callerSets('aria-expanded') ||
callerSets('aria-autocomplete') ||
callerSets('aria-controls') ||
callerSets('aria-activedescendant'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caller popup detection lists only role="combobox" and these four keys, so a standalone field wired to its own popup only through aria-owns or aria-haspopup now renders searchbox, where the released field rendered combobox with aria-expanded="true" and aria-autocomplete="list". That contradicts the docs' "a combobox when popup relationships are supplied" and the patch's victim-free premise. Counting aria-haspopup (other than "false") and aria-owns here, with a test like the toggling-popup case, keeps those callers unchanged.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval of this pull request waits on a maintainer: the new draft CommandPaletteInput.spec.md adds requirements no current spec states yet — standalone searchbox semantics with caller-owned combobox popups, palette-owned semantics over passthrough props, empty endContent handling, the placeholder-name order and the victim-free patch classification — and the pull request moves the query field's semantics out of CommandPalette.spec.md, so a maintainer needs to approve or reject those. Separately, please extend the Changeset to name the old default (an expanded combobox), the new one (searchbox) and the prop that restores the old behavior (role="combobox"), as the release-compatibility spec asks for a semantic default change. The runtime change otherwise checks out on this head: fields wired to their own popup through aria-owns or aria-haspopup now stay a combobox, every caller-popup case we checked keeps its released output, and the focused tests, accessibility audit and CI pass.

  • If AR3 is approved as written, note that a caller's aria-haspopup or aria-owns still passes through inside the palette, so either the field owns those there too or AR3 names the attributes it owns.

[Automated review]

'@astryxdesign/core': patch
---

[fix] Give no-popup standalone command-palette fields searchbox semantics while preserving caller-owned popup roles and relationships, and preserve component-owned popup state when the field is connected to a command palette.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The release-compatibility spec asks a Changeset for a semantic default change to name the old and new default and the prop that restores the old one. Something like: "A standalone field with no popup attributes was role="combobox" with aria-expanded="true" and aria-autocomplete="list"; it is now role="searchbox" with no popup state. Pass role="combobox" (or your popup's own ARIA attributes) to keep the old semantics."

a `combobox` with context-owned expanded state, list relationship, autocomplete
mode, and active descendant, following `spec:AST-020/FR1,FR2` and the WAI-ARIA
combobox pattern.
- **AR3 — Semantic ownership.** CommandPalette context overrides conflicting

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As written, AR3 covers any conflicting passthrough, but inside the palette the field only owns role, aria-expanded, aria-autocomplete, aria-controls and aria-activedescendant; a caller's aria-haspopup (even false) or aria-owns still reaches the combobox unchanged. If AR3 is approved, either own those two in the palette branch too or name the attributes the field owns here.

… placeholder; accept the record

- Default accessible name: aria-label, then label, then the translated
  "Search commands" (owner decision A146); placeholder text is never the name.
- CommandPaletteInput.spec.md becomes current (approved by cixzhang 2026-10-14):
  ORD3/AR1 state the new name order, AR3 names the attributes the field owns
  inside CommandPalette, DEC-1 records the default name.
- The Changeset names the old and new standalone semantics with role="combobox"
  as the way back, and the old and new default name with label as the way back.
- Tests: default and custom-placeholder names, the contextual name, and AR3's
  owned versus passed-through attributes.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e4d341d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 15, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting one small change: the semantics fix, the new default name and the CommandPaletteInput contract check out, the contract is owner-approved for this revision, and the new tests and CI pass. Because the field is now named "Search commands" unless a label is passed, the file-search examples that pass only placeholder="Search files..." are announced as "Search commands"; please add label="Search files" in packages/cli/assets/templates/blocks/components/CommandPalette/CommandPaletteAsyncSearch.tsx and in the file-search story in apps/storybook/stories/CommandPalette.stories.tsx.

[Automated review]

const value = controlledValue ?? ctx?.search;
const handleValueChange = onValueChange ?? ctx?.setSearch;
const accessibleLabel =
props['aria-label'] ?? label ?? t('@astryx.commandPalette.input.label');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With this default, the two file-search examples that pass only placeholder="Search files..." — packages/cli/assets/templates/blocks/components/CommandPalette/CommandPaletteAsyncSearch.tsx (line 42) and the file-search story in apps/storybook/stories/CommandPalette.stories.tsx (line 269) — are now announced as "Search commands". Passing label="Search files" at both keeps their names accurate, as this pull request's own docs advise.

The file-search block template and story passed only a placeholder, so with
the new default they were announced as "Search commands". The Changeset names
@astryxdesign/cli, which ships the template.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 36a95b8

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 15, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks ready to approve: the standalone searchbox semantics, the palette-owned combobox, the "Search commands" default name and the new CommandPaletteInput contract check out, the contract is owner-approved for this revision, and the file-search examples now pass label="Search files". The new tests fail against the released implementation and pass here, and CI is green. One optional follow-up: the record's compatibility line calls the standalone role change an AST-017 FR5 contract restoration while the Changeset rightly cites FR53, so aligning that wording would avoid a second reading.

[Automated review]

- Released default preserved: `no` for no-popup standalone semantic output and
for the default accessible name; caller-owned popup associations and all other
CommandPalette output remain equivalent
- Compatibility class: contract restoration under `spec:AST-017/FR1,FR3,FR5` for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional: the released docs called this field "the combobox input", so the standalone role change replaces a documented role, and AST-017 FR5 says such a change "is not a fix, except an accessibility behavior fix under FR53". Classifying the standalone semantics under FR53, as the Changeset already does, would match the release outcome.

@cixzhang
cixzhang merged commit 26118f8 into main Oct 15, 2026
57 checks passed
cixzhang added a commit that referenced this pull request Oct 15, 2026
- CommandPaletteInput keeps #7321's standalone searchbox/combobox role and
  aria-label → label → "Search commands" name chain, and this pull request's
  listbox gating of aria-expanded, aria-controls, and aria-activedescendant
  inside the palette, plus the IME guard.
- CommandPaletteInput.spec.md AR2 and states record the no-results state.
- The Changeset drops its default-name bullet, now in #7321's, and names the
  Home/End, Page Up/Page Down, and empty-search announcement changes.
@github-actions
github-actions Bot deleted the night-watch-component-audit/CommandPaletteInput/2026-10-11 branch October 15, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 36a95b8a Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant