Skip to content

[Component Audit] CommandPaletteEmpty: make empty-state evidence trustworthy - #7094

Closed
cixzhang wants to merge 1 commit into
mainfrom
night-watch-component-audit/CommandPaletteEmpty/2026-10-07
Closed

cixzhang wants to merge 1 commit into
mainfrom
night-watch-component-audit/CommandPaletteEmpty/2026-10-07

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Completes the first whole-component audit of core/CommandPaletteEmpty, adds component-owned browser evidence, and records the unresolved empty-list semantic contract without choosing it.

User impact

People using a screen reader currently encounter a generic message directly inside the command listbox. Empty search also announces the no-results state through the live region, while empty bootstrap has no separate announcement. The audit makes both states reproducible and reviewable without changing runtime behavior before the exposed-tree and announcement contract is settled.

Authority and frozen source

  • Package/component: core/CommandPaletteEmpty
  • Rubric: Component Audit Rubric 1.16.6
  • Audit base: 01fb22f931c78bd3f2f99008e9b41bfa67969bc9
  • Frozen repository and draft aggregate-contract head: 39d54c6db40f84a2b59305f0f57e57aafd28b29b
  • Objective standard: WAI-ARIA Listbox Pattern — the listbox's owned accessibility children are option or group
  • Current authority: architecture:public-component-api/INV1,INV5–INV9; architecture:component-theming-surface/INV3–INV7; architecture:component-test-sufficiency/INV1–INV7,INV10–INV11
  • Governing audit flow: spec:AST-029/FR3–FR10

Reproducible scorecard

Before, the component had no owned Storybook route and its generic empty message was not independently audited inside the real CommandPalette branch. Section §5b was not measured and is excluded from the measured-weight normalization.

Section Weight Before After Evidence
§1 Accessibility 16 3.0 3.0 Open BLOCK: a generic element remains directly inside the listbox. Empty search also uses the live region; empty bootstrap does not, so both exposed-tree and announcement behavior require an owner decision.
§2 Theming 14 5.0 5.0 Semantic tokens, painting-element target, target inventory, neutral/probe coverage.
§3 Public API 14 5.0 5.0 Exports, required children, BaseProps, ref, DOM/data/ARIA, class, style, and xstyle composition remain unchanged.
§4 Behavior 12 5.0 5.0 Built-in bootstrap/search rendering, text and structured content remain unchanged.
§5a Objective design 6 5.0 5.0 Logical padding, centered layout, semantic type and color tokens, and stable target ownership.
§5b Rendered judgment 4 not measured 4.5 Exact-head Chromium matrix covers neutral/probe, light/dark, RTL, and 320px with semantic, geometry, theme, contrast, and settled-render sensors.
§6 Testing 8 3.0 5.0 V10 component-owned-route BLOCK fixed: the owned story now drives the real built-in CommandPalette empty branch, scoped axe, RTL classification, and exact-head browser evidence.
§7 Code health 8 5.0 5.0 Stateless single-root component; no Effect, observer, listener, or retained resource.
§8 Docs/Storybook 8 4.0 5.0 Consumer docs name the empty-message anatomy and target; the source example no longer nests CommandPaletteEmpty inside the prop CommandPalette already wraps.
§9 i18n/RTL 5 5.0 5.0 The component authors no strings. Centered flex layout and logical padding have no component-owned RTL dimension; the explicit N/A receipt records that boundary.
§10 Responsive/touch 5 4.5 5.0 The exact-head 320px frame measures the built-in branch; no interaction or touch target is introduced.
Total 100 87.8 / C 93.2 / C Before: 2 distinct BLOCKs and §5b unmeasured (84.3 / 96 measured). After: 1 open BLOCK.

Sensitivity: settling and correcting the one remaining semantic BLOCK, with no other score change, projects 99.6 / A.

Smallest restoration

  • Add one component-owned Storybook route that renders the actual built-in CommandPalette empty-bootstrap branch.
  • Add bounded exact-head Chromium receipts for semantics, geometry, target reach, contrast, direction, theme, and narrow layout.
  • Record the current generic-listbox-child state and one unresolved owner question in the aggregate draft contract.
  • Correct the source example so emptyBootstrapText and emptySearchText receive content rather than nested CommandPaletteEmpty elements.
  • Add the required patch Changeset for public docs and evidence.

No runtime behavior, public prop, export, default, target, or compatibility promise changes.

FR5 closed evidence inventory

Surface / state Source Tests Consumer docs Browser evidence Authority / standard Gap
Public component and props type component source and module barrel export/doc/type checks component docs N/A for module surface public-component-api INV1, INV9 none
Required message content: text and structured nodes children rendering focused text and element tests children docs built-in message frame established public interface none
Built-in empty bootstrap/search branches CommandPalette composition and Empty root aggregate component tests corrected source example actual CommandPalette dialog/listbox branch WAI-ARIA Listbox Pattern BLOCK: generic owned child; exposed-tree treatment unresolved
Empty-state announcement CommandPalette search/bootstrap announcement branch aggregate announcement tests aggregate docs scoped axe and semantic sensors current implementation evidence empty search announces; empty bootstrap clears the live region
Manual composition and root props BaseProps, ref, merge order, native prop spread ref, DOM/data/role, class, style, xstyle tests import and prop docs component target and geometry sensors public-component-api INV5–INV8 none
Empty-message target and tokenized paint themeProps and StyleX source target inventory and docs checks anatomy and target metadata neutral/probe light/dark frames theming-surface INV3–INV7 none
Direction and narrow layout logical padding, centered flex, wrapping text RTL verified-N/A receipt N/A RTL and 320px sensor frames WCAG reflow; objective logical layout none

