Skip to content

[Component Audit] CommandPalette: protect nested layers and text entry - #6950

Merged
cixzhang merged 20 commits into
mainfrom
night-watch-component-audit/CommandPalette/2026-10-05
Oct 15, 2026
Merged

cixzhang merged 20 commits into
mainfrom
night-watch-component-audit/CommandPalette/2026-10-05

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep an open nested surface in control of the first Escape press instead of closing its CommandPalette host
  • preserve native Home/End caret movement, active IME composition, and valid result focus across populated, empty, and repopulated searches
  • expose listbox semantics only while options exist; announce rich emptySearchText as rendered and give the query a real localized name
  • add a stable grouped/rich-empty/pending fixture plus exact-head light, dark, RTL, and 320px browser receipts

Audit result

  • Before: 83.3 / C — 8 distinct BLOCKs: local modal Escape ownership; Home/End result navigation from an editable query; unguarded IME command keys; stale active-descendant state; empty listboxes; placeholder-only query naming; rendered/announced empty-text mismatch; and no reachable component-owned audit fixture
  • After: 99.6 / A — pending exact-head browser receipt confirmation in pr-a11y
  • Rubric: 1.16.6, nightly mode N
  • Public API: unchanged
  • Visual output: unchanged

The pre-fix score has §1 capped at 1 by 7 accessibility BLOCKs and §6 capped at 3 by the V10 fixture BLOCK; §5b was not measured and its weight was redistributed. The projected after score has every scored section at 5 and exact-head rendered judgment at 4.5.

Owner decision

The spec owner settled the query field's default name 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 option). This pull request keeps that default.

Authority

  • family:overlay-dismissal/FR1, FR2, FR4, and FR5 require one shared owner to route Escape to the topmost registered surface.
  • spec:AST-056/FR3, AR1, and AR2 require the rendered empty-search message to be what assistive technology receives and the query field to have a name independent of its placeholder.
  • WAI-ARIA editable-combobox and active-descendant rules keep Home/End with the caret, keep active IME keys with the input method, and expose only existing options.

Verification

  • pnpm lint:strict — 0 errors; 81 pre-existing warnings
  • pnpm -F @astryxdesign/core typecheck
  • pnpm -F @astryxdesign/storybook typecheck
  • pnpm check:repo
  • 84 focused CommandPalette tests plus the previously green shared-dismissal suite
  • Playwright discovery: six Chromium evidence cases; the fixture includes grouped results, a rich actionable empty state, and pending bootstrap
  • Local Chromium capture is unavailable under the macOS Mach rendezvous sandbox; exact-head capture runs in pr-a11y.
  • spec:AST-009/FR4 applies to the changed live-region content and timing. The checked-in Audit Matrix now carries a reproducible rich empty-search transition; NVDA + Chrome on Windows and VoiceOver + Safari on macOS remain pending in the durable release block, so the change may merge but the first affected stable release may not publish until both receipts pass or a current exception applies.
  • Full pnpm test was run earlier; unrelated repository-wide CLI, story-tree baseline, Mac-only workspace-copy, and performance tests failed. All changed and owning-family suites pass.

