Skip to content

feat(MultiSelector): renderCreateOption — caller content in the create row - #7272

Closed
vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:ms-create-option
Closed

vjeux wants to merge 7 commits into
meta:mainfrom
vjeux:ms-create-option

Conversation

@vjeux

@vjeux vjeux commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review only this PR's change: the branch sits on main, so this diff is already its own.

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; renderOption skips 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. label is 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:MultiSelector is a draft. This PR proposes FR11 and DEC-3 for the create row's content, pending owner review. It keeps spec:AST-056's rules that hasCreate stays the one switch and that what is announced is what is shown.

Public delta and caller burden

  • New optional renderCreateOption and its type MultiSelectorCreateOption. Callers that don't set it see no change.
<MultiSelector
  {...pickerProps}
  hasSearch
  hasCreate
  renderCreateOption={({label}) => (
    <>
      <Swatch color={nextColor} aria-hidden />
      {label}
    </>
  )}
/>

Design and alternatives

  • Reuse renderOption for the create row. No new prop, but every existing renderOption would start receiving a made-up option, which can break current callers.
  • A createIcon prop. Smaller, but it allows only one glyph, not a worded row.
  • A separate renderCreateOption (chosen). It matches renderOption and renderTrigger, 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.tsx fail on main and pass here: the row's behaviour, what is announced, the bottom sheet, and the development warnings. CreateRowContent.a11y.chromium.spec.ts checks 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-056 AR1 and tests.
R4 rejected alternatives: two, one line in DEC-3.
R5 change references: none.
R6 open questions: none.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  1. In Storybook, open Core/MultiSelector → Create Row Content. The picker opens on its own.
  2. Type a name that isn't in the list, such as "Docs". The Create row shows a coloured dot before Create "Docs".
  3. With a screen reader or the accessibility tree, that row is read as Create "Docs"; the dot is not read.
  4. Press Enter. "Docs" is added and selected. Type another new name: its Create row shows the next colour.

@vercel

vercel Bot commented Oct 9, 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 27, 2026 6:49pm UTC

Request Review

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

astracat-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

MultiSelector (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 273B 273B 0B
Lines of Code 2642 2794 -
Complexity Very High Very High (363) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/BaseTypeahead 54.5KB 54.5KB +9B 9.9KB 9.9KB 0B
core/ChatComposer 60.8KB 60.8KB +4B 10.8KB 10.8KB 0B
core/CommandPalette 51.0KB 51.0KB +17B 11.8KB 11.8KB 0B
core/EmptyState 7.7KB 7.7KB +13B 3.5KB 3.5KB 0B
core/Markdown 144.5KB 144.5KB +20B 17.4KB 17.4KB 0B
core/MultiSelector 73.1KB 73.4KB +333B 14.6KB 14.6KB 0B
core/Pagination 84.9KB 84.9KB -1B 15.3KB 15.3KB 0B
core/PowerSearch 158.2KB 158.2KB +13B 19.9KB 19.9KB 0B
core/Selector 76.5KB 76.5KB +8B 15.0KB 15.0KB 0B
core/Table 83.9KB 83.9KB +7B 15.1KB 15.1KB 0B
core/Tokenizer 68.8KB 68.8KB +19B 16.5KB 16.5KB 0B
core/Typeahead 61.6KB 61.6KB +12B 11.3KB 11.3KB 0B
lab/CommentComposer N/A 94.2KB N/A N/A 1.9KB N/A
lab/CommentThread N/A 216.0KB N/A N/A 2.4KB N/A
lab/Comments N/A 220.6KB N/A N/A 2.5KB N/A
lab/ListInput N/A 75.3KB N/A N/A 1.6KB N/A
lab/MobilePowerSearch N/A 158.2KB N/A N/A 1.4KB N/A
lab/MobileTokenizer N/A 91.2KB N/A N/A 775B N/A
richtext/RichTextEditorToolbar N/A 212.6KB N/A N/A 454B N/A

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 Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 34.6KB 34.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

55 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 558,840
RichTextEditor Markdown parity: side by side probe light 540,756
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 35 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-056 routes it to spec:AST-009: please state the trigger (FR4), name the real-AT matrix (NVDA + Chrome on Windows, VoiceOver + Safari on macOS) with a scenario on the CreateRowContent story, 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 label as the row's name) and cover it with a test.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 label as the row's name and announcement) and cover it with a test.
  • The create row's announcement changes content and timing, so spec:AST-056 routes it to spec:AST-009: please state the trigger (FR4), name the real-AT matrix (NVDA + Chrome on Windows, VoiceOver + Safari on macOS) with a scenario on the CreateRowContent story, and add a durable release-block record like the existing one for #6950.

[Automated review]

);

let rowContent: ReactNode;
if (isCreate && renderCreateOption != null) {

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.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

On the AST-009 point: 13ff077 adds "Pending release block — pull request #7272" to spec:AST-009's current-state impact section. It records:

  • the trigger, FR4;
  • the scenario, on the checked-in Create Row Content story: paste Urgent, hear Create "Urgent" once without the swatch, then the same name on ArrowDown, and once more after !;
  • the NVDA + Chrome on Windows and VoiceOver + Safari on macOS rows, both pending.

The first stable release containing this change stays blocked until both rows pass or an owner records an exception (FR17).

@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 13ff077

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 21, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.
@vjeux

vjeux commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/revoke-spec 13ff077

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 21, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 22, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.
cixzhang added a commit that referenced this pull request Oct 22, 2026
## 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`

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

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-label is 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-009 FR4 asks for: a real-browser check on the Create Row Content story of the option's name and of one polite-region update per keystroke, listed in FR11's verification row.

[Automated review]

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 title leaves the create row silent when it is the only result and triggers a false "no accessible name" warning, and text hidden with hidden or display: none is announced (contentName in useAnnounceRenderedText.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',

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.

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.

Comment on lines +907 to +909
* `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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +193 to +194
`renderCreateOption`, the row's name and that announcement are the text the
caller's content renders.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.

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

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-086 FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced as Red Create "Xyz", a swatch named only by title announces nothing behind a false "no accessible name" warning, and hidden text is announced.
  • The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which architecture:react-component-runtime INV10 places in the shared announcement module; moving the check into useAnnounceRenderedText would 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.

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

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-086 FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced as Red Create "Xyz", a swatch named only by title announces nothing behind a false "no accessible name" warning, and display: none text is announced.
  • The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which architecture:react-component-runtime INV10 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 {

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.

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(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +908 to +911
* `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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +192 to +194
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

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-086 FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced as Red Create "Xyz", a swatch named only by title announces nothing behind a false "no accessible name" warning, and display: none text is announced.
  • The nameless-content warning is an Effect in MultiSelector that reads the rendered row, which architecture:react-component-runtime INV10 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]

vjeux added 6 commits October 26, 2026 08:42
…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.
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 26, 2026
Three open pull requests propose rules in this record: meta#7272 (FR11, DEC-3), meta#7273 (FR12, AR1, DEC-4) and meta#7274 (FR13, DEC-5). Each takes its own number, so none changes when another merges first. Record wording only.

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

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-086 FR12 asks for its rendered text, or its name only when no text renders: today a labelled swatch beside the text is announced Red Create "Xyz", a title-only swatch is silent behind a false warning, and display: none text is read aloud.
  • The nameless-content warning is an Effect inside MultiSelector that reads the rendered row, which architecture:react-component-runtime INV10 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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"');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 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',

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.

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.

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

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-086 FR12 asks for its rendered text, or its name only when no text renders: a labelled swatch beside the text is announced Red Create "Xyz", a title-only swatch is silent behind a false warning, and display: none text is read aloud.
  • The nameless-content warning is an Effect inside MultiSelector that reads the rendered row, which architecture:react-component-runtime INV10 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]

@vjeux

vjeux commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

I'm pausing this work for now to reduce contention on the repo. Thank you for the reviews and the spec guidance.

@vjeux vjeux closed this Oct 30, 2026

This branch was successfully deployed

1 active deployment
Preview — 847a7964 Deployed Oct 27, 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