Skip to content

feat(MultiSelector): with renderTrigger, status shows in the panel - #7274

Closed
vjeux wants to merge 5 commits into
meta:mainfrom
vjeux:ms-panel-status
Closed

vjeux wants to merge 5 commits into
meta:mainfrom
vjeux:ms-panel-status

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 uses renderTrigger (an icon button opens it) and can refuse a write, such as a name that's too long, but it had nowhere to say so.

Why: with renderTrigger, no Field renders, so MultiSelector ignores status and the person never learns why their label wasn't created.

Problem and solution fit

With renderTrigger, a status message now shows inside the open panel, under the search row (or above the list without search). The search field is described by the message and, for an error, marked invalid, and an error set while the panel is open is announced. Keeping a refused creation's text is #7275.

Current specification

component:MultiSelector is a draft. This PR amends FR8 ("no Field, status, … renders") and proposes FR13 and DEC-5, pending owner review. No prop is added: status gains a home where it was ignored.

Public delta and caller burden

  • With renderTrigger, a status message now renders in the open panel (statusVariant does not apply). The field path is unchanged.
<MultiSelector
  {...pickerProps}
  hasSearch
  hasCreate
  status={refusal ? {type: 'error', message: refusal} : undefined}
  renderTrigger={props => <IconButton icon="moreHorizontal" label="Labels" {...props} />}
/>

Design and alternatives

  • A new panelStatus prop. Explicit, but two props for one message, each ignored in one mode.
  • Show the message on the caller's trigger. No panel change, but the trigger is often an icon with no room for text.
  • Render status in the panel (chosen). No new API, and the message sits where the person is typing. The cost: the panel's layout gains a line while a message shows.

Evidence

New cases in MultiSelector.test.tsx cover placement, the description and invalid state, the announcement, the no-search list, the bottom sheet and the unchanged field path; the first four fail on main.

Writing rubric results

R1 narration: none in FR8, FR13 or DEC-5.
R2 research: none.
R3 evidence: FR13 cites DEC-5, component:FieldStatus and tests.
R4 rejected alternatives: two, one line in DEC-5.
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

In Storybook, open Core/MultiSelector → Trigger Panel Status; the panel opens on its own.

  1. Type a name longer than 12 characters and press Enter: "A label name can be at most 12 characters." appears under the search field.
  2. With a screen reader, the error is announced and the search field reads as invalid.
  3. Type a name of 12 characters or fewer and press Enter: the label is created and the message clears.

@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:45pm UTC

Request Review

@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 28, 2026, 12:42 PM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 9, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 9, 2026
@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 2682 -
Complexity Very High Very High (356) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/MultiSelector 73.1KB 73.2KB +150B 14.6KB 14.6KB 0B

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.

Thanks — this is a focused, well-evidenced change: with renderTrigger, a status message that was previously ignored now shows and is announced in the open panel, reusing the existing status prop and FieldStatus, with the field path unchanged. The focused tests and the refused-create flow check out, and no implementation issue was found.

Approval is waiting on one maintainer decision. component:MultiSelector is currently a draft record, and its FR8 states that no status renders in this mode; this PR proposes amending FR8 and adding FR11/DEC-3 to settle the new panel behavior (placement, which control the message describes, aria-invalid on error, and statusVariant not applying in the panel). A maintainer needs to approve that spec change — or point to other governing authority — before this can be approved. No code change is being requested for that hold.

