Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsMultiSelector (@astryxdesign/core) · View in Storybook
Component Size
Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included. Bundle Size SummaryGzip figures measure each package's entry file, not the code an import pulls in.
Accessibility AuditStatus: No accessibility violations detected. Visual Regression55 of 502 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 35 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
670ee07 to
9223b29
Compare
There was a problem hiding this comment.
Approval is waiting on a maintainer spec decision: renderCreateOption is a new public prop that no current spec authorizes yet, because the MultiSelector record is still a draft and the FR11 and DEC-3 this PR adds are only proposed. A maintainer needs to provide or identify the governing spec for this addition, settling whether callers may supply the create row's content while hasCreate stays the only switch, whether the row is named and announced by the text it renders, and what a row whose content renders no text should do. The implementation otherwise works as described and nothing changes for callers who omit the prop, but two fixes would still be needed if the prop is admitted:
- The create row's announcement changes content and timing, so
spec:AST-056routes it tospec:AST-009: please state the trigger (FR4), name the real-AT matrix (NVDA + Chrome on Windows, VoiceOver + Safari on macOS) with a scenario on theCreateRowContentstory, and add a durable release-block record. - Content with no readable text leaves a nameless option that announces nothing; please warn in development in that case (or fall back to
labelas the row's name) and cover it with a test.
[Automated review]
9223b29 to
71cb97f
Compare
There was a problem hiding this comment.
Approval is waiting on a maintainer spec decision: renderCreateOption is a new public prop that no current spec authorizes yet, because the MultiSelector record is still a draft and the FR11 and DEC-3 this PR adds are only proposed. A maintainer needs to provide or identify the governing spec for this addition, settling whether callers may supply the create row's content while hasCreate stays the only switch, whether the row is named and announced by the text it renders, and what a row whose content renders no text should do. The implementation otherwise works as described and nothing changes for callers who omit the prop, but two fixes would still be needed if the prop is admitted:
- Content with no readable text leaves a nameless option that announces nothing; please warn in development in that case (or fall back to
labelas the row's name and announcement) and cover it with a test. - The create row's announcement changes content and timing, so
spec:AST-056routes it tospec:AST-009: please state the trigger (FR4), name the real-AT matrix (NVDA + Chrome on Windows, VoiceOver + Safari on macOS) with a scenario on theCreateRowContentstory, and add a durable release-block record like the existing one for #6950.
[Automated review]
| ); | ||
|
|
||
| let rowContent: ReactNode; | ||
| if (isCreate && renderCreateOption != null) { |
There was a problem hiding this comment.
Content that renders no readable text (an aria-hidden swatch alone, or null) leaves this option with no accessible name, and because the keystroke-time announcement is skipped whenever renderCreateOption is set, nothing is announced when it is the only result. Consider warning in development when the rendered row has no readable text, or falling back to label as the row's name and announcement, and covering the case with a test.
There was a problem hiding this comment.
Fixed in 13ff077: when the create row's content renders no readable text (aria-hidden parts left out, the same reading the live region uses), MultiSelector warns once in development: "renderCreateOption rendered no readable text, so the create row has no accessible name and announces nothing…". The new case covers both sides: a swatch alone warns, and a swatch beside label does not. It fails on the previous head. FR11 and its verification row say so.
|
On the AST-009 point: 13ff077 adds "Pending release block — pull request #7272" to
The first stable release containing this change stays blocked until both rows pass or an owner records an exception (FR17). |
|
/approve-spec 13ff077 |
There was a problem hiding this comment.
Approval is waiting on a maintainer spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is still a draft and the FR11 and DEC-3 this PR adds still read as awaiting owner approval, and the /approve-spec on this head comes from the PR's author, so it cannot stand in for that decision. A maintainer other than the author needs to provide or identify the governing spec for this addition, settling whether callers may supply the create row's content with hasCreate as the only switch, and whether the row is named and announced by the text that content renders. Both fixes from the last review are in (the development warning for content with no readable text, and the AST-009 release block), and nothing else is outstanding in the code.
[Automated review]
|
/revoke-spec 13ff077 |
## Exact decision needed
Whether merge or stable release may wait on real assistive-technology (NVDA, VoiceOver) evidence that contributors cannot produce.
## Existing authority searched
- `spec:AST-009` (current): FR4/FR8/FR17–FR19 required an explicit trigger classification, a named real-AT matrix, a scenario, and a durable release-block record, and blocked the first stable release until real-AT receipts passed or an owner exception applied.
- Linked records that restated the block or required screen-reader checks: `spec:AST-001` (browser evidence and FR7 row), `module:Table/useTableRowStatus` AR6, `module:Table/useTableColumnResize` verification, `spec:AST-056` (browser evidence line), `spec:AST-021` (release boundary phrase), `spec:AST-086` (FR6 real-AT row and platform line), `component:FieldStatus` AR5 and its verification row, `spec:AST-020` FR6 ("real-AT contract").
- Open PRs that add release-block sections to AST-009: #7732, #7275, #7272. Under this record those sections are no longer needed.
## Decision
- No requirement gates merge or release on evidence that cannot be produced (Intent, FR17, DEC-4).
- Merge and stable release need only the unit, DOM, accessibility-tree, axe, and real-browser evidence the owning records require (FR17).
- Announcements are proved by their routing: which element or channel carries them, their text, urgency, and update count per occasion (FR4, FR19).
- Real-AT observation is recommended follow-up when an outcome depends on AT behavior, may be tracked in a public issue, and holds no pull request or release (FR1–FR6, FR18).
- A change with an AT-dependent claim says so and names its lower-layer evidence; no matrix, scenario, or release record is needed to merge (FR8).
- Evidence-layer boundaries, the representative matrix, failure handling, and durable receipts stay, scoped to when a real-AT check runs.
- The exception process (old FR23–FR26) is removed because nothing remains to except.
## Rejected alternatives
- Holding stable releases until named real-AT receipts pass: fixes for known accessibility defects stall when no contributor can run the required pairings.
## Claim scope and non-goals
Only the evidence bar for merge and release, and the status of real-AT observation. Component accessibility requirements, evidence-layer boundaries, and focus/announcement behavior stay with their owners.
## Evidence and implementation relationship
Status-announcement conformance PRs (#7869, #7870, #7871, #7892, #7900, #7910) stall on the old real-AT release-block requirement because nobody in the review loop can run NVDA or VoiceOver. No implementation is included.
## Writing rubric results
- R1 narration: none; present-tense rules throughout. The two earlier holds are described as current follow-ups.
- R2 research in the record: none.
- R3 evidence naming a change: none; the earlier hold sections that named pull requests are replaced by the facts (story names and claims).
- R4 rejected alternatives over one line or outside a decision: one per decision, one line each.
- R5 pull request or issue references remaining: none in AST-009 or the edited lines.
- R6 ruled open questions still listing options: none.
## Scope
- [x] This PR contains specification records only.
- [x] It records observable behavior and preserves equivalent internal implementations.
- [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
- [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
- [x] It records one intentional durable decision, not a rescue for a separable tagalong.
- [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
- [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
- [x] Public text and artifacts contain no internal Meta context.
## Validation
- `pnpm check:knowledge`
- Prettier
- `git diff --check`
There was a problem hiding this comment.
Approval is waiting on a maintainer spec decision: renderCreateOption is a new public prop that no current spec admits, because the MultiSelector record is still a draft and the FR11 and DEC-3 this PR adds await owner approval, which no engineering owner has given on this head. A maintainer needs to provide or identify the governing spec for this addition, settling whether callers may supply the create row's content with hasCreate as the only switch, and whether the row is named and announced by the text that content renders. If it is admitted, two fixes remain:
- The only-result announcement and the no-text warning read the row's visible text rather than its accessible name, so a swatch named with
aria-labelis announced without that name, or not at all, and the warning wrongly calls the row nameless; announce the name the browser computes, or word FR11, the docs and the warning as visible text and add a test for that case. - The announcement that now runs after render needs the evidence
spec:AST-009FR4 asks for: a real-browser check on theCreate Row Contentstory of the option's name and of one polite-region update per keystroke, listed in FR11's verification row.
[Automated review]
There was a problem hiding this comment.
Approval is waiting on a maintainer spec decision: renderCreateOption is a new public prop that no current spec admits, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval, which no engineering owner has given on this head. A maintainer needs to provide or identify the governing spec for this addition, settling whether callers may supply the create row's content with hasCreate as the only switch and whether the row is named and announced by that content as FR11 now describes, or how the shape should change. Two small fixes remain either way:
- A swatch named only by
titleleaves the create row silent when it is the only result and triggers a false "no accessible name" warning, and text hidden withhiddenordisplay: noneis announced (contentNameinuseAnnounceRenderedText.ts). - The prop's JSDoc and the record's accessibility paragraph still say the row is named by the text it renders; word them as FR11 does.
[Automated review]
| // Document order visits an element before its descendants, so a named | ||
| // element's name replaces its whole subtree; skip what that removed. | ||
| for (const named of copy.querySelectorAll( | ||
| '[aria-labelledby], [aria-label], img[alt], svg', |
There was a problem hiding this comment.
title isn't counted here, and the detached clone still reads hidden and display: none text. In Chromium, a swatch named only by title gives the option the name New label Xyz, yet the row then announces nothing and the development warning says it has no accessible name; <span hidden>Red</span> beside the label is announced as RedCreate "Xyz" while the option is named Create "Xyz". Using an element's title when nothing else names it, and leaving out subtrees that aren't rendered (reading display from the live element), with jsdom cases for both, would keep the announcement equal to the name FR11 promises.
| * `renderOption` still never sees it. Its accessible name is the text this | ||
| * content renders, and when it is the only result that text, `aria-hidden` | ||
| * parts left out, is what the live region announces. Setting this without |
There was a problem hiding this comment.
This still says the accessible name is the text the content renders. Since the contentName change the row is named as FR11 says (an aria-label, alt or svg title inside counted), and content that names nothing also warns; worth wording it the same way, so the editor tooltip matches the docs.
| `renderCreateOption`, the row's name and that announcement are the text the | ||
| caller's content renders. |
There was a problem hiding this comment.
This paragraph still says the name and the announcement are the text the caller's content renders, while FR11 (line 134) names the row by its content with an aria-label, alt or svg title counted. An owner approving the record would approve both rules; word this one as FR11 does.
c9842b5 to
d1966d2
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner's spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval, so an engineering owner (the author included) needs to settle whether callers may supply the create row's content, with hasCreate as the one switch, and record it by commenting /approve-spec <full head SHA> on this pull request. Whichever way that goes, two changes are needed to match the specs now on main:
- The only-result announcement reads the row's computed name, but
spec:AST-086FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced asRed Create "Xyz", a swatch named only bytitleannounces nothing behind a false "no accessible name" warning, andhiddentext is announced. - The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which
architecture:react-component-runtimeINV10 places in the shared announcement module; moving the check intouseAnnounceRenderedTextwould resolve it.
Once the reading is settled, the prop's JSDoc and the record's accessibility paragraph should state the same rule as FR11 and the docs.
[Automated review]
| createRowRef, | ||
| isCreateRowAlone, | ||
| searchQuery, | ||
| contentName, |
There was a problem hiding this comment.
This reads the create row with contentName, so content that renders text beside a named part is announced by its name (Red Create "Xyz" while the row shows Create "Xyz"), a swatch named only by title announces nothing, and hidden text is announced. spec:AST-086 FR12 on main asks own-content announcements for "the element's rendered text, or its accessible name when it renders no text". Reading the rendered text first (leaving out aria-hidden and unrendered parts) and falling back to the name, title included, would conform; the case at MultiSelector.test.tsx:4794 would then expect Create "Urgent".
| const isCreateRowContentShown = | ||
| surface.isOpen && hasCreateOptionContent && hasCreateRow; | ||
| const hasWarnedNamelessCreateRowRef = useRef(false); | ||
| useEffect(() => { |
There was a problem hiding this comment.
This Effect reads the rendered row with contentName after every commit. architecture:react-component-runtime INV10 on main: "Core adopting components hold no Effect, observer, timer, or listener of their own to detect page load, read rendered text, or write that announcement." Letting useAnnounceRenderedText report or warn when the row it reads names nothing would keep the reading in the shared module and stop the two readers drifting; they already disagree for a title-named swatch.
d1966d2 to
8801b51
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner's spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval. An engineering owner, the author included if they are one, records that decision by commenting /approve-spec <full head SHA> on this pull request, settling whether callers may supply the create row's content with hasCreate as the one switch, and which rule names and announces the row. Whichever way that goes, these need changing to match the specs on main:
- The only-result announcement reads the row's computed name, but
spec:AST-086FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced asRed Create "Xyz", a swatch named only bytitleannounces nothing behind a false "no accessible name" warning, anddisplay: nonetext is announced. - The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which
architecture:react-component-runtimeINV10 places in the shared announcement module (useAnnounceRenderedText). - The prop's JSDoc, the record's accessibility paragraph and the warning text each state a different naming rule from FR11; word them the same once the reading is settled.
[Automated review]
| * `aria-label`, an image by its `alt` and an `svg` by its `<title>` counted | ||
| * by that name. | ||
| */ | ||
| export function contentName(element: HTMLElement): string { |
There was a problem hiding this comment.
spec:AST-086 FR12 on main has own-content announcements say "the element's rendered text, or its accessible name when it renders no text". Reading the create row with contentName announces a labelled swatch beside the text as Red Create "Xyz" while the row shows Create "Xyz", stays silent for a swatch named only by title (Chromium names it New label Xyz), and still reads display: none text from the detached clone (RedCreate "Xyz"). Reading the rendered text first, leaving out unrendered parts, and falling back to the name, title included, only when no text renders would conform.
| const isCreateRowContentShown = | ||
| surface.isOpen && hasCreateOptionContent && hasCreateRow; | ||
| const hasWarnedNamelessCreateRowRef = useRef(false); | ||
| useEffect(() => { |
There was a problem hiding this comment.
This Effect reads the rendered row with contentName after every commit. architecture:react-component-runtime INV10 on main: "Core adopting components hold no Effect, observer, timer, or listener of their own to detect page load, read rendered text, or write that announcement." Letting useAnnounceRenderedText warn or report when the row it already reads names nothing would keep the reading in the shared module.
| * `renderOption` still never sees it. Its accessible name is the text this | ||
| * content renders, and when it is the only result that text, `aria-hidden` | ||
| * parts left out, is what the live region announces. Setting this without | ||
| * `hasCreate` warns in development. |
There was a problem hiding this comment.
This still says the accessible name is the text the content renders, while FR11, the docs and the code count an inner aria-label, alt or svg title, and it leaves out the warning for content that names nothing; worth wording it as the settled rule once the reading follows AST-086 FR12.
| matches what is on screen; picking it announces the creation. With | ||
| `renderCreateOption`, the row's name and that announcement are the text the | ||
| caller's content renders. |
There was a problem hiding this comment.
This paragraph says the name and the announcement are the text the content renders, while FR11 (line 134) counts an inner aria-label, alt or svg title, so an owner approving the record would approve both rules; one rule in both places, matching AST-086 FR12, would settle it.
8801b51 to
4234025
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner's spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval. An engineering owner, the author included if they are one, records that decision by commenting /approve-spec <full head SHA> on this pull request, settling whether callers may supply the create row's content with hasCreate as the one switch, and which rule names and announces the row. Whichever way that goes, these need changing to match the specs on main:
- The only-result announcement reads the row's computed name, but
spec:AST-086FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced asRed Create "Xyz", a swatch named only bytitleannounces nothing behind a false "no accessible name" warning, anddisplay: nonetext is announced. - The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which
architecture:react-component-runtimeINV10 places in the shared announcement module (useAnnounceRenderedText). - The prop's JSDoc, the record's accessibility paragraph and the warning text each state a different naming rule from FR11; word them the same once the reading is settled.
[Automated review]
…e row
The hasCreate row rendered its Create "<query>" text and nothing else:
renderOption skips it and option icons are not rendered, so a picker
could not show on the row what the new option will look like.
renderCreateOption({query, label}) renders the row's content in place of
that text, label being the localized default so the row keeps its words.
The row stays a plain option in both presentations; its accessible name
is its rendered text, which the live region announces when the row is
the only result. Set without hasCreate, it warns in development.
Proposed FR11 and DEC-3 of component:MultiSelector record it.
… in development renderCreateOption content with no readable text left the create row nameless and silent; MultiSelector now warns once in development.
…ntent is announced by that name The create row's only-result announcement and its no-text warning read the row's rendered text, which leaves out names given by aria-label or alt, while the browser names an option from its content with them counted: content that was only <span role="img" aria-label="New label Urgent" /> gave an option named "New label Urgent", yet the row warned that it had no accessible name and was never announced. useAnnounceRenderedText now takes what to read from the element, and a new contentName counts a descendant named by aria-labelledby or aria-label, an image by its alt and an svg by its title, aria-hidden parts left out; the create row announces and checks that name. FR11, the docs and the changeset say the row is named by its content as an option is. A case renders an aria-label-only row (no warning, announced by that name) and a named swatch beside the text (the region says the option's whole accessible name); the first fails with the previous code.
…and its one announcement per query spec:AST-009 FR4 and FR19 ask for DOM and accessibility-tree evidence of an announcement's channel, text and update count. CreateRowContent.a11y.chromium.spec.ts types three queries that match nothing on the CreateRowContent story and checks, in Chromium, that the row is an option whose name Chromium's own accessibility tree computes from its content (the aria-hidden swatch left out) and that the polite region showed exactly that name once per keystroke. The pr-a11y job runs it in its own step, and FR11's verification row lists it.
…e the query Main now joins the messages announced within one frame into one (useAnnounce, meta#8244). In jsdom a typed query's keystrokes all land in one frame, so the region held 'New label “Urge” New label “Urgen” New label “Urgent”' and the two cases that read it failed. They now paste the query: one change, one announcement, as a person's separate keystrokes are separate frames in a browser. The Chromium spec, where each keystroke is its own frame, still sees one announcement per query. Tests only.
…ter test Main's adopter test (react-component-runtime INV10) checks that each core adopter shows its own content through the shared announcement module and announces none of it itself. MultiSelector's entry covered only its empty state; the create row this pull request adds is a second own-content announcement in the same file, so the entry now also opens a create row alone in the results and expects its content through the module. With the create row announced by an effect of its own instead, the case fails.
4234025 to
411a147
Compare
There was a problem hiding this comment.
Approval is waiting on an engineering owner's spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval. An engineering owner, the author included if they are one, records that decision by commenting /approve-spec <full head SHA> on this pull request, settling whether callers may supply the create row's content with hasCreate as the one switch, and which rule names and announces the row. Whichever way that goes, these need changing to match the specs on main:
- The only-result announcement reads the row's computed name, but
spec:AST-086FR12 asks for its rendered text, or its name only when no text renders: today a labelled swatch beside the text is announcedRed Create "Xyz", atitle-only swatch is silent behind a false warning, anddisplay: nonetext is read aloud. - The nameless-content warning is an Effect inside MultiSelector that reads the rendered row, which
architecture:react-component-runtimeINV10 places in the shared announcement module. - The record's accessibility paragraph, the prop's JSDoc and the warning text should state the same rule as FR11 once it is settled.
[Automated review]
| hasCreateRow && | ||
| realItemCount === 0; | ||
| useAnnounceRenderedText(createRowRef, isCreateRowAlone, searchQuery, { | ||
| read: contentName, |
There was a problem hiding this comment.
This reads the create row with contentName, so content that renders text beside a named part is announced by that name (Red Create "Xyz" while the row shows Create "Xyz"), a swatch named only by title announces nothing, and display: none text is read. spec:AST-086 FR12 on main has own-content announcements say "the element's rendered text, or its accessible name when it renders no text". Reading the rendered text first (aria-hidden and unrendered parts left out) and falling back to the name, title included, would conform.
| const isCreateRowContentShown = | ||
| surface.isOpen && hasCreateOptionContent && hasCreateRow; | ||
| const hasWarnedNamelessCreateRowRef = useRef(false); | ||
| useEffect(() => { |
There was a problem hiding this comment.
This Effect re-reads the rendered row with contentName after every commit. architecture:react-component-runtime INV10: "Core adopting components hold no Effect, observer, timer, or listener of their own to detect page load, read rendered text, or write that announcement." Letting useAnnounceRenderedText warn when the element it reads yields neither text nor a name would keep one reader; this one already reports "no accessible name" for a title-named swatch that Chromium names.
| * say, beside that text. Receives the trimmed query and the default text, | ||
| * so the row keeps its words in every locale. The row stays a plain | ||
| * option (no checkbox, never selected, picked as before), and | ||
| * `renderOption` still never sees it. Its accessible name is the text this |
There was a problem hiding this comment.
This says the accessible name is the text the content renders and leaves out the warning for content that names nothing, while FR11, the docs and the code count an inner aria-label, alt or svg title. Worth stating the one settled rule here so the editor tooltip matches the docs.
| announces its label rather than the empty-search message, so what is announced | ||
| matches what is on screen; picking it announces the creation. | ||
| matches what is on screen; picking it announces the creation. With | ||
| `renderCreateOption`, the row's name and that announcement are the text the |
There was a problem hiding this comment.
This paragraph says the name and the announcement are the text the caller's content renders, while FR11 (line 134) counts an inner aria-label, alt or svg title, so an owner approving the record would approve both rules. One rule in both places, matching spec:AST-086 FR12, would settle it.
| await user.click(screen.getByRole('combobox', h)); | ||
| await user.paste('Urgent'); | ||
| await waitFor(() => { | ||
| expect(politeRegion()?.textContent).toBe('Red Create "Urgent"'); |
There was a problem hiding this comment.
This codifies the name-first reading: the row renders Create "Urgent", yet the region is expected to say Red Create "Urgent". Under spec:AST-086 FR12 it would expect Create "Urgent", while the accessible-name assertion just below rightly stays Red Create "Urgent".
| // Document order visits an element before its descendants, so a named | ||
| // element's name replaces its whole subtree; skip what that removed. | ||
| for (const named of copy.querySelectorAll( | ||
| '[aria-labelledby], [aria-label], img[alt], svg', |
There was a problem hiding this comment.
A title attribute isn't counted here, and the detached clone still reads display: none text. In Chromium a swatch named only by title gives the option the name New label Xyz while this returns an empty string (the row stays silent and the warning fires), and a display: none span Red beside the label is read as RedCreate "Xyz". Using title when nothing else names an element, and reading display from the live element, would fix both.
Main's meta#8711 appended a 'MultiSelector caller aria-labelledby' suite to MultiSelector.test.tsx where this branch appends its own; the file keeps main's suite as is, then this branch's cases.
There was a problem hiding this comment.
Approval is waiting on an engineering owner's spec decision: renderCreateOption is a new public prop that no current spec admits yet, because the MultiSelector record is a draft and the FR11 and DEC-3 this PR adds still await owner approval. An engineering owner, the author included if they are one, records that decision by commenting /approve-spec <full head SHA> on this pull request, settling whether callers may supply the create row's content with hasCreate as the one switch, and which rule names and announces the row. Whichever way that goes, these need changing to match the specs on main:
- The only-result announcement reads the row's computed name, but
spec:AST-086FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announcedRed Create "Xyz", atitle-only swatch is silent behind a false warning, anddisplay: nonetext is read aloud. - The nameless-content warning is an Effect inside MultiSelector that reads the rendered row, which
architecture:react-component-runtimeINV10 places in the shared announcement module. - The record's accessibility paragraph, the prop's JSDoc and the warning text should state the same rule as FR11 once it is settled.
[Automated review]
|
I'm pausing this work for now to reduce contention on the repo. Thank you for the reviews and the spec guidance. |
User need
What led to it: this comes from moving every menu and picker in our app onto Astryx, which began with a press, slide and lift bug in its phone menus. Our label picker gives each new label a colour, and MultiSelector's create row can only show its fixed
Create "<query>"text;renderOptionskips that row, so there is nowhere to put the swatch.Why: people should see a new label's colour on the Create row before they commit, not discover it after the label exists.
Problem and solution fit
One optional prop,
renderCreateOption({query, label}), renders the create row's content.labelis the default translated text, so a caller adds a swatch without rewording anything. Everything else about the row stays as today: it can't be selected, has no checkbox, and assistive technology hears the text the caller renders. Icons in ordinary rows are out of scope.Current specification
component:MultiSelectoris a draft. This PR proposes FR11 and DEC-3 for the create row's content, pending owner review. It keepsspec:AST-056's rules thathasCreatestays the one switch and that what is announced is what is shown.Public delta and caller burden
renderCreateOptionand its typeMultiSelectorCreateOption. Callers that don't set it see no change.Design and alternatives
renderOptionfor the create row. No new prop, but every existingrenderOptionwould start receiving a made-up option, which can break current callers.createIconprop. Smaller, but it allows only one glyph, not a worded row.renderCreateOption(chosen). It matchesrenderOptionandrenderTrigger, leaves current callers untouched, and passes the default text so nothing is translated twice. The cost is one more prop to learn.Evidence
Seven new cases in
MultiSelector.test.tsxfail onmainand pass here: the row's behaviour, what is announced, the bottom sheet, and the development warnings.CreateRowContent.a11y.chromium.spec.tschecks the accessible name and one announcement per query in Chromium.Writing rubric results
R1 narration: none in FR11 or DEC-3.
R2 research: none.
R3 evidence: FR11 cites DEC-3,
spec:AST-056AR1 and tests.R4 rejected alternatives: two, one line in DEC-3.
R5 change references: none.
R6 open questions: none.
Scope
Testing
Create "Docs".Create "Docs"; the dot is not read.