Repository navigation
fix(core): the active option of select, multi-select and typeahead lists carries a highlighted theme state - #11887
Conversation
…list carries a highlighted theme state
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 1dfdba9 |
…tate and typeahead-option target
|
/approve-spec 1a6da85 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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.mdstill 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 thetypeahead-optiontarget 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
highlightedstate 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, withsizeandselected. Verified:Typeahead.doc.mjs:327-331; a selected large row rendersdata-size="lg"anddata-selected="selected". - CLI release note: the experimental theme editor sets the state with
--state highlightedon the three rows. Verified:theme-option-highlighted.test.mjsfails on the base and passes here. - CLI release note: the editor reads a value labeled with that state. Verified:
_check.mjs:2377; a pastedhighlighted: …value is now refused with the--state highlightedcommand. - 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.tspasses. - 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: cleardocs/specs/components/MultiSelector/MultiSelector.spec.md: cleardocs/specs/components/Selector/Selector.spec.md: cleardocs/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: clearpackages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clearpackages/core/src/MultiSelector/MultiSelector.doc.mjs: clearpackages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/Selector/Selector.activeOption.test.tsx: clearpackages/core/src/Selector/Selector.doc.mjs: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: clearpackages/core/src/Typeahead/Typeahead.doc.mjs: clearpackages/core/src/theme/themingTargets.test.ts: clearpackages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)
… everywhere; the highlighted test asserts the selected row too
|
/approve-spec 58e9ff4 |
There was a problem hiding this comment.
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.mdline 44 (Builder impact) still says builders theme four Typeahead targets, while FR2 andTypeahead.doc.mjsnow have five withtypeahead-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
highlightedstate 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, withsizeandselected. Verified:Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row anddata-selectedon 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 highlightedon the three rows. Verified:theme-option-highlighted.test.mjsfails on the base and passes here. - CLI release note: the editor reads a value labeled with that state. Verified:
_check.mjs:2377with the label check at_check.mjs:3142answers with the--state highlightedcommand. - 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.tspasses. - 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: cleardocs/specs/components/MultiSelector/MultiSelector.spec.md: cleardocs/specs/components/Selector/Selector.spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: cleardocs/specs/components/Typeahead/Typeahead.spec.md: finding (Builder impact count)packages/cli/api/theme-edit/_check.mjs: clearpackages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clearpackages/core/src/MultiSelector/MultiSelector.doc.mjs: clearpackages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/Selector/Selector.activeOption.test.tsx: clearpackages/core/src/Selector/Selector.doc.mjs: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: clearpackages/core/src/Typeahead/Typeahead.doc.mjs: clearpackages/core/src/theme/themingTargets.test.ts: clearpackages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)
|
/approve-spec 2f5690a |
There was a problem hiding this comment.
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
highlightedon the active option") claim more than the change does, because DateTimeInput's time list and Chat's trigger menu still carry nohighlightedstate, 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
highlightedstate 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, withsizeandselected. Verified:Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row anddata-selectedon 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 highlightedon the three rows. Verified:theme-option-highlighted.test.mjsfails on the base and passes here. - CLI release note: the editor reads a value labeled with that state. Verified:
_check.mjs:2377with the label check at_check.mjs:3142answers with the--state highlightedcommand. - 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:2141anduseTriggerMenu.tsx:950do 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.tspasses. - 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: cleardocs/specs/components/MultiSelector/MultiSelector.spec.md: cleardocs/specs/components/Selector/Selector.spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: cleardocs/specs/components/Typeahead/Typeahead.spec.md: clear (Builder impact now counts five targets)packages/cli/api/theme-edit/_check.mjs: clearpackages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clearpackages/core/src/MultiSelector/MultiSelector.doc.mjs: clearpackages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/Selector/Selector.activeOption.test.tsx: clearpackages/core/src/Selector/Selector.doc.mjs: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: clearpackages/core/src/Typeahead/Typeahead.doc.mjs: clearpackages/core/src/theme/themingTargets.test.ts: clearpackages/themes/probe/src/probeTheme.ts: clear (regenerated; the generator's check passes)
|
/approve-spec d87049c |
There was a problem hiding this comment.
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
highlightedstate 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, withsizeandselected. Verified:Typeahead.doc.mjs:327-331; the BaseTypeahead test finds the class on every row anddata-selectedon 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 highlightedon the three rows. Verified:theme-option-highlighted.test.mjsfails 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 labelledhighlightedis answered with the--state highlightedcommand (_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
themePropscalls 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:2377added. - 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.tspasses. - 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: cleardocs/specs/components/MultiSelector/MultiSelector.spec.md: cleardocs/specs/components/Selector/Selector.spec.md: cleardocs/specs/components/Typeahead/BaseTypeahead.spec.md: cleardocs/specs/components/Typeahead/Typeahead.spec.md: clearpackages/cli/api/theme-edit/_check.mjs: clearpackages/cli/api/theme-edit/theme-option-highlighted.test.mjs: clearpackages/core/src/MultiSelector/MultiSelector.doc.mjs: clearpackages/core/src/MultiSelector/MultiSelector.openHighlight.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/Selector/Selector.activeOption.test.tsx: clearpackages/core/src/Selector/Selector.doc.mjs: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.test.tsx: clearpackages/core/src/Typeahead/BaseTypeahead.tsx: clearpackages/core/src/Typeahead/Typeahead.doc.mjs: clearpackages/core/src/theme/themingTargets.test.ts: clearpackages/themes/probe/src/probeTheme.ts: clear (generated; the probe check reports it current)
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
highlightedstate; these list rows did not. With this change the option rows of select, multi-select and typeahead lists reflecthighlightedon the active option, the onearia-activedescendantnames.Problem and solution fit
size,selectedanddisabled, 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).The fix reflects the same
highlightedstate Item and CommandPaletteItem use, throughthemeProps, onselector-option-rowandmulti-selector-option, and gives the typeahead's option row its own target,typeahead-option, withsize,highlightedandselected.Expected behavior and authority
architecture:public-component-apiDEC-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:BaseTypeaheadFR17 andcomponent:TypeaheadFR13.typeahead-option. Typeahead OQ1 narrows to the group heading.astryx experimental theme editor) reads Core's documented targets and states, so--state highlightedon these rows works with no further change; it also learnshighlightedas a state word in a pasted value.Smallest restoration
Selector.tsx,MultiSelector.tsx:highlighted: isHighlighted ? 'highlighted' : nullin the row's existingthemeProps.BaseTypeahead.tsx: the option row spreadsthemeProps('typeahead-option', {size, highlighted, selected})beside its existing styles.Selector.doc.mjs,MultiSelector.doc.mjs,Typeahead.doc.mjs; the staleBaseTypeahead.sizeexception removed from the theming-target guard (the size now reachesthemeProps).Evidence
.astryx-typeahead-optiondoes not exist.data-highlighted="highlighted"in each list.Selector.activeOption.test.tsx,MultiSelector.openHighlight.test.tsxandBaseTypeahead.test.tsxeach assert that only the active option carries the state;theme-option-highlighted.test.mjssets a color on each row'shighlightedstate through the theme editor and finds the[data-highlighted="highlighted"]rule in the compiled stylesheet.Scope
Components: Selector, MultiSelector, BaseTypeahead, Typeahead; CLI theme editor
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:foron 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:BaseTypeaheadandcomponent:Typeahead.R1 narration: none; each added sentence states what the row carries ("carries the
typeahead-optiontarget…", "highlightedmarks the active option"), with nonow,previouslyoradded.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
yetorfollow-upwas added.