[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 decision: component:MultiSelector is a draft whose FR8 says no status renders with renderTrigger, so a maintainer needs to approve or reject the proposed FR8 amendment, FR11 and DEC-3 (the panel placement, which element the message describes, aria-invalid on the search input, and statusVariant not applying), or point to other governing spec. Two fixes are needed either way:

  • Without search, setting or clearing status while the panel is open rebuilds the list element (MultiSelector.tsx lines 2402–2408), so keyboard focus falls to the page body; keep the list at a fixed position and add a test that changes status while that panel is open.
  • FR11 and the changeset say when the message is announced; narrow that wording to the live-region routing the tests prove, or classify it under AST-009 with a named screen-reader matrix and a pending release block.

[Automated review]

| FR9 | With `hasSearch` and `hasCreate`, once options have loaded, a `Create "<query>"` row leads the list when the trimmed query equals no option label under the search's own case-insensitive matching. Picking it, or Enter with nothing highlighted, calls `onChange` with the query appended to the value and a `{type: 'create', query}` descriptor, clears the search, and announces the creation; every other change passes no descriptor. The row has no checkbox, is never selected, is excluded from select-all and from `renderOption`, and is announced instead of the empty message when it is the only result. While `isLoading`, no row is offered and Enter commits nothing. `hasCreate` without `hasSearch` warns in development and offers nothing. | `spec:AST-056` FR5 / DEC-3, `component:Tokenizer` `hasCreate`, docs, and tests | Proposed; awaiting owner approval |
| option action | `action` absent, present | The option's secondary control as one node; the popup is a grid of rows pairing option and action | Pointer popup and Touch sheet | absent | Caller | additive | `null` is none; a control without a name warns in development |
| FR10 | Once any declared option — at any depth of sections, before any query filters it — carries an `action`, the popup is a `role="grid"` and stays one while mounted; the trigger advertises `aria-haspopup="grid"` (the bottom sheet keeps `dialog`). Each option, the select-all row included, is a `role="row"` carrying the option's id, `aria-selected` and `aria-disabled`, with exactly two `gridcell` children: the option's content, then its action or an empty cell. A section is a `rowgroup` named by its title. Pressing the option cell toggles; pressing the action fires the caller's control and nothing else. Up/Down move rows onto the option cell; the inline-end arrow moves to the action cell and the inline-start arrow back, following visual direction under RTL; Enter on the action cell activates the control. `aria-activedescendant` names the row or the action cell. No control inside the popup is a tab stop. | `spec:AST-058` FR1–FR8, AR1–AR4 | Proposed; awaiting owner approval |
| FR11 | With `renderTrigger` and a `status` message, the open panel shows the message through FieldStatus's detached variant, under the search row or, without search, above the list, whatever `statusVariant` says. The search input carries `aria-describedby` naming the message and, for an error, `aria-invalid="true"`; without search the listbox or grid carries the `aria-describedby`. FieldStatus announces the message when it appears or changes: assertively for an error, politely otherwise. Without `renderTrigger` the message stays in the Field and the panel shows none. | DEC-3, `component:FieldStatus`, docs, and tests | Proposed; awaiting owner approval |

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 row claims announcement timing ("announces the message when it appears or changes"), and the design relies on it ("announced when visible"). Under spec:AST-009 FR4, a status-message claim whose success depends on order, timing or repetition needs real AT/browser evidence. Two scenarios matter here:

  • a refused create, where the existing polite "<query> created" announcement comes before the assertive refusal;
  • opening over a standing message, where it is announced and also read as the focused search input's description.

Either record real AT/browser results for both, or narrow this sentence (and the changeset and doc wording) to the live-region routing and aria-describedby exposure the tests prove.

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.

Narrowed in 6471212: FR11, the behavior paragraph, DEC-3, the changeset and the code comment now claim the routing the tests prove: FieldStatus renders the message, and an error set while the panel is open reaches the assertive live region, as a field's error does. Nothing claims announcement order or timing.

@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 decision: component:MultiSelector is a draft whose FR8 says no status renders with renderTrigger, so a maintainer needs to approve or reject the proposed FR8 amendment, FR11 and DEC-3 (the panel placement, which element the message describes, aria-invalid on the search input, and statusVariant not applying), or point to other governing spec. Thanks for narrowing the announcement wording to the live-region routing the tests prove; one fix is still needed either way:

  • Without search, setting or clearing status while the panel is open swaps the list's element (MultiSelector.tsx lines 2436–2443), so keyboard focus falls to the page body and the arrow keys stop working; choosing that wrapper on hasExternalTrigger instead of on the message keeps the list in place, and a test that sets and clears status while a no-search panel is open would cover it.

[Automated review]

Comment on lines +2436 to +2443
) : panelStatusNode != null ? (
<div>
{panelStatusNode}
{renderListWithoutSearch()}
</div>
) : (
renderListWithoutSearch()
);

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.

Without search, this swaps between <div>{panelStatusNode}{list}</div> and the bare list, so when a message appears or clears while the panel is open the focused listbox element is turned into the message wrapper or removed, and keyboard focus falls to the page body (in Chromium, ArrowDown then stops moving the highlight). Choosing the wrapper on hasExternalTrigger keeps the list in place for the panel's lifetime:

) : hasExternalTrigger ? (
  <div>
    {panelStatusNode}
    {renderListWithoutSearch()}
  </div>
) : (
  renderListWithoutSearch()
);

A test that sets and clears status while a no-search panel is open, asserting the listbox keeps focus and ArrowDown moves the highlight, would cover it.

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 716d779 as suggested: with renderTrigger the wrapper is chosen on hasExternalTrigger, so it stays for the panel's lifetime and the list keeps its place as the message comes and goes. New case "without search, setting and clearing the message while the panel is open keeps the focused listbox, and its keys" sets and clears an error with a no-search panel open. It asserts the same listbox element keeps focus and that ArrowDown moves the highlight from Bug to Feature. It fails at the previous head, where the listbox is replaced. FR11 and its verification row now say so.

hasCreate
status={refusal != null ? {type: 'error', message: refusal} : undefined}
renderTrigger={props => (
<IconButton icon="moreHorizontal" label="Labels" {...props} />

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.

IconButton's icon is a ReactNode, so this renders the word "moreHorizontal" over the square button; icon={<Icon icon="moreHorizontal" />} shows the glyph.

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 716d779: icon={<Icon icon="moreHorizontal" />}, so the button shows the glyph.

type: "{type: 'error' | 'warning' | 'success', message?: string}",
description: 'Validation status with an optional message.',
description:
'Validation status with an optional message. With renderTrigger, which renders no field, the message shows in the open panel under the search row (above the list without one) and describes the search input, which an error marks invalid; statusVariant does not apply there.',

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.

Without search the message describes the listbox, not the search input (as FR11 and the changeset say); the zh and dense entries and the status JSDoc carry the same wording.

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 716d779: the English, zh and dense entries and the status JSDoc now say the message describes the search input (which an error marks invalid) or, without search, the list.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fixes: without search, the list now keeps focus as the message comes and goes, and the story icon and docs wording are corrected, so no code change is requested. Approval is waiting on a maintainer decision: component:MultiSelector is a draft whose FR8 says no status renders with renderTrigger, and no current spec says where a status goes in that mode, so a maintainer needs to approve or reject the proposed FR8 amendment, FR11 and DEC-3 (the panel placement, which element the message describes, aria-invalid on the search input, and statusVariant not applying), or point to other governing spec. Once that is settled, nothing else blocks the change.

[Automated review]

vjeux added 4 commits October 21, 2026 08:47
With renderTrigger no Field renders and status was ignored, so a change
the caller refused (a cap, a naming rule, a taken name) had nowhere to be
said. The status message now shows in the open panel through
FieldStatus's detached variant, under the search row or above the list
without one. The search input is described by it and marked invalid for
an error; without search the listbox, which takes focus in this mode, is
described. FieldStatus announces it. FR8 of component:MultiSelector is
amended; proposed FR11 and DEC-3 record the decision.
…the tests prove

FR11, the behavior paragraph, DEC-3, the changeset and a code comment claimed when the message is announced. They now claim what the tests show: FieldStatus renders the message, and an error set while the panel is open reaches the assertive live region, as a field's error does.
…cused list

Without search, the panel swapped between the bare list and a wrapper holding the message, so a message set or cleared while the panel was open replaced the focused listbox and focus fell to the page. With renderTrigger the wrapper now stays for the panel's lifetime. The docs say the message describes the list without search, and the story's icon button shows its glyph.
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 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.
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.
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.
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.
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 one spec decision; no code change is requested. component:MultiSelector is a draft record, and this pull request proposes amending FR8 and adding FR13 and DEC-5. With renderTrigger, a status message would show in the open panel (under the search row, or above the list without search), describe the search input (marked aria-invalid on an error) or the list, and ignore statusVariant. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner; once that is settled, nothing else blocks the change.

[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 — f34cba5b 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant