Repository navigation
fix(PowerSearch): name a filter token by its visible text and expose its editor - #9687
Conversation
…its editor Fixes #8946. In the popover presentation a filter token's button was named "Status: is" (its value renders as endContent, outside the inner button) and carried no popup state. Per the Specs ruling: - the token's action is named by all its visible text through aria-labelledby (its label text and its rendered value), so the name holds the exact visible text (WCAG 2.5.3); - it has aria-haspopup="dialog" and aria-expanded while its editor is open, and the editor popover is a non-modal dialog named by that text; - its remove button is "Remove Status: is Open" through an internal, non-exported Token context that also places an id on the label text; the remove word still comes from the catalog, so locales keep word order; - Token FR10: aria-haspopup and aria-expanded reach a clickable token's inner button, beside aria-labelledby and aria-describedby. PowerSearch gains FR22 and its verification row.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch · Storybook | 184.8 kB (+294 B) · 20.6 kB CSS (0) | 3,978 (−28) | ✓ · ✓ · ✓ |
| Typeahead | 63.0 kB (+95 B) · 11.8 kB CSS (0) | — | — · — · — |
| Token · Storybook | 25.2 kB (+84 B) · 4.8 kB CSS (0) | 561 (+17) | ✓ · ✓ · — |
4 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/MobileTokenizer | 101.2 kB (+83 B) · 880 B CSS (0) | — | — · — · — |
| Tokenizer | 70.3 kB (+78 B) · 17.1 kB CSS (0) | — | — · — · — |
| lab/MobilePowerSearch | 214.0 kB (+77 B) · 1.2 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 70.8 kB (+70 B) · 2.1 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 6.09 MB packed (+1.8 kB); no new dependencies.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
|
/approve-spec e39189b |
There was a problem hiding this comment.
Requesting changes. The FR22 and Token FR10 spec text is approved for this head, and the built-in token now reads as it looks, with popup state and a named editor dialog; three issues remain.
- FR22 and the changeset promise every popover filter token, but a
components[type].Tokenoverride still has no value in its name and noaria-haspopup/aria-expanded, and its editor dialog takes the built-in token text, so narrow FR22 and the changeset to the built-in token or cover overrides. - With
tokenOverflowBehaviorset,OverflowListrenders each token twice (a hidden measurement copy first), so the new-label/-valueids are duplicated and the visible token'saria-labelledbyresolves into the hidden copy;aria-label={text.full}gives the same name without ids. - Token AR2 still says the remove button is named "Remove {label}", while
Token.tsxnow fills that name from the internal naming context, so amend AR2 alongside FR10.
Changing the spec text needs a fresh /approve-spec on the new head. Two comments in PowerSearch.tsx repeat or narrate the code; those notes are non-blocking.
[Automated review]
| | FR19 | The result count renders at the end of the field in both presentations and is announced only when it changes after mount; the first render announces nothing, including under StrictMode's effect replay. The announcement takes the route `spec:AST-086/FR14` names for where the field is at that moment: inside the open sheet's dialog while a sheet of the flow is open (AR6), otherwise inside the nearest open native modal that holds the field (a Dialog, a modal Drawer), and the shared polite channel only when no modal does — never a channel the record names itself. | Current popover behavior; `architecture:react-component-runtime/INV3` | Current contract. Implementation gap: the shipped guard announces the initial count under StrictMode. | | ||
| | FR20 | Every string the sheets introduce comes from the `@astryx.powersearch.*` catalog, reusing the existing editor keys where their meaning fits (Cancel, Apply, Operator, Value, Values, Entities, the placeholders, the result count). Content the popover presentation already renders keeps its source — field, operator, and value text from the config and its formatters — except that every label the sheets render for a generated choice comes from the catalog as one ICU message with a plural: the relative-date choice rows (`@astryx.powersearch.sheet.relative{Days,Weeks,Months}{Ago,FromNow}`, the same choices and, in English, the same words as the popover's editor lists) and the value summaries of FR12. | DEC-3; catalog contract | Current contract. Implementation gap: no sheet strings exist. | | ||
| | FR21 | A `string_list` or `entity_list` value inside the value step opens the Tokenizer's sheet above the value step. Escape and swipe dismiss only that topmost sheet; closing it returns focus to its trigger inside the value step; the value step keeps its staged state. | DEC-3; `family:overlay-dismissal`; `component:Tokenizer/FR18` | Current contract. Implementation gap: no nested sheet exists. | | ||
| | FR22 | In the popover presentation, a filter token that opens its editor is named by its visible text (field, operator and value); `aria-haspopup="dialog"`, `aria-expanded` is true while its editor is open, and the editor is a dialog named by the token's visible text. Its remove button is named by the remove word and the same visible text. | `spec:AST-020` FR1; WCAG 2.5.3 and 4.1.2; `component:Token/FR10` | Current contract. | |
There was a problem hiding this comment.
FR22 covers every popover filter token that opens its editor, but a components[type].Token override still gets no value in its name, no aria-haspopup/aria-expanded, and an editor dialog named by the built-in token text (Status: is Open while the override shows open). Narrow this row and the changeset to PowerSearch's built-in token and say what an override-opened editor is named, or cover overrides.
| const editorProps = | ||
| handleClick != null | ||
| ? { | ||
| 'aria-labelledby': isRenderable(valueContent) |
There was a problem hiding this comment.
With tokenOverflowBehavior set, OverflowList renders this token twice, a hidden aria-hidden measurement copy first, so labelId/valueId are duplicated and this aria-labelledby resolves into the hidden copy. aria-label={text.full} gives the same name without ids, and the label/value ids and the display: contents wrapper can go.
| type="button" | ||
| aria-label={t('@astryx.token.remove', {label})} | ||
| aria-label={t('@astryx.token.remove', { | ||
| label: naming?.removeName ?? label, |
There was a problem hiding this comment.
Token AR2 still says the remove button is named by the translated "Remove {label}" string; with this context a Token labelled Status: is reads Remove Status: is Open. Amend AR2 in this PR, as FR10 was.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor is named by all its visible text | ||
| // (field, operator and value) and says that it opens a dialog. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the reason, for example: "The value renders outside the inner button. The name references it by id."
…ext; scope FR22 CodeBunny on #9687: - the built-in token's inner button takes its name from the internal naming context (its full visible text) instead of aria-labelledby ids, which OverflowList's hidden measurement copy duplicated; - FR22 and the changeset cover the built-in token; a components Token override names itself, and its editor keeps the plain popover; - Token AR2 states the naming of a token whose visible text runs past its label.
|
/approve-spec ecd7a0c |
There was a problem hiding this comment.
Requesting changes. The PowerSearch FR22, Token FR10 and Token AR2 text is approved for this head, and built-in filter tokens now read as they look, with popup state and a named editor dialog; three issues remain.
mainnow defines PowerSearch FR22 (read-only fields keep their filters) and FR23, so this pull request's FR22 row and verification row conflict withmain; rebase, renumber the new requirement to FR24, and add it to the "FR1–FR9, FR22, and FR23 govern thepopoverpresentation" sentence.- An
empty-operator token (for example "Unread only:" in the Boolean / Empty Filters story) getsaria-haspopup="dialog"andaria-expanded, but pressing it commits the filter and opens no editor, so set the popup props only when the press opens the editor and add a test for that case. - Token AR2's new sentence says any token whose visible text runs past its Label is named by that text, but only PowerSearch's internal naming context does this (a public clickable
Tokenwith End content is still named by its Label), so scope the sentence to the names PowerSearch supplies.
The spec edits need a fresh /approve-spec <full head SHA> on the new head from an engineering owner, which the author can record. Two comments in PowerSearch.tsx repeat or narrate the code; those notes are non-blocking.
[Automated review]
| | FR19 | The result count renders at the end of the field in both presentations and is announced only when it changes after mount; the first render announces nothing, including under StrictMode's effect replay. The announcement takes the route `spec:AST-086/FR14` names for where the field is at that moment: inside the open sheet's dialog while a sheet of the flow is open (AR6), otherwise inside the nearest open native modal that holds the field (a Dialog, a modal Drawer), and the shared polite channel only when no modal does — never a channel the record names itself. | Current popover behavior; `architecture:react-component-runtime/INV3` | Current contract. Implementation gap: the shipped guard announces the initial count under StrictMode. | | ||
| | FR20 | Every string the sheets introduce comes from the `@astryx.powersearch.*` catalog, reusing the existing editor keys where their meaning fits (Cancel, Apply, Operator, Value, Values, Entities, the placeholders, the result count). Content the popover presentation already renders keeps its source — field, operator, and value text from the config and its formatters — except that every label the sheets render for a generated choice comes from the catalog as one ICU message with a plural: the relative-date choice rows (`@astryx.powersearch.sheet.relative{Days,Weeks,Months}{Ago,FromNow}`, the same choices and, in English, the same words as the popover's editor lists) and the value summaries of FR12. | DEC-3; catalog contract | Current contract. Implementation gap: no sheet strings exist. | | ||
| | FR21 | A `string_list` or `entity_list` value inside the value step opens the Tokenizer's sheet above the value step. Escape and swipe dismiss only that topmost sheet; closing it returns focus to its trigger inside the value step; the value step keeps its staged state. | DEC-3; `family:overlay-dismissal`; `component:Tokenizer/FR18` | Current contract. Implementation gap: no nested sheet exists. | | ||
| | FR22 | In the popover presentation, a built-in filter token (no `components` Token override) that opens its editor is named by its visible text (field, operator and value); `aria-haspopup="dialog"`, `aria-expanded` is true while its editor is open, and the editor is a dialog named by the token's visible text. Its remove button is named by the remove word and the same visible text. | `spec:AST-020` FR1; WCAG 2.5.3 and 4.1.2; `component:Token/FR10` | Current contract. | |
There was a problem hiding this comment.
main already defines PowerSearch FR22 (a read-only field removes no filter) and FR23 (Clear all keeps read-only filters), and lists both in the popover scope sentence. This row and its verification row conflict with main. Rebase, renumber this requirement to FR24 (row and verification row), and add FR24 to "FR1–FR9, FR22, and FR23 govern the popover presentation".
| const editorProps = | ||
| handleClick != null | ||
| ? { | ||
| 'aria-haspopup': 'dialog' as const, | ||
| 'aria-expanded': | ||
| popoverState.type === 'editing' && | ||
| popoverState.filterIndex === filterIndex, | ||
| } | ||
| : null; |
There was a problem hiding this comment.
For an empty operator without a components.empty.Editor, handleTokenClick commits the filter and opens no editor, but this still gives the token aria-haspopup="dialog" and aria-expanded. In the Boolean / Empty Filters story, "Unread only:" reads "has popup dialog, collapsed" and stays collapsed after a press. Set these props only when the press opens the editor (the same check handleTokenClick makes), and add that case to PowerSearchTokenNaming.test.tsx.
| Remove button is named by the translated "Remove {label}" string. A token | ||
| whose visible text runs past its Label, as a PowerSearch filter token's value | ||
| does, names its inner button by that full text, and its Remove button by the | ||
| same translated string over that text. |
There was a problem hiding this comment.
As written, this applies to any token with End content, but Token names by the full text only when PowerSearch's internal naming context supplies it. A public <Token label="Status: is" endContent={<span>Open</span>} onClick onRemove> is still "Status: is" / "Remove Status: is". Scope the sentence to the names PowerSearch supplies through Token's internal naming context.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor says that it opens a dialog, and the | ||
| // naming context names it by all its visible text. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the constraint, for example: "Only a token whose press opens the editor says it has a popup."
…empty-operator tokens offer no editor CodeBunny on #9687: - main now owns PowerSearch FR22 and FR23, so the token-naming requirement and its verification row are FR24, and the popover sentence lists FR22-FR24; - a token whose press commits the filter (an empty operator with no empty Editor override) gets no aria-haspopup or aria-expanded; one helper decides this for the press and for the props; - Token AR2 scopes the full-text naming to PowerSearch's filter tokens.
|
/approve-spec 65d3e08 |
There was a problem hiding this comment.
Requesting changes. The PowerSearch FR24 and Token FR10 and AR2 text is approved for this head, built-in filter tokens now read as they look, with popup state and a named editor dialog, and the three issues from the previous round are fixed. One issue remains:
- A built-in token whose filter uses an operator the config no longer has (the Custom Components Map story's "Status:" token) gets
aria-haspopup="dialog"and opens the editor, buteditedBuiltInFilteris set only when the operator resolves, so the editor staysrole: 'none'with no name; treat the edited filter as built-in unless a Token override renders it, and add that case toPowerSearchTokenNaming.test.tsx.
Two non-blocking comment suggestions are inline. A new commit needs a fresh /approve-spec on its head.
[Automated review]
| const editedBuiltInFilter = | ||
| editedOperator != null && | ||
| componentOverrides?.[editedOperator.value.type]?.Token == null | ||
| ? editedFilter | ||
| : undefined; |
There was a problem hiding this comment.
When the edited filter's operator no longer resolves, this leaves editedBuiltInFilter undefined. renderToken still draws that token built-in with aria-haspopup="dialog", and its press opens the editor, so the editor stays role: 'none' with no name (the Custom Components Map story's "Status:" token shows it). FR24 asks for a dialog named by the token's text. Suggest treating it as built-in unless a Token override renders it:
const editedBuiltInFilter =
editedFilter != null &&
(editedOperator == null ||
componentOverrides?.[editedOperator.value.type]?.Token == null)
? editedFilter
: undefined;plus a stale-operator case in PowerSearchTokenNaming.test.tsx.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor says that it opens a dialog, and the | ||
| // naming context names it by all its visible text. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the constraint, for example: "Only a token whose press opens the editor says it has a popup."
…amed dialog CodeBunny on #9687: such a token renders built-in and says aria-haspopup="dialog", but its editor took no dialog role. A missing operator now counts as built-in for the editor's role and name.
|
/approve-spec 9710250 |
There was a problem hiding this comment.
Requesting changes: the PowerSearch FR24 and Token FR10 and AR2 text is approved for this head, and the previous round's issue is fixed (a built-in token whose operator the config no longer has now opens a dialog named by its text, with a test), but one issue remains:
- The merge from
mainkept this branch's older copy of the FR10–FR21 verification row, soPowerSearch.spec.md:489lists "Clear all skips a read-only filter" as a failure again, which contradicts FR23 and DEC-4; takemain's wording, "Clear all drops a read-only filter".
Two non-blocking comment suggestions are inline. A new commit needs a fresh /approve-spec <full head SHA> from an engineering owner, which the author can record.
[Automated review]
| | FR23 | PowerSearch and Tokenizer unit tests | Clear all with a read-only filter before two editable ones; every filter read-only; Backspace with a read-only last filter; the words with and without a read-only filter left | A read-only filter is removed, Clear all reports an index other than the first removed one, Clear all shows with no editable filter, or its words say every filter went while one remains. | `audit:PowerSearch/interaction` | | ||
| | FR10–FR21, AR4–AR6, PR5 | Focused PowerSearch sheet tests with the compact-touch query stubbed both ways, plus real-engine touch evidence (implementation gap: not yet in the tree) | default popover, forced sheet, adaptive both ways (server markup and hydration as the popover field on a coarse-pointer client, then the trigger, no recoverable error, focus on the body; with `hasAutoFocus`, the autofocused input's focus ending on the trigger with no `onBlur` or `onFocus` to the caller), trigger name, Filters/Add filter/value steps, each value type, list value through the Tokenizer sheet, Clear all, read-only, disabled while open, focus after each step, focus after an `adaptive` switch from the trigger, the input, a removed control, an open editor popover, and from outside the field, a field inside an open Dialog announcing the count, Clear all, and in-sheet messages inside that Dialog and never on the page body, StrictMode result count, in-sheet live region while a sheet is open (added, removed, count, empty results), Clear all announced only after the dialog's exit, row, token and Removed text equal to the popover token's value text (UTC, Tokyo, Honolulu, unset), summaries and relative-date labels and values from the catalog, the row and Removed through one reorderable message, an unmatched relative-date value as stored, a filter the config no longer knows listed and removable, a cleared number unstaged, choice rows as radios and checkboxes with `aria-checked`, a stale read-only filter as a plain row, a removal next to a nested row focusing that row, a nested filter removed from its step, a list value joined by the locale's narrow conjunction list in English, Simplified Chinese, Japanese, and German, an empty-result message spoken once per query from its rendered element, a controlled update that removes the edited field moving focus from the replaced body to Remove and announcing the unavailable state in the sheet, Apply and Cancel after a controlled update removed the edited filter focusing the nearest row, else Add filter, a stale filter's step titled as its row reads (raw keys for what is gone, the field's label when the field remains), Cancel from creation after the opening field was removed focusing the Add filter sheet's first control, a removed focused Filters row, a removed Clear all, and a dropped focused field row each handing focus to the nearest remaining row or the sheet's first control, element counts at rest and with each of the Filters, Add filter and value sheets open, and with the Tokenizer's list-value sheet stacked above the value step, under fine and coarse pointers, nothing of the flow in the DOM at rest before a press and after the exit, a nested filter edited and created through the built-in nested editor (its sub-filter rows wrapping inside a 390 and a 414 px sheet; its root operator picker absent on a mixed field, the Operator group in its place), a nested-only field and its suggestion offered, a suggestion's operator checked over the field's default, the Operator group outside a caller's Editor override on a mixed field, a count changed during the exit spoken with Clear all's message as one catalog message after the close, a radio group's arrow keys, Home, and End moving and checking, Space and Enter checking a focused radio row and toggling a checkbox row, right-to-left layout with the row chevrons and Back glyph mirrored (`design:bidirectionality/DR4`) | A field without `experimental` changes beyond what FR19 states, a value commits before the step confirms, Clear all drops a read-only filter, the trigger carries native `disabled`, focus lands elsewhere, an announcement reaches a channel outside the modal that holds the field at that moment, or the popover bundle carries the sheets. | `audit:PowerSearch/sheet` | | ||
| | FR24 | `PowerSearchTokenNaming.test.tsx`; real-Chromium accessibility tree of a popover token | Popover token with a value, read-only token, editor open and closed, a verb-last remove word | A token named without its value, a missing or stale `aria-expanded`, an unnamed or non-dialog editor, or a remove name that loses its locale's word order fails. | `audit:PowerSearch/accessibility` | | ||
| | FR10–FR21, AR4–AR6, PR5 | Focused PowerSearch sheet tests with the compact-touch query stubbed both ways, plus real-engine touch evidence (implementation gap: not yet in the tree) | default popover, forced sheet, adaptive both ways (server markup and hydration as the popover field on a coarse-pointer client, then the trigger, no recoverable error, focus on the body; with `hasAutoFocus`, the autofocused input's focus ending on the trigger with no `onBlur` or `onFocus` to the caller), trigger name, Filters/Add filter/value steps, each value type, list value through the Tokenizer sheet, Clear all, read-only, disabled while open, focus after each step, focus after an `adaptive` switch from the trigger, the input, a removed control, an open editor popover, and from outside the field, a field inside an open Dialog announcing the count, Clear all, and in-sheet messages inside that Dialog and never on the page body, StrictMode result count, in-sheet live region while a sheet is open (added, removed, count, empty results), Clear all announced only after the dialog's exit, row, token and Removed text equal to the popover token's value text (UTC, Tokyo, Honolulu, unset), summaries and relative-date labels and values from the catalog, the row and Removed through one reorderable message, an unmatched relative-date value as stored, a filter the config no longer knows listed and removable, a cleared number unstaged, choice rows as radios and checkboxes with `aria-checked`, a stale read-only filter as a plain row, a removal next to a nested row focusing that row, a nested filter removed from its step, a list value joined by the locale's narrow conjunction list in English, Simplified Chinese, Japanese, and German, an empty-result message spoken once per query from its rendered element, a controlled update that removes the edited field moving focus from the replaced body to Remove and announcing the unavailable state in the sheet, Apply and Cancel after a controlled update removed the edited filter focusing the nearest row, else Add filter, a stale filter's step titled as its row reads (raw keys for what is gone, the field's label when the field remains), Cancel from creation after the opening field was removed focusing the Add filter sheet's first control, a removed focused Filters row, a removed Clear all, and a dropped focused field row each handing focus to the nearest remaining row or the sheet's first control, element counts at rest and with each of the Filters, Add filter and value sheets open, and with the Tokenizer's list-value sheet stacked above the value step, under fine and coarse pointers, nothing of the flow in the DOM at rest before a press and after the exit, a nested filter edited and created through the built-in nested editor (its sub-filter rows wrapping inside a 390 and a 414 px sheet; its root operator picker absent on a mixed field, the Operator group in its place), a nested-only field and its suggestion offered, a suggestion's operator checked over the field's default, the Operator group outside a caller's Editor override on a mixed field, a count changed during the exit spoken with Clear all's message as one catalog message after the close, a radio group's arrow keys, Home, and End moving and checking, Space and Enter checking a focused radio row and toggling a checkbox row, right-to-left layout with the row chevrons and Back glyph mirrored (`design:bidirectionality/DR4`) | A field without `experimental` changes beyond what FR19 states, a value commits before the step confirms, Clear all skips a read-only filter, the trigger carries native `disabled`, focus lands elsewhere, an announcement reaches a channel outside the modal that holds the field at that moment, or the popover bundle carries the sheets. | `audit:PowerSearch/sheet` | |
There was a problem hiding this comment.
The merge from main kept this branch's older copy of this row. main changed "Clear all skips a read-only filter" to "Clear all drops a read-only filter" when it decided DEC-4 ("a Clear all that removes a read-only filter is a defect"), so this row now scores the behaviour FR23 requires as a failure. Take main's wording for this row.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor says that it opens a dialog, and the | ||
| // naming context names it by all its visible text. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the constraint, for example: "Only a token whose press opens the editor says it has a popup."
…-name # Conflicts: # docs/specs/components/PowerSearch/PowerSearch.spec.md
|
/approve-spec e614f44 |
There was a problem hiding this comment.
Requesting changes for one record line; the code, tests and the rest of the spec text check out.
docs/specs/components/Token/Token.spec.md:148: the Clickable representative state still requires the inner button to be "named by the label, or by a calleraria-labelledby", which contradicts the amended AR2 and PowerSearch FR24 now that a PowerSearch filter token is named by its full visible text; add that case to the row and point the Removable row at AR2 the same way.
In Chromium's accessibility tree the head shows "Status: is Open" with aria-haspopup="dialog", aria-expanded turning true while the editor is open, a non-modal dialog of the same name, and "Remove Status: is Open", and the token row looks exactly as it does on main. Two optional comment tidy-ups are inline. A new commit needs a fresh /approve-spec on its head.
[Automated review]
| PowerSearch, whose filter tokens show their value after the Label, a filter | ||
| token's inner button is named by its full visible text, and its Remove button | ||
| by the same translated string over that text. |
There was a problem hiding this comment.
This makes a PowerSearch filter token's name an exception, but the Clickable representative state at line 148 still requires "One inner button named by the label, or by a caller aria-labelledby", so the record now gives two names for one state. Add the PowerSearch case to that row, for example "…, or, inside PowerSearch, by the token's full visible text (AR2)", and point the Removable row (line 151) at AR2 the same way.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor says that it opens a dialog, and the | ||
| // naming context names it by all its visible text. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the constraint, for example: "Only a token whose press opens the editor says it has a popup."
CodeBunny on #9687: the Clickable and Removable rows still said label-only, against AR2.
|
/approve-spec ab76922 |
There was a problem hiding this comment.
Recommending approval. Built-in popover filter tokens now read as they look ("Status: is Open"), report their dialog popup and whether it is open, and open a non-modal editor dialog of the same name, while the token row looks exactly as it does on main.
Optional tidy-ups:
- Token AR2 and its Clickable and Removable rows say a filter token "inside PowerSearch" gets the full-text name, but FR24 and the code limit that to built-in tokens (an override built on
PowerSearchTokenstill reads "Status: is"), so adding "built-in" keeps the two records aligned. - Two comment tidy-ups are inline.
A new commit needs a fresh /approve-spec on its head.
[Automated review]
| PowerSearch, whose filter tokens show their value after the Label, a filter | ||
| token's inner button is named by its full visible text, and its Remove button |
There was a problem hiding this comment.
Non-blocking: PowerSearch FR24 and the code give the full-text name only to a built-in token (no components Token override). An override built on the exported PowerSearchToken still reads "Status: is" and "Remove Status: is". Consider "a built-in filter token's inner button" here, and the same qualifier in the Clickable and Removable rows.
| // A default filter token's visible text: its label (field and operator) | ||
| // and its value. The token's remove button and editor dialog are named by | ||
| // the same text. |
There was a problem hiding this comment.
Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.
| // A token that opens its editor says that it opens a dialog, and the | ||
| // naming context names it by all its visible text. |
There was a problem hiding this comment.
Non-blocking: this narrates the props below. Keep only the constraint, for example: "Only a token whose press opens the editor says it has a popup."
Fixes #8946 (#8946).
User impact
In the default (popover) presentation, a built-in PowerSearch filter token that shows "Status: is Open" was a button named "Status: is", and its remove button was "Remove Status: is". Screen-reader and voice-control users heard two filters on one field (or a filter whose value changed) as the same thing, and the visible value wasn't in the name. Pressing the token opened an editor and moved focus into it, but the button gave no sign that it opens anything. Now:
aria-haspopup="dialog"and anaria-expandedthat is true while its editor is open;Nothing changes visually; the token row's screenshots are pixel-identical to
main.Problem and solution fit
labeland renders the value asendContent, outside the token's inner button (Token AR2). The inner button took onlyaria-labelledbyandaria-describedby(Token FR10). The editor popover hadrole: 'none'.tokenOverflowBehavior's hidden measurement copy would duplicate them.aria-haspopup="dialog"andaria-expandedfollow the editing state. While a built-in token is being edited, the editor popover is a non-modalrole="dialog"named by the token's visible text. The add-filter path keepsrole: 'none'(focus stays in the field there), and so does editing acomponentsToken override, which names itself. A token whose press commits the filter instead of opening an editor (anemptyoperator) gets no popup props.@astryx.token.remove, so verb-last locales keep their order. To keep these strings equal to what the token shows, the value's visible text moves into onetokenValueTextfunction. The token renders it, and the names reuse it.aria-haspopupandaria-expandednow reach a clickable token's inner button, besidearia-labelledbyandaria-describedby. There's no public API change.Current specification
Specs ruled #8946 under
spec:AST-020FR1 (WCAG 2.5.3 Label in Name, 4.1.2 Name, Role, Value):componentsToken override) that opens its editor is named by its visible text (field, operator and value);aria-haspopup="dialog",aria-expandedis true while its editor is open, and the editor is a dialog named by the token's visible text. Its remove button is named by the remove word and the same visible text."aria-haspopupandaria-expandedamong the props that reach the inner button.Writing rubric results
Evidence
PowerSearchTokenNaming.test.tsx(8 cases: name, popup state and dialog, the remove and dialog names matching a unit-suffixed number's visible "100", a verb-last remove word, no popup on a read-only token, the plain popover for acomponentsToken override, no popup props on anempty-operator token, and the named dialog for a token whose operator the config lacks) plus Token's "passes aria-haspopup and aria-expanded to the inner button". The naming, popup and routing cases fail onmain; the read-only guard passes on both.tsc, strict lint andcheck:knowledgeare clean.Accessibility.getFullAXTree):maintoken / removemain.Scope