Skip to content

fix(core): the active option of select, multi-select and typeahead lists carries a highlighted theme state - #11887

Merged
josephfarina merged 5 commits into
mainfrom
core-option-highlighted-state
Nov 15, 2026
Merged

josephfarina merged 5 commits into
mainfrom
core-option-highlighted-state

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

User impact

A theme cannot style the option a person is on in a select, multi-select or typeahead list. The highlighted option has no theme state on its row (and the typeahead's option row has no target at all), so a theme that wants a stronger highlight, or a highlight in its own color, has no selector for it. Item and CommandPaletteItem rows already carry a highlighted state; these list rows did not. With this change the option rows of select, multi-select and typeahead lists reflect highlighted on the active option, the one aria-activedescendant names.

Problem and solution fit

  • Why does the defect occur? The select and multi-select rows reflect size, selected and disabled, but not the highlight they paint. The typeahead's option row is styled with StyleX only and has no theme target (a recorded reachability gap in the Typeahead and BaseTypeahead records).
  • Why does it harm the task? Highlight is the main feedback while choosing with the keyboard; a theme that restyles the list cannot keep it in step.
  • Why does that matter? A theme ends up with a highlight it cannot match, or reaches for structural selectors that break.

The fix reflects the same highlighted state Item and CommandPaletteItem use, through themeProps, on selector-option-row and multi-selector-option, and gives the typeahead's option row its own target, typeahead-option, with size, highlighted and selected.

Expected behavior and authority

  • architecture:public-component-api DEC-2: a new data attribute is public and needs a current record that names it and says why. The records now name it: component:Selector (option-row state), component:MultiSelector (option row), component:BaseTypeahead FR17 and component:Typeahead FR13.
  • The Typeahead and BaseTypeahead theming anatomy listed the Result row and Selected result state as reachability gaps; both now point at typeahead-option. Typeahead OQ1 narrows to the group heading.
  • The CLI theme editor (astryx experimental theme editor) reads Core's documented targets and states, so --state highlighted on these rows works with no further change; it also learns highlighted as a state word in a pasted value.

Smallest restoration

  • Selector.tsx, MultiSelector.tsx: highlighted: isHighlighted ? 'highlighted' : null in the row's existing themeProps.
  • BaseTypeahead.tsx: the option row spreads themeProps('typeahead-option', {size, highlighted, selected}) beside its existing styles.
  • Docs: the new state and target in Selector.doc.mjs, MultiSelector.doc.mjs, Typeahead.doc.mjs; the stale BaseTypeahead.size exception removed from the theming-target guard (the size now reaches themeProps).
  • No change to what a theme that sets none of these looks like; no prop or behavior change.

Evidence

  • Before: no list row carries a highlight state; .astryx-typeahead-option does not exist.
  • After: after ArrowDown, exactly the active option carries data-highlighted="highlighted" in each list.
  • Unchanged path: rows that are not active carry no new attribute; the visual highlight, ring and selected styling are as before.
  • Regression tests: Selector.activeOption.test.tsx, MultiSelector.openHighlight.test.tsx and BaseTypeahead.test.tsx each assert that only the active option carries the state; theme-option-highlighted.test.mjs sets a color on each row's highlighted state through the theme editor and finds the [data-highlighted="highlighted"] rule in the compiled stylesheet.

Scope

Components: Selector, MultiSelector, BaseTypeahead, Typeahead; CLI theme editor

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run packages/core/src/Selector packages/core/src/MultiSelector packages/core/src/Typeahead packages/core/src/theme: all pass.
  • vitest run --project node packages/cli/api/theme-edit/theme-option-highlighted.test.mjs: passes.
  • pnpm check:knowledge, pnpm specs:for on the changed sources, Prettier, ESLint, CLI strict TypeScript and the changeset check pass.

Writing rubric results

Run over the record edits in component:Selector, component:MultiSelector, component:BaseTypeahead and component:Typeahead.

R1 narration: none; each added sentence states what the row carries ("carries the typeahead-option target…", "highlighted marks the active option"), with no now, previously or added.
R2 research: none.
R3 evidence: the new verification rows name the tests, not a pull request.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: Typeahead OQ1 asked whether the Result row, group heading or selected state should gain a target; the row and state are answered by the new target (FR13), so OQ1 keeps only the unanswered group heading.
R7 project status: none; the "reachability-gap" anatomy entries for the row and selected state are replaced by targets, and no yet or follow-up was added.

@vercel

vercel Bot commented Nov 15, 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 Nov 15, 2026 6:26pm UTC

Request Review

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

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 15, 2026, 6:44 PM UTC

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 1dfdba9

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 15, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 1a6da85

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 58e9ff4

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 record fix: the code, tests and Changesets check out, and a record change approved at this head decides every new state and target.

  • docs/specs/components/Typeahead/Typeahead.spec.md still says the outer Result row is untargeted in FR4 (line 108), the representative-states rows (lines 140-142), the Selected result state anatomy row (line 190) and the placement paragraph (lines 192-196), which contradicts the new FR13 and the typeahead-option target the code now renders; please reword them so only the group heading stays untargeted.

Non-blocking: the FR17 verification row in BaseTypeahead.spec.md lists "a selected result" as an input, but the named test renders no selected value, so add a data-selected assertion or drop that input.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims:

  • Core release note: the active option of the select, multi-select and typeahead lists carries a highlighted state on its row target, as Item and CommandPaletteItem rows do. Verified: Selector.tsx:1054, MultiSelector.tsx:2220, BaseTypeahead.tsx:2333; the three new tests fail on the base and pass here.
  • Core release note: the typeahead row gets its own target, typeahead-option, with size and selected. Verified: Typeahead.doc.mjs:327-331; a selected large row renders data-size="lg" and data-selected="selected".
  • CLI release note: the experimental theme editor sets the state with --state highlighted on the three rows. Verified: theme-option-highlighted.test.mjs fails on the base and passes here.
  • CLI release note: the editor reads a value labeled with that state. Verified: _check.mjs:2377; a pasted highlighted: … value is now refused with the --state highlighted command.
  • Description: before this change no list row carried a highlight state and the typeahead option class did not exist. Verified: red-first runs of the new tests.
  • Description: only the active option carries the state, and other rows carry no new attribute. Verified: the three component tests.
  • Description: a theme that sets none of these looks the same, and no prop or behavior changes. Verified: the target helper emits only a class and data-* attributes; no style rule changes.
  • Description: the theming-target guard drops its stale BaseTypeahead size exception. Verified: themingTargets.test.ts passes.
  • Description: the records name the new state and target, and the Typeahead open question narrows to the group heading. Partly false: they do, but the Typeahead record still calls the row untargeted (finding above).
  • Description: the listed tests and checks pass. Verified locally: the component and editor tests, the knowledge, Changeset and probe-theme checks.

Files:

  • .changeset/core-option-highlighted-state.md: clear
  • .changeset/experimental-theme-option-highlighted.md: clear
  • docs/specs/components/MultiSelector/MultiSelector.spec.md: clear
  • docs/specs/components/Selector/Selector.spec.md: clear
  • docs/specs/components/Typeahead/BaseTypeahead.spec.md: non-blocking note (FR17 verification row)
  • docs/specs/components/Typeahead/Typeahead.spec.md: finding (stale untargeted wording)
  • packages/cli/api/theme-edit/_check.mjs: clear
  • packages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.doc.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear
  • packages/core/src/Selector/Selector.activeOption.test.tsx: clear
  • packages/core/src/Selector/Selector.doc.mjs: clear
  • packages/core/src/Selector/Selector.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.tsx: clear
  • packages/core/src/Typeahead/Typeahead.doc.mjs: clear
  • packages/core/src/theme/themingTargets.test.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)