Writing rubric results

  • Pass — ownership: current family:overlay-dismissal remains canonical for topmost dismissal and current spec:AST-056 remains canonical for search-state accessibility; the component draft projects only CommandPalette-specific behavior and evidence.

  • Pass — present system: records describe current behavior, boundaries, allowed variation, and mutation-sensitive verification without project history or implementation steps.

  • Pass — authority and evidence: current family/system clauses and objective editable-combobox standards justify the corrections; the draft does not decide the open query-field theming API question.

  • Pass — content boundary: consumer usage remains in CommandPalette.doc.mjs; shared layer and search-vocabulary rules remain with their current owners.

  • Rerun after merging main and resolving its conflicts (overlay-dismissal adoption table and verification map, layer-runtime Toast and CommandPalette gaps, the CommandPalette record's evidence lists): R1 one compatibility line used "no longer"/"now" and was rewritten in the present tense; R2–R5 clean (no research, change references, rejected alternatives, or pull-request links); R6 unchanged.

  • Rerun for the default-name and listbox edits (CommandPaletteList.spec.md, spec:AST-056/AR2, the spec:AST-009 scenario): R1 the CommandPaletteList compatibility line and AR4 describe present behavior, with no "now" or "no longer"; AST-056 AR2 drops a sentence that described CommandPaletteInput's earlier fallback. R2 none. R3 none; AST-009's existing pending block names this pull request as its source change, which is that block's own field. R4 none. R5 only the AST-009 source-change field. R6 none.

Review checklist

  • the empty-search announcement waits until the search settles (showEmptySearch && !isPending), so optimistic narrowing can no longer speak "No results" before the source answers; a regression test narrows a committed query while the source is pending and fails against the previous head

  • objective regression cases cover keyboard routing, rich empty announcements, real field naming, and populated → empty → repopulated focus

  • inline documentation-preview Escape behavior remains unchanged

  • public API and visual styling remain unchanged: CommandPaletteContextValue keeps its released shape; CommandPaletteInput and CommandPaletteList derive the listbox state from selectableItems.length > 0

  • the Changeset names the old default name (the placeholder), the new one ("Search commands"), label as the way to keep a specific name, and the empty-listbox change, classified as an accessibility fix under spec:AST-017/FR53

  • docs and records match: CommandPaletteInput label, the List descriptions in CommandPalette.doc.mjs and CommandPaletteList.doc.mjs, CommandPaletteList.spec.md (FR1, FR2, AR4, compatibility), and spec:AST-056/AR2

  • the AST-009 scenario narrows the Grouped panel from four results to none (s, x, then z) and states one announcement per settled empty query

  • exact-head browser evidence and repository CI green

  • the audit matrix mounts its never-resolving pending palette only after the grouped and empty palettes have rendered their results without a spinner. React entangles async transitions that are in flight together, so a pending bootstrap started beside theirs kept all three busy; only the pending panel is busy now (jsdom: grouped 0, empty 0, pending 1 spinner; it was 1/1/1). Exact-head pr-a11y reruns the evidence

@vercel

vercel Bot commented Oct 5, 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 5:15am UTC

Request Review

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

astracat-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 5, 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.

Thanks for fixing the nested-layer and text-entry keyboard cases. In static review, delegating modal Escape to Dialog's shared stack, keeping Home/End for the query caret with Page keys for result jumps, and guarding active IME composition at the default input align with the shared dismissal requirements, and the new unit and browser test code covers the intended states without changing the public API.

Two corrections are still needed before this can be approved:

  • The current layer-runtime architecture record still describes CommandPalette as handling Escape locally after the family record is updated to shared ownership. It still says CommandPalette currently handles Escape on its own element and lists its local handler as a current gap. Please reconcile those statements with the new modal-via-Dialog behavior, noting that only the inline preview still closes locally, or explicitly record why that architecture record intentionally waits for a later update so the two current records do not contradict each other.

  • The new Audit Matrix does not yet pass the accessibility audit: its empty and pending panels render a listbox with no option or group children, which the audit reports as a critical required-children violation, and the CommandPalette browser evidence step is then skipped with its upload failing for missing files. Please make the no-option state pass the audit (or record a justified exception if an empty listbox is the intended contract) and rerun the audit and browser evidence so the receipts upload successfully.

[Automated review]

@github-actions

github-actions Bot commented Oct 5, 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 470 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.

Thanks for fixing the nested-layer and text-entry keyboard cases, and for addressing the empty-listbox audit failure. In static review, delegating modal Escape to Dialog's shared stack, keeping Home and End for the query caret with Page keys for result jumps, guarding active IME composition at the default input, and exposing the default empty state as a disabled option align with the shared dismissal and listbox validity requirements, without changing the public API.

Two corrections are still needed before this can be approved:

  • The current layer-runtime architecture record still describes CommandPalette as handling Escape locally after the family record is updated to shared ownership. It still says CommandPalette currently handles Escape on its own element and lists its local handler as a current gap, and the component draft still says no layer-runtime record is present. Please reconcile those statements with the new modal-via-Dialog behavior, noting that only the inline preview still closes locally, or explicitly record why that architecture record intentionally waits for a later update so the two current records do not contradict each other.

  • The empty component's documented custom pattern now nests an option inside an option: the palette always wraps the bootstrap and search empty content in that component, while the component example still shows passing the component itself as that content. Please update the example to pass plain message content (or avoid double-wrapping an already-supplied empty component) and add a case with element empty content asserting a single disabled option, so custom empty content stays valid as well as the default text.

Exact-head audit and browser evidence was also still pending when this review ran, so please make sure that evidence completes and uploads successfully in CI.

[Automated review]

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

Thanks for fixing the nested-layer and text-entry keyboard cases, and for reworking the empty state so rich empty content stays valid. In static review, delegating modal Escape to Dialog's shared stack, keeping Home and End for the query caret with Page keys for result jumps, guarding active IME composition at the default input, and omitting listbox semantics while no results exist align with the shared dismissal and listbox validity requirements, without changing caller props.

One correction is still needed before this can be approved:

  • The current layer-runtime architecture record still describes CommandPalette as handling Escape locally after the family record is updated to shared ownership. It still says CommandPalette currently handles Escape on its own element and lists its local handler as a current gap, and the component draft still says no layer-runtime record is present. Please reconcile those statements with the new modal-via-Dialog behavior, noting that only the inline preview still closes locally, or explicitly record why that architecture record intentionally waits for a later update so the two current records do not contradict each other.

The empty-state rework looks good in static review — Empty is now ordinary content, the example passes plain messages, and the new link-content case covers the rich path. Exact-head audit and browser evidence was also still pending when this review ran, so please make sure that evidence completes and uploads successfully in CI.

[Automated review]

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 5, 2026
@cixzhang

cixzhang commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 8856c04

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

Thanks for fixing the nested-layer and text-entry keyboard cases, reworking the empty state so rich empty content stays valid, and aligning the search announcements and query-field name. In static review, delegating modal Escape to Dialog's shared stack, keeping Home and End for the query caret with Page keys for result jumps, guarding active IME composition at the default input, clearing stale highlight so only existing options are exposed, omitting listbox semantics while no results exist, announcing rich empty text as rendered, and naming the query "Search commands" by default align with the shared dismissal, listbox validity, and search-accessibility requirements, without changing caller props.

One correction is still needed before this can be approved:

  • The current layer-runtime architecture record still describes CommandPalette as handling Escape locally after the family record is updated to shared ownership. It still says CommandPalette currently handles Escape on its own element and lists its local handler as a current gap, and the component draft still says no layer-runtime record is present. Please reconcile those statements with the new modal-via-Dialog behavior, noting that only the inline preview still closes locally, or explicitly record why that architecture record intentionally waits for a later update so the two current records do not contradict each other.

The empty-state and search-accessibility rework looks good in static review — Empty is now ordinary content, rich empty text is announced as rendered, the query has a real default name, and stale highlight is cleared across empty and repopulated results. Exact-head audit and browser evidence was also still pending when this review ran, so please make sure that evidence completes and uploads successfully in CI.

[Automated review]

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

cixzhang commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 02b18ac

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 3a2287b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 14, 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.

Changes requested: the Escape delegation, the rendered empty-search announcement, the query-field name, and the owner-approved keyboard and empty-state behavior all line up, but four corrections remain before this can be approved.

  • Drop the new required hasListbox member from the exported CommandPaletteContextValue and derive selectableItems.length > 0 inside CommandPaletteInput and CommandPaletteList (or take it through API review), since the PR describes the public API as unchanged.
  • Name the old default accessible name (the placeholder), the new default ("Search commands"), and label as the migration in the Changeset, as AST-017 FR3 requires, and state how a caller who relied on a custom placeholder is classified.
  • Update the docs and records that still describe the old behavior: the label description in CommandPaletteInput.doc.mjs, the List descriptions in CommandPalette.doc.mjs and CommandPaletteList.doc.mjs, and AR4/FR2 in CommandPaletteList.spec.md.
  • Extend the AST-009 release-block scenario to narrow a populated result list to nothing, and state the input sequence and expected repeats, since each still-empty query re-announces the message.

[Automated review]

/** Unique ID prefix for ARIA (listbox id). */
listId: string;
/** Whether the current result surface is an expanded listbox. */
hasListbox: boolean;

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 adds a required member to the exported CommandPaletteContextValue (returned by useCommandPaletteContext), so it is public API although the PR describes the API as unchanged, and code that builds the type, like the makeContext helpers here, must change. It equals selectableItems.length > 0, which the context already carries; deriving that inside CommandPaletteInput and CommandPaletteList keeps the context as released. If custom input slots need the signal, is the gap discoverability or capability?

'@astryxdesign/core': patch
---

[fix] Keep CommandPalette dismissal, text entry, result focus, and empty-state accessibility aligned with shared contracts.

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 default accessible name of CommandPaletteInput changes from the placeholder text to "Search commands". AST-017 FR3 asks this Changeset to name the old default, the new default, and label as the way to keep a specific name, and FR1 asks for the classification of a caller who relied on a custom placeholder.

* Accessible label for the combobox input, announced by screen readers.
* Falls back to the placeholder text (`'Search…'` by default), since a
* placeholder alone is not a reliable accessible name.
* @default 'Search commands'

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.

CommandPaletteInput.doc.mjs still says label "Falls back to the placeholder text when omitted" in all three description variants; please update it with this default.

id={ctx?.listId}
role="listbox"
aria-label={label}
role={hasListbox ? 'listbox' : undefined}

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.

Inside CommandPalette the list now drops role=listbox without results, but CommandPaletteList.spec.md AR4 (and its FR2 and compatibility rows), CommandPaletteList.doc.mjs ("Renders as a listbox for ARIA"), and the List anatomy in CommandPalette.doc.mjs still describe a permanent listbox.

Comment thread docs/specs/AST-009/spec.md Outdated
| Source change | Pull request [#6950](https://github.com/facebook/astryx/pull/6950) changes CommandPalette's empty-result live-region content and query-state announcement timing. Bind the final receipt to the landed commit after merge. |
| Affected release | The first stable release containing the landed pull request. |
| Trigger | FR4. The intended result depends on what the live region announces, when the result set becomes empty, and whether the update repeats or is skipped. |
| Scenario | Open the checked-in `CommandPalette / Audit Matrix` story. Within the panel labeled `Empty command palette`, focus its `Search commands` input and type `missing`. Confirm the rendered `No matching commands. Create a command` empty-result message is announced once after the result transition without substituting the built-in default. Clear the query, then repeat from the bootstrap state so the announcement timing is exercised again. |

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 panel's source is always empty, so the scenario never narrows a populated result set to nothing, which is the transition the trigger names and where the pending-search gate and the switch from listbox to message act. Each still-empty query also re-announces the message by design, so "announced once" depends on how missing is typed. Could the scenario add a step that narrows the Grouped panel until nothing matches, and state the input sequence and expected repeats (AST-009 FR10, FR28)?

…, and narrow AST-009 to empty

- Merge origin/main (CommandPaletteList keeps the standalone caller id from #6988).
- Drop hasListbox from the exported CommandPaletteContextValue; CommandPaletteInput
  and CommandPaletteList derive it from selectableItems.length > 0.
- Changeset names the old default name (the placeholder), the new one
  ("Search commands"), label as the migration, and the empty-listbox change
  (AST-017 FR53).
- Docs and records: CommandPaletteInput label, the List descriptions, the
  CommandPaletteList record (FR1, FR2, AR4, compatibility), and AST-056 AR2.
- AST-009: the scenario narrows a populated list to nothing and states the
  input sequence and expected repeats.
@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 7dd66e9

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

Changes requested for one small fix: the Escape delegation, caret and IME handling, empty-state semantics and announcements, and the new query-field name line up with the current specs, the spec changes are approved for this head, and CI is green.

  • The Changeset says two accessibility behaviors change; please also name the Home/End change (Home and End now move the caret, and Page Up and Page Down jump to the first and last result) and the empty-search announcement change (the rendered message, No results by default, instead of No results for <query>), as AST-017 FR53 asks.

[Automated review]

'@astryxdesign/core': patch
---

[fix] Keep CommandPalette dismissal, text entry, result focus, and empty-state accessibility aligned with shared contracts. Two accessibility behaviors change (AST-017 FR53; WCAG 2.2 4.1.2 Name, Role, Value):

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 says two accessibility behaviors change, but the PR also replaces Home/End result jumps with caret movement (Page Up and Page Down now jump to the first and last result) and changes the default empty-search announcement from No results for <query> to the rendered message. AST-017 FR53 asks the Changeset to name the old and new behavior, so two more bullets would cover it.

cixzhang added a commit that referenced this pull request Oct 15, 2026
…cs (#7321)

## 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:
  - #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.
  - #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.
- 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 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 47e8308

@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 merge: modal Escape now goes through Dialog's shared dismissal stack, the query field keeps Home/End and IME keys, empty searches are exposed and announced exactly as rendered, and the spec changes carry an owner's approval for this commit. Each behavior change is pinned by a test that fails without the fix, and the accessibility audit and browser receipts for this commit pass. Three small optional follow-ups: mark the now-unread @astryx.commandPalette.noResultsFor catalog entry as unused (an override of it no longer has any effect, so the Changeset could point to emptySearchText), change the Changeset's "Page Up and Page Down now jump" to "still jump", and add the IME composition gate to ORD2 in CommandPaletteInput.spec.md. The first stable release that contains this change still waits on the NVDA and VoiceOver receipts in the AST-009 release block.

[Automated review]

} else if (items.length === 0) {
announce(t('@astryx.commandPalette.noResultsFor', {query}));
} else {
} else if (items.length > 0) {

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: this removes the only call site of @astryx.commandPalette.noResultsFor. That is right under AST-056 FR3, but the key stays in every catalog, and en.json still describes it as the no-results announcement. Shipped keys are public (overrides), so an override of it now silently does nothing. Consider saying in its description that no component reads it, and pointing overriders to emptySearchText or @astryx.commandPalette.emptySearch in the Changeset.

[fix] Keep CommandPalette dismissal, text entry, result focus, and empty-state accessibility aligned with shared contracts. These accessibility behaviors change (AST-017 FR53; WCAG 2.2 2.1.1 Keyboard and 4.1.2 Name, Role, Value):

- While no selectable result exists, the results container no longer exposes an empty `listbox`, and the query field reports `aria-expanded="false"` with no `aria-controls` or `aria-activedescendant`. It was an expanded combobox controlling an empty listbox.
- Home and End move the caret in the query field, as in any text field; they used to jump to the first and last result. Page Up and Page Down now jump to the first and last result.

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.

Nit: Page Up and Page Down already jumped to the first and last result before this change (useCombobox handles them, and CommandPalette forwarded them), so "now jump" reads as new behavior. "still jump" would be accurate.

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.
combobox pattern. While the palette holds no selectable result, the field

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, while this record is being edited: ORD2 still reads "Consumer handler → default-prevented check → CommandPalette context handler", and FR2 names only prevention, but the field now also holds back delegation during an active IME composition (CommandPaletteInput.tsx 236–241). Adding "or an active IME composition" to both would keep this current record complete.

…d-stack owners

- overlay-dismissal: the shared row lists ContextMenu and CommandPalette; the
  local-only row keeps DropdownMenuSubMenu and PowerSearchEditPopover; both
  verified_by entries and both verification-row additions are kept.
- useLayerDismissal comment: both in the registered list; the local list keeps
  the two remaining components.
- layer-runtime merged cleanly (main's registered list plus this pull
  request's CommandPalette paragraph and gap-line deletion).
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 15, 2026
…oResultsFor has no reader

- CommandPaletteInput.spec.md ORD2 and FR2 name the IME-composition check.
- The Changeset says Page Up/Page Down still jump (useCombobox already did),
  and that an override of @astryx.commandPalette.noResultsFor no longer has an
  effect; emptySearchText customizes the message.
- en.json describes noResultsFor as read by no component.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 4462334

@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 merge: modal Escape now reaches the topmost layer through Dialog's shared dismissal stack, the query field keeps Home/End and IME keys, and empty results are exposed and announced exactly as rendered, with owner-approved spec updates for this commit and tests that fail without each fix. The one red CI job, test-node, fails in an accessibility-audit script test that this PR does not touch, so a rerun should clear it. After merge, bind the AST-009 release block to the landed commit and collect the NVDA and VoiceOver receipts before the first stable release.

[Automated review]

@cixzhang
cixzhang merged commit 2710a13 into main Oct 15, 2026
91 of 93 checks passed
@github-actions
github-actions Bot deleted the night-watch-component-audit/CommandPalette/2026-10-05 branch October 15, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 44623346 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants