Skip to content

fix(PowerSearch): name a filter token by its visible text and expose its editor - #9687

Merged
cixzhang merged 6 commits into
mainfrom
fix/powersearch-token-name
Nov 3, 2026
Merged

cixzhang merged 6 commits into
mainfrom
fix/powersearch-token-name

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • the token is named by all its visible text, "Status: is Open";
  • it has aria-haspopup="dialog" and an aria-expanded that is true while its editor is open;
  • the editor is a dialog of the same name;
  • the remove button is "Remove Status: is Open".

Nothing changes visually; the token row's screenshots are pixel-identical to main.

Problem and solution fit

  • Cause: PowerSearch passes "{field}: {operator}" as the token label and renders the value as endContent, outside the token's inner button (Token AR2). The inner button took only aria-labelledby and aria-describedby (Token FR10). The editor popover had role: 'none'.
  • Name: a small internal, non-exported Token context names the inner button by the token's full visible text. The value's text comes from the same function the token renders it with, so the name equals the visible text (WCAG 2.5.3). No ids are involved, because tokenOverflowBehavior's hidden measurement copy would duplicate them.
  • Popup: aria-haspopup="dialog" and aria-expanded follow the editing state. While a built-in token is being edited, the editor popover is a non-modal role="dialog" named by the token's visible text. The add-filter path keeps role: 'none' (focus stays in the field there), and so does editing a components Token override, which names itself. A token whose press commits the filter instead of opening an editor (an empty operator) gets no popup props.
  • Remove name and dialog name: the same context supplies the remove button's name. The remove word still comes from @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 one tokenValueText function. The token renders it, and the names reuse it.
  • Token: aria-haspopup and aria-expanded now reach a clickable token's inner button, beside aria-labelledby and aria-describedby. There's no public API change.

Current specification

Specs ruled #8946 under spec:AST-020 FR1 (WCAG 2.5.3 Label in Name, 4.1.2 Name, Role, Value):

  • PowerSearch FR24 (new): "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."
  • Token FR10 lists aria-haspopup and aria-expanded among the props that reach the inner button.
  • Token AR2 adds: "Inside 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."

Writing rubric results

  • R1 narration: none; both records state present behavior.
  • R2 research: none.
  • R3 evidence: the FR24 verification row names the test and the browser check only.
  • R4 rejected alternatives: none.
  • R5 change references: none.
  • R6 open questions: none.

Evidence

  • Red-first: 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 a components Token override, no popup props on an empty-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 on main; the read-only guard passes on both.
  • Updated tests: three PowerSearch tests that found a token by its old name ("Status: is", "Remove Status: is") use the new names.
  • Suites: PowerSearch, Token and Tokenizer, 516 passed (after merging main). tsc, strict lint and check:knowledge are clean.
  • Real Chrome (Accessibility.getFullAXTree):
Story main token / remove This branch token / remove Editor open (this branch)
Preset filters "Status: is" / "Remove Status: is", no popup "Status: is Open" (haspopup dialog, expanded false) / "Remove Status: is Open" dialog "Status: is Open"; token expanded true
Numeric filters "Line count: is greater than" "Line count: is greater than 100" / "Remove Line count: is greater than 100" dialog "Line count: is greater than 100"
  • Visual: screenshots of the preset, numeric and entity filter stories are byte-identical to main.

Scope

  • One change: popover filter tokens are named by their visible text and expose their editor.
  • Records: PowerSearch FR24 and its verification row, and Token FR10 and AR2.
  • Public text contains no internal context.

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

vercel Bot commented Nov 3, 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 Nov 3, 2026 9:20am UTC

Request Review

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

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 3, 2026, 9:32 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 3, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ab76922

Storybook · Sandbox · built from this PR's head

Modified components

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

@cixzhang

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec e39189b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 3, 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.

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].Token override still has no value in its name and no aria-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 tokenOverflowBehavior set, OverflowList renders each token twice (a hidden measurement copy first), so the new -label/-value ids are duplicated and the visible token's aria-labelledby resolves 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.tsx now 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. |

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.

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)

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.

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,

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.

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.

Comment on lines +533 to +535
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +859 to +860
// A token that opens its editor is named by all its visible text
// (field, operator and value) and says that it opens a dialog.

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.

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

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec ecd7a0c

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 3, 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.

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.

  • main now defines PowerSearch FR22 (read-only fields keep their filters) and FR23, so this pull request's FR22 row and verification row conflict with main; rebase, renumber the new requirement to FR24, and add it to the "FR1–FR9, FR22, and FR23 govern the popover presentation" sentence.
  • An empty-operator token (for example "Unread only:" in the Boolean / Empty Filters story) gets aria-haspopup="dialog" and aria-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 Token with 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. |

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.

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

Comment on lines +869 to +877
const editorProps =
handleClick != null
? {
'aria-haspopup': 'dialog' as const,
'aria-expanded':
popoverState.type === 'editing' &&
popoverState.filterIndex === filterIndex,
}
: 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.

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.

Comment on lines +185 to +188
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.

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.

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.

Comment on lines +527 to +529
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +867 to +868
// A token that opens its editor says that it opens a dialog, and the
// naming context names it by all its visible text.

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.

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

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 65d3e08

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 3, 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.

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, but editedBuiltInFilter is set only when the operator resolves, so the editor stays role: 'none' with no name; treat the edited filter as built-in unless a Token override renders it, and add that case to PowerSearchTokenNaming.test.tsx.

Two non-blocking comment suggestions are inline. A new commit needs a fresh /approve-spec on its head.

[Automated review]

Comment on lines +579 to +583
const editedBuiltInFilter =
editedOperator != null &&
componentOverrides?.[editedOperator.value.type]?.Token == null
? editedFilter
: undefined;

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.

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.

Comment on lines +544 to +546
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +901 to +902
// A token that opens its editor says that it opens a dialog, and the
// naming context names it by all its visible text.

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.

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

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 9710250

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

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 main kept this branch's older copy of the FR10–FR21 verification row, so PowerSearch.spec.md:489 lists "Clear all skips a read-only filter" as a failure again, which contradicts FR23 and DEC-4; take main'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` |

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.

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.

Comment on lines +544 to +546
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +901 to +902
// A token that opens its editor says that it opens a dialog, and the
// naming context names it by all its visible text.

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.

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

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec e614f44

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

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 caller aria-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]

Comment on lines +186 to +188
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.

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

Comment on lines +544 to +546
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +901 to +902
// A token that opens its editor says that it opens a dialog, and the
// naming context names it by all its visible text.

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.

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

cixzhang commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec ab76922

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 3, 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.

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 PowerSearchToken still 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]

Comment on lines +186 to +187
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

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.

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.

Comment on lines +544 to +546
// 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.

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.

Non-blocking: this repeats tokenValueText's JSDoc ("…named by the same text"). Delete it.

Comment on lines +901 to +902
// A token that opens its editor says that it opens a dialog, and the
// naming context names it by all its visible text.

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.

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

@cixzhang
cixzhang marked this pull request as ready for review November 3, 2026 09:35
@cixzhang
cixzhang merged commit e68774f into main Nov 3, 2026
107 checks passed
@github-actions
github-actions Bot deleted the fix/powersearch-token-name branch November 4, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — ab76922d Deployed Nov 3, 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.

[Bug] PowerSearch: a filter token's button leaves its value out of its name and does not expose the editor it opens

1 participant