Automated review (maintainer link)

… everywhere; the highlighted test asserts the selected row too
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 58e9ff4

@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 record line: the code, tests and Changesets check out, the earlier record fixes landed, and a record change approved at this head decides every new state and target.

  • Miss: docs/specs/components/Typeahead/Typeahead.spec.md line 44 (Builder impact) still says builders theme four Typeahead targets, while FR2 and Typeahead.doc.mjs now have five with typeahead-option; please change "four" to "five".
Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Core release note: the active option of the select, multi-select and typeahead lists carries a highlighted state on its row target, as Item and CommandPaletteItem rows do. Verified: Selector.tsx:1054, MultiSelector.tsx:2220, BaseTypeahead.tsx:2332-2338; the three new component tests fail on the base and pass here.
  • Core release note: the typeahead row gets its own target, typeahead-option, with size and selected. Verified: Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row and data-selected on the selected row only.
  • Core release note: a theme can style the highlighted option without a structural selector. Verified: the editor test compiles a [data-highlighted="highlighted"] rule on each row target; probe-theme captures paint the active row in its own colour.
  • CLI release note: the experimental theme editor sets the state with --state highlighted on the three rows. Verified: theme-option-highlighted.test.mjs fails on the base and passes here.
  • CLI release note: the editor reads a value labeled with that state. Verified: _check.mjs:2377 with the label check at _check.mjs:3142 answers with the --state highlighted command.
  • Description: before the change no list row carried a highlight state and the typeahead option class did not exist. Verified: base captures and red-first runs.
  • Description: after ArrowDown exactly the active option carries the state in each list, and other rows carry no new attribute. Verified: the three component tests and the capture receipts.
  • Description: a theme that sets none of these looks the same, and no prop or behaviour changes. Verified: the default-theme Selector frame is pixel-identical; no StyleX rule changes.
  • Description: the theming-target guard drops its stale BaseTypeahead size exception. Verified: themingTargets.test.ts passes.
  • Description: the records name the new state and target, the anatomy entries point at typeahead-option, and the Typeahead open question narrows to the group heading. Partly false: they do, but the Typeahead Builder impact row still counts four targets (finding above).
  • Description: the listed tests and checks pass. Verified here: the component and editor tests, the knowledge, Changeset and probe-theme checks, Prettier, ESLint and the CLI strict typecheck.