Inventory closure: every public export, prop, native-root seam, content partition, built-in empty branch, live-region interaction, target, and responsive/directional boundary is represented. Bootstrap and search empty states share the same rendered Empty path and announcement ownership.

Writing rubric results

  • R1 narration: none added; new language describes the present unresolved state.
  • R2 research: none in the record.
  • R3 evidence: facts and the objective listbox standard, not changes, own the new text.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: OQ3 is genuinely unresolved and keeps its two semantic outcomes.

Validation

Passed locally on the frozen head:

  • focused component, theming, and docs suites
  • Core and Storybook typechecks
  • focused strict ESLint
  • pnpm check:knowledge, pnpm check:changesets, and pnpm check:sync
  • full package build and production Storybook build
  • global baseline routing for accessibility, behavior, layout, public API, testing, and theming

Exact-head Linux CI supplies the final Chromium accessibility, RTL, visual, and retained sensor evidence. The accessibility failure for the generic listbox child is expected to remain visible while the owner hold is open; it is not baselined away.

Needs Review

Should both empty states be exposed as disabled options inside the listbox, or should Empty stay presentational with bootstrap gaining an explicit announcement to match empty search?

This is a terminal owner hold. Runtime remediation, merge, and the final ledger write remain blocked until the aggregate contract selects one outcome.

FR10 exact-head eligibility report

{
  "schemaVersion": 1,
  "component": "CommandPaletteEmpty",
  "package": "core",
  "mode": "nightly",
  "rubricVersion": "1.16.6",
  "repositoryHead": "39d54c6db40f84a2b59305f0f57e57aafd28b29b",
  "componentContractHead": "39d54c6db40f84a2b59305f0f57e57aafd28b29b",
  "inventory": {"closed": true, "rows": 7},
  "score": {"before": 87.8, "after": 93.2, "beforeBlocks": 2, "afterBlocks": 1, "status": "terminal-owner-hold"},
  "unresolvedObjectiveGaps": ["generic empty message is a direct listbox child"],
  "unresolvedManualGaps": ["choose disabled-option exposure for both states or presentational exposure plus a bootstrap announcement"],
  "remediations": [
    {"id": "V10", "state": "verified-exact-head", "evidence": "component-owned story renders the actual built-in CommandPalette empty branch"},
    {"id": "V15", "state": "verified-exact-head", "evidence": "neutral/probe, light/dark, RTL, and narrow sensor matrix"},
    {"id": "docs", "state": "verified", "evidence": "consumer anatomy/target docs and corrected non-nesting source example"}
  ],
  "approvals": {"componentSpecOwner": "required-terminal-hold", "privateExactHeadSelfReview": "clean", "reviewSignal": "success from GitHub Actions App 15368"},
  "checks": {"local": "green except host browser launch; exact-head CI owns browser proof", "exactHeadCI": "all green except pr-a11y, which exposes the retained accessibility BLOCK"},
  "eligibility": {"eligible": false, "reasons": ["terminal owner decision is unresolved", "one accessibility BLOCK remains"]}
}

@vercel

vercel Bot commented Oct 7, 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 7, 2026 10:49am UTC

Request Review

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

astracat-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 8, 2026, 1:43 AM UTC

@cixzhang
cixzhang force-pushed the night-watch-component-audit/CommandPaletteEmpty/2026-10-07 branch from 58461c3 to dd453e1 Compare October 7, 2026 10:37
@cixzhang cixzhang changed the title [Component Audit] CommandPaletteEmpty: preserve empty-list semantics [Component Audit] CommandPaletteEmpty: make empty-state evidence trustworthy Oct 7, 2026
@cixzhang
cixzhang force-pushed the night-watch-component-audit/CommandPaletteEmpty/2026-10-07 branch from dd453e1 to 39d54c6 Compare October 7, 2026 10:42
@github-actions

github-actions Bot commented Oct 7, 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: 1 accessibility violation(s) found — 1 critical.

CommandPaletteEmpty - 1 issue(s)
  • 🔴 critical: Ensure elements with an ARIA role that require child roles contain them
    • Rule: aria-required-children · Affects 1/1 stories · Learn more
    • WCAG: 1.3.1 (Level A)

Visual Regression

17 of 428 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
Chat Full AI Chat probe light 155,733
Chat Full AI Chat probe dark 155,005
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,229
Chat With Attachments probe dark 11,065
SideNav Resizable in AppShell probe dark 3,208
Markdown Default probe dark 897
Markdown Default probe light 897
Markdown Default neutral dark 882
Markdown Default neutral light 858
FileInput Default neutral light 44
FileInput Default neutral dark 42

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 making the empty state reproducible without changing runtime behavior. The owned Storybook route, corrected docs and example, and the honest record of the current generic message inside the listbox are useful audit progress.

Approval needs a maintainer decision before this can land. Please have a maintainer decide whether both empty states should be exposed as disabled options inside the listbox, or whether CommandPaletteEmpty should stay presentational with empty bootstrap gaining an explicit announcement to match empty search, and record that decision in the governing CommandPalette contract. That choice is currently unsettled, and this review has left the question open for the maintainer through CodeBunny.

One evidence fix is also needed: the dedicated CI route does not actually retain its browser receipts on this head while the known accessibility violation is present. Please resequence that route so the Playwright capture runs and its receipts are uploaded even when the accessibility audit fails, then rerun it — without adding the known aria-required-children violation to the baseline.

[Automated review]

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.
@cixzhang cixzhang closed this Oct 24, 2026
@github-actions
github-actions Bot deleted the night-watch-component-audit/CommandPaletteEmpty/2026-10-07 branch October 25, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — 39d54c6d Deployed Oct 7, 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