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 |
There was a problem hiding this comment.
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]
7a61e6b to
780e4ea
Compare
There was a problem hiding this comment.
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
statuswhile the panel is open rebuilds the list element (MultiSelector.tsxlines 2402–2408), so keyboard focus falls to the page body; keep the list at a fixed position and add a test that changesstatuswhile 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 | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
780e4ea to
6471212
Compare
There was a problem hiding this comment.
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
statuswhile the panel is open swaps the list's element (MultiSelector.tsxlines 2436–2443), so keyboard focus falls to the page body and the arrow keys stop working; choosing that wrapper onhasExternalTriggerinstead of on the message keeps the list in place, and a test that sets and clearsstatuswhile a no-search panel is open would cover it.
[Automated review]
| ) : panelStatusNode != null ? ( | ||
| <div> | ||
| {panelStatusNode} | ||
| {renderListWithoutSearch()} | ||
| </div> | ||
| ) : ( | ||
| renderListWithoutSearch() | ||
| ); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
IconButton's icon is a ReactNode, so this renders the word "moreHorizontal" over the square button; icon={<Icon icon="moreHorizontal" />} shows the glyph.
There was a problem hiding this comment.
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.', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]
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.
716d779 to
6580f3a
Compare
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 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]
|
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 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 ignoresstatusand the person never learns why their label wasn't created.Problem and solution fit
With
renderTrigger, astatusmessage 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:MultiSelectoris a draft. This PR amends FR8 ("no Field, status, … renders") and proposes FR13 and DEC-5, pending owner review. No prop is added:statusgains a home where it was ignored.Public delta and caller burden
renderTrigger, astatusmessage now renders in the open panel (statusVariantdoes not apply). The field path is unchanged.Design and alternatives
panelStatusprop. Explicit, but two props for one message, each ignored in one mode.statusin 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.tsxcover placement, the description and invalid state, the announcement, the no-search list, the bottom sheet and the unchanged field path; the first four fail onmain.Writing rubric results
R1 narration: none in FR8, FR13 or DEC-5.
R2 research: none.
R3 evidence: FR13 cites DEC-5,
component:FieldStatusand tests.R4 rejected alternatives: two, one line in DEC-5.
R5 change references: none.
R6 open questions: none.
Scope
Testing
In Storybook, open Core/MultiSelector → Trigger Panel Status; the panel opens on its own.