Files:

  • .changeset/core-option-highlighted-state.md: clear
  • .changeset/experimental-theme-option-highlighted.md: clear
  • docs/specs/components/MultiSelector/MultiSelector.spec.md: clear
  • docs/specs/components/Selector/Selector.spec.md: clear
  • docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear
  • docs/specs/components/Typeahead/Typeahead.spec.md: finding (Builder impact count)
  • packages/cli/api/theme-edit/_check.mjs: clear
  • packages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.doc.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear
  • packages/core/src/Selector/Selector.activeOption.test.tsx: clear
  • packages/core/src/Selector/Selector.doc.mjs: clear
  • packages/core/src/Selector/Selector.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.tsx: clear
  • packages/core/src/Typeahead/Typeahead.doc.mjs: clear
  • packages/core/src/theme/themingTargets.test.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 2f5690a

@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 wording fix: the code, tests, records and Changesets check out, the earlier record finding is fixed, and a record change approved at this head decides every new state and target.

  • Miss: the title ("the active list option carries a highlighted theme state") and the description's User impact ("every listbox option row reflects highlighted on the active option") claim more than the change does, because DateTimeInput's time list and Chat's trigger menu still carry no highlighted state, so please name the three lists as the core Changeset already does, for example "the active option of select, multi-select and typeahead lists carries a highlighted theme state".

Editing the title and description is enough; no new commit is needed.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Core release note: the active option of the select, multi-select and typeahead lists carries a highlighted state on its row target, as Item and CommandPaletteItem rows do. Verified: Selector.tsx:1054, MultiSelector.tsx:2220, BaseTypeahead.tsx:2332-2338; the three new component tests fail on the base and pass here.
  • Core release note: the typeahead row gets its own target, typeahead-option, with size and selected. Verified: Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row and data-selected on the selected row only.
  • Core release note: a theme can style the highlighted option without a structural selector. Verified: the editor test compiles a [data-highlighted="highlighted"] rule on each row target; probe-theme captures paint the active row in its own colour.
  • CLI release note: the experimental theme editor sets the state with --state highlighted on the three rows. Verified: theme-option-highlighted.test.mjs fails on the base and passes here.
  • CLI release note: the editor reads a value labeled with that state. Verified: _check.mjs:2377 with the label check at _check.mjs:3142 answers with the --state highlighted command.
  • Description: before the change no list row carried a highlight state and the typeahead option class did not exist. Verified: base captures and red-first runs.
  • Description: Item and CommandPaletteItem rows already carry the state. Verified: Item.tsx:1028, CommandPaletteItem.tsx:208.
  • Description and title: every listbox option row, or the active list option, carries the state after the change. False: only the three lists change; DateTimeInput.tsx:2141 and useTriggerMenu.tsx:950 do not (finding above).
  • Description: after ArrowDown exactly the active option carries the state in each list, and other rows carry no new attribute. Verified: the three component tests and the capture probes.
  • Description: the theme editor needs no further change for these rows and learns the state word for a pasted value. Verified: the editor test and _check.mjs:2377.
  • Description: a theme that sets none of these looks the same, and no prop or behaviour changes. Verified: the default-theme Selector frame is pixel-identical, and no published theme's built output changes.
  • Description: the theming-target guard drops its stale BaseTypeahead size exception. Verified: themingTargets.test.ts passes.
  • Description: the records name the new state and target, the anatomy entries point at typeahead-option, and the Typeahead open question narrows to the group heading. Verified: Typeahead.spec.md:44, :106, :117, :227, :239, :284; BaseTypeahead.spec.md:134, :243-247, :270-274.
  • Description: the listed tests and checks pass. Verified: the component and editor tests, the knowledge, Changeset and probe-theme checks here; lint and typecheck in CI at this head.

Files:

  • .changeset/core-option-highlighted-state.md: clear
  • .changeset/experimental-theme-option-highlighted.md: clear
  • docs/specs/components/MultiSelector/MultiSelector.spec.md: clear
  • docs/specs/components/Selector/Selector.spec.md: clear
  • docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear
  • docs/specs/components/Typeahead/Typeahead.spec.md: clear (Builder impact now counts five targets)
  • packages/cli/api/theme-edit/_check.mjs: clear
  • packages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.doc.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear
  • packages/core/src/Selector/Selector.activeOption.test.tsx: clear
  • packages/core/src/Selector/Selector.doc.mjs: clear
  • packages/core/src/Selector/Selector.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.tsx: clear
  • packages/core/src/Typeahead/Typeahead.doc.mjs: clear
  • packages/core/src/theme/themingTargets.test.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)

Automated review (maintainer link)

@josephfarina josephfarina changed the title fix(core): the active list option carries a highlighted theme state fix(core): the active option of select, multi-select and typeahead lists carries a highlighted theme state Nov 15, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d87049c

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

Approved pending CI: CI has not finished on this head yet. The title and description now name the select, multi-select and typeahead lists, which was the only open point; the code, tests, records and Changesets check out, and a record change approved at this head decides every new state and target.

Claims and files checked

Review mode: incremental; reason: none

Claims:

  • Core release note: the active option of the select, multi-select and typeahead lists, whether the keyboard or the pointer put it there, carries a highlighted state on its row target, as Item and CommandPaletteItem rows do. Verified: Selector.tsx:1054, MultiSelector.tsx:2220, BaseTypeahead.tsx:2332-2345; pointer moves the same highlight (Selector/hooks.ts:467-474, MultiSelector.tsx:2239, BaseTypeahead.tsx:2328); Item.tsx:1028, CommandPaletteItem.tsx:208; the three new component tests fail on the base and pass here.
  • Core release note: the typeahead row gets its own target, typeahead-option, with size and selected. Verified: Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row and data-selected on the selected row only.
  • Core release note: a theme can style the highlighted option without a structural selector. Verified: the editor test compiles a [data-highlighted="highlighted"] rule on each row target; probe-theme captures paint only the active row in the highlighted colour.
  • CLI release note: the experimental theme editor sets the state with --state highlighted on the three rows. Verified: theme-option-highlighted.test.mjs fails on the base and passes here.
  • CLI release note: the editor reads a value labelled with that state. Verified: _check.mjs:2377; a pasted value labelled highlighted is answered with the --state highlighted command (_check.mjs:3142-3154).
  • Title and User impact: before the change these rows had no highlight state and the typeahead row no target; after it, the active option of select, multi-select and typeahead lists carries the state. Verified: base source and base captures; the three component tests; Core's other listboxes (DateTimeInput's time list, Chat's trigger menu) are not named and are unchanged.
  • Problem: Selector and MultiSelector rows reflected size, selection and disabled state but not the highlight, and the typeahead row was a recorded reachability gap. Verified: the base themeProps calls and the base Typeahead and BaseTypeahead theming anatomy.
  • Authority: a public data attribute needs a record that names it, and the four records now name the state and target; the typeahead anatomy points at typeahead-option, and the open question narrows to the group heading. Verified: Selector.spec.md:147, MultiSelector.spec.md:166, BaseTypeahead.spec.md:134, :243-247, :270-274, Typeahead.spec.md:117, :227, :239, :284.
  • The theme editor needs no further change for these rows beyond the state word. Verified: the editor test passes with only _check.mjs:2377 added.
  • Smallest restoration: one-line reflections on two rows, the typeahead wrap, the three doc entries and the removed size exception in the theming guard. Verified: the diff; themingTargets.test.ts passes.
  • A theme that sets none of these looks the same, and no prop or behaviour changes. Verified: the default-theme Selector frame is pixel-identical; no prop or handler changes; no published theme's built output changes.
  • After ArrowDown exactly the active option carries the state, and inactive rows carry no highlight attribute; typeahead rows also gain the target class and data-size, as the description's Before line and Smallest restoration say. Verified: the three component tests and the row probes.
  • The listed tests and checks pass. Verified here: the component and editor tests, the knowledge, Changeset and probe-theme checks, the records lookup and the CLI's strict TypeScript; lint passes in CI at this head.
  • Writing rubric: the record edits carry no narration, project status or change references, the new verification rows name tests, and the open question keeps only the group heading. Verified: every added record line.

Files:

  • .changeset/core-option-highlighted-state.md: clear
  • .changeset/experimental-theme-option-highlighted.md: clear
  • docs/specs/components/MultiSelector/MultiSelector.spec.md: clear
  • docs/specs/components/Selector/Selector.spec.md: clear
  • docs/specs/components/Typeahead/BaseTypeahead.spec.md: clear
  • docs/specs/components/Typeahead/Typeahead.spec.md: clear
  • packages/cli/api/theme-edit/_check.mjs: clear
  • packages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.doc.mjs: clear
  • packages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear
  • packages/core/src/Selector/Selector.activeOption.test.tsx: clear
  • packages/core/src/Selector/Selector.doc.mjs: clear
  • packages/core/src/Selector/Selector.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.test.tsx: clear
  • packages/core/src/Typeahead/BaseTypeahead.tsx: clear
  • packages/core/src/Typeahead/Typeahead.doc.mjs: clear
  • packages/core/src/theme/themingTargets.test.ts: clear
  • packages/themes/probe/src/probeTheme.ts: clear (generated; the probe check reports it current)

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — d87049ca Deployed Nov 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.

1 participant