Repository navigation
[Component Audit] PowerSearch: docs describe each prop once and correctly, and name the field's parts - #13094
Conversation
…rMenuItems once and correctly, and list every prop and part The English prop table listed menuWidth and maxOperatorMenuItems twice, the second entries contradicting the first and the component. The docs now list each once, add the components prop, add tokenOverflowBehavior, onFocus and onBlur to the Chinese table, and name the field's parts. A doc test fails when a prop table lists a prop twice. A browser audit spec checks the field, its tokens and editor, read-only, disabled and the sheet trigger.
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch · Storybook | 316.9 kB (0) · 27.1 kB CSS (0) | 7,220 (0) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.86 MB packed (+1.9 kB); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Accessibility: 1 violation(s)
Accessibility Audit
Status: 1 accessibility violation(s) found — 1 serious.
PowerSearch - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 2/37 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Generated by PR Enrichment workflow | View full report
…when a remove button shows; audit spec measures every token
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Changes requested. The prop-table fixes check out, but the new Anatomy text and one line of the description need a correction first.
- The Anatomy table in all three doc variants says every typeahead row opens the editor, the editor is always a dialog named by the filter text, and the sheet trigger always opens the Filters sheet, but value and content-search rows add the filter at once, the editor has no dialog role while adding a filter, and an editable field with no filters opens Add filter directly (
PowerSearch.doc.mjslines 289, 295 and 313, and the matching Chinese and dense entries). - The description says #12959 edits different lines of
PowerSearch.doc.mjs, but both pull requests change the same threestartIcondescriptions, so whichever lands second will conflict there.
The inline comments suggest wording for each part. CI has not run on this draft yet.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the prop tables list
menuWidthandmaxOperatorMenuItemsonce, each with what it does. Verified: one entry each inPowerSearch.doc.mjs, and the new doc test fails on the base docs naming exactly those two and passes at the head. - Claim:
menuWidthsizes the main field menu and never shrinks below the input. Verified: the menu takesmenuWidthas its width with the anchor's width as its minimum (BaseTypeahead.tsx414-422). - Claim:
maxOperatorMenuItemscaps the string and entity value suggestions. Verified (PowerSearch.tsx1355 and 1688). - Claim: the docs list
components, the Chinese docs addtokenOverflowBehavior,onFocusandonBlur, and all three variants name the field's parts. Verified, but three of the parts' descriptions are wrong (first finding). - Claim: the
menuWidthJSDoc now says the same as the docs. Verified. - Claim: no runtime behavior changes. Verified: the built public surface of Core and the themes is identical, and the only source edit is a JSDoc comment.
- Claim: PowerSearch was the only component with a repeated prop entry. Verified on the base docs.
- Claim: the known-drift line is removed and the CLI prop-doc check passes. Verified by running it.
- Claim: the audit spec covers rest, editor, read-only, disabled, sheet and 320 px cases in light and dark, both directions and a second theme, with 78 receipts and 124 frames. Verified by reading. It was not run here, and CI has not run.
- Claim: the overlaps with other open pull requests merge cleanly or need a one-line rebase. False for #12959 (second finding). True for the other five listed, and the do-not-merge release check was not compared.
- Claim: the audit scores and the Needs Review items describe code this pull request does not change. Not judged; the add-path editor's role observation matches the source.
- File
.changeset/power-search-audit-docs.md: clear. - File
packages/cli/test/core-prop-docs.known-drift.json: clear. - File
packages/core/src/PowerSearch/PowerSearch.doc.mjs: first finding. - File
packages/core/src/PowerSearch/PowerSearch.tsx: clear. - File
packages/core/src/PowerSearch/__tests__/PowerSearchAudit.a11y.chromium.spec.ts: clear; one comment does not match its check (inline). - File
packages/core/src/docPropReferences.test.ts: clear.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this draft head yet, and it runs once the pull request leaves draft.
Both earlier findings are fixed: the Anatomy rows in all three doc variants now match the source and the PowerSearch record, and the startIcon lines are back to their base text, so #12959 merges cleanly. One optional wording suggestion is inline.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: the prop tables list
menuWidthandmaxOperatorMenuItemsonce each, with what they do. Verified: one entry each, and the new doc test fails on the base docs naming exactly those two and passes at the head. - Claim:
menuWidthsizes only the main field menu and never shrinks below the input. Verified (BaseTypeahead.tsx412-421,PowerSearch.tsx1716). - Claim:
maxOperatorMenuItemscaps the string and entity value suggestions. Verified (PowerSearch.tsx1355 and 1688). - Claim: the
menuWidthJSDoc now says the same as the docs. Verified (PowerSearch.tsx399-402). - Claim: the docs list
components, the Chinese docs addtokenOverflowBehavior,onFocusandonBlur, and all three variants name the field's parts. Verified, and each part's description matches the source. - Claim: no runtime behavior changes. Verified: the only source edit is a JSDoc comment, and the audit spec's frames are byte-identical on base and head.
- Claim: a doc test now fails when a prop table lists a prop twice, and PowerSearch was the only one. Verified on the base docs.
- Claim: the known-drift line is removed and the CLI prop-doc check passes. Verified by running it.
- Claim: the named unit and doc suites pass. Verified: 488 tests pass at the head.
- Claim: the audit spec checks rest, editor, read-only, disabled, sheet and narrow cases in both modes and directions and a second theme, and all 78 receipts with 124 frames pass at the head. Verified by running it against a Storybook built from the head.
- Claim: the same spec passes on the base with byte-identical frames. Verified.
- Claim: the listed overlapping pull requests merge cleanly or need a one-line rebase, and #12959 edits different lines. Verified: #12959, #12337 and the release check merge cleanly; #11868 and #11205 already conflict with the base branch on their own; #12891 and #11246 conflict only outside these files.
- Claim: the changeset describes the prop entries,
components, the Chinese props and the parts. Verified against the docs. - Claim: the audit scores, findings table and Needs Review items. Not judged; the add-path editor role and the Escape focus observations match the source and the audit run.
- File
.changeset/power-search-audit-docs.md: clear. - File
packages/cli/test/core-prop-docs.known-drift.json: clear. - File
packages/core/src/PowerSearch/PowerSearch.doc.mjs: clear; one optional wording note (inline). - File
packages/core/src/PowerSearch/PowerSearch.tsx: clear. - File
packages/core/src/PowerSearch/__tests__/PowerSearchAudit.a11y.chromium.spec.ts: clear. - File
packages/core/src/docPropReferences.test.ts: clear.
| name: 'Filter tokens', | ||
| required: false, | ||
| description: | ||
| 'One token per filter, reading field, operator and value. Activating a token opens its editor, except for an operator that takes no value. A remove button follows it unless the field is read-only or disabled, or the filter is read-only.', |
There was a problem hiding this comment.
Optional: a token in a read-only or disabled field, or a read-only filter's token, opens nothing (PowerSearch.tsx 1138-1143). Consider the same wording here and in the Chinese (line 566) and dense (line 641) entries:
'One token per filter, reading field, operator and value. In an editable field, activating a token opens its editor, except for an operator that takes no value. A remove button follows it unless the field is read-only or disabled, or the filter is read-only.',
User impact
Builders reading PowerSearch's docs now see each prop once, with what it does. Before, the English prop table listed
menuWidthandmaxOperatorMenuItemstwice: the second entries saidmenuWidthis the "maximum width for the operator/value dropdown menu" andmaxOperatorMenuItemscaps "the operator dropdown". Neither is true:menuWidthsets the width of the main field menu (it never shrinks below the input) and does not touch the value editors, andmaxOperatorMenuItemscaps the string and entity value suggestions. ThemenuWidthJSDoc said "Max width for dropdown menu"; it now says the same as the docs. The docs also list thecomponentsprop (per-type token and editor overrides), the Chinese docs addtokenOverflowBehavior,onFocusandonBlur, and all three doc variants name the field's parts. No runtime behavior changes.A doc test now fails when any component's prop table lists a prop twice; PowerSearch was the only one. A browser audit spec checks the field, its tokens and editor, read-only and disabled fields, and the sheet trigger, in light and dark, both directions, a second theme, and at 320 px.
Audit result
core/PowerSearch(released in@astryxdesign/coreunder./PowerSearch)1.16.69e40cf11fc3bdcb566e35458a9fccdb2204de6172a82330e766component:PowerSearch(authority: current), unchanged. No observational backfill was prepared.[docs]changeset.Overlap checked: #12959 (changes the
startIconwording in the same doc file; different lines), #12337 and #11868 (remove other lines from the same known-drift list), #12891, #11246 and #11205 (changePowerSearch.tsxaway from themenuWidthJSDoc). Whichever lands second merges cleanly or takes a one-line rebase.Overlap checked: #13070 (a do-not-merge release interaction check that carries a release candidate's files; it is not a change to these docs)
aria-haspopup="dialog"andaria-expanded, and its editor is a dialog named by the same text (FR24); Escape closes it and focus stays in the field; a read-only field shows no remove control and Backspace removes nothing (FR22); a disabled field keeps its tab stop witharia-disabled, takes no text, and opens its reason tooltip on keyboard focus; the sheet trigger is a button witharia-haspopup="dialog"that opens a Filters dialog and takes focus back on Escape (FR11, FR12, AR4, AR5); axe clean on every story root, open editor and open sheet (disabled text is exempt under WCAG 2.2 SC 1.4.3)power-searchtarget on the root in both presentations; tokens only; neutral light and dark and matcha checked. Open FIX: Needs Review 3onChange(filters, changeType, index),presentation,components,handleRef,refmenuWidthandmaxOperatorMenuItemsentries and themenuWidthJSDoc (X5);componentsmissing from both tables and three props missing from the Chinese table (X5b); no anatomy (X4)with-date-filtersmeasures it; right-to-left frames checked§11 is not run for an existing core component.
Why the score moved: the three §8 FIXes close with the docs, and the §6 FIX narrows with the browser spec.
Sensitivity: fix the open BLOCK and change nothing else: projected 95.4 / A.
Pre-fix score: scored from base source and a browser run against a Storybook built from the base tree, before any change. Night Watch records only the landed post-fix result in the score ledger, so the pre-fix score lives here.
Findings fixed
menuWidthandmaxOperatorMenuItemstwice; the second entries contradicted the first and the component, and themenuWidthJSDoc said "Max width"component:PowerSearch(menuWidthis the main field menu's exact width, not a maximum and not an editor control;maxOperatorMenuItemscaps the string and entity suggestions);component:TokenizermenuWidth(never shrinks below the input)every prop table lists each prop onceindocPropReferences.test.ts: on the base docs it fails namingPowerSearch menuWidthandPowerSearch maxOperatorMenuItems; it passes aftercomponentswas in neither table (listed in the CLI's known drift), and the Chinese table lackedtokenOverflowBehavior,onFocusandonBlurcomponents; X5busage.anatomyNeeds Review
PowerSearchBottomSheet.tsxfocuses the step's control and speaks queued announcements in Effects keyed onstepandfilters.architecture:react-component-runtimeINV3 keeps interaction logic in callbacks, and rubric C3 holds focus from a re-runnable Effect at BLOCK. The Effects are guarded so each runs once per step, and FR16 records where focus lands, so no defect was observed in the browser; moving the focus logic into the step's handlers is a refactor of the sheet flow, not an audit fix. The value editor's mount Effect that focuses its first control (PowerSearchEditPopover.tsx) runs once per mount and is recorded, not scored.width: anchor-size(width)with the 400 px floor only. The record marks the behavior and its real-Chromium proof as pending, and it needs the package-internal opening-control descriptor ofcomponent:TokenizerFR4–FR7, also pending. The audit spec measured the editor at the field's 600 px width and at 288 px inside a 320 px viewport.PlusIconinPowerSearchBottomSheet.tsxis an inline<svg>, because the default icon set has no plus. It shadows no registry name (rubric T17), but a theme cannot replace it. Adding a registry icon is a public icon-name decision.menupath whose focus returncomponent:BaseTypeaheadFR15 governs, and AR1 keeps the current behavior.role: 'none', and focus moves into its input, named "Value". A token's editor is a named dialog (FR24); the record names no role for the add path. axe finds nothing in either state.size, but no theme target carries it; DEC-3 decides that the sheet presentation adds no theming target.Evidence
PowerSearchAudit.a11y.chromium.spec.tsdrives existing stories. Every receipt is bound to the Storybook build and checkout: story id, theme, mode, direction, viewport, DPR 2, settled fonts, and no page errors. Each line is a check that fails the receipt when it does not hold:Default,Pre-set Filters,Read Only,Disabled,Disabled With Message,With Error Status,With Warning Status,Size Variants,With Result Count,Bottom sheet (forced); neutral light and dark in both directions, matcha light and dark): the field's control is a named combobox with a tab stop, or the sheet trigger witharia-expanded="false"; every token is named and not expanded; every painted text run and the placeholder at least 4.5:1 against its composited backdrop;Defaultmust measure its placeholder (a placeholder read that returns the input's own text color counts as unmeasured), andPre-set Filtersits two editable tokens and their two remove controls; no axe violation on the story root;aria-expanded, takes focus, is at least 400 px wide or the viewport's width and inside the viewport, and is axe clean; Escape closes it, clearsaria-expanded, and leaves focus in the field; typingTitlelists options and expands the combobox; Enter and a typed value add a token namedTitle: contains audit; the value step is axe clean;aria-disabledis set, typed text is refused, and the reason tooltip becomes visible within 5 s;aria-expanded, and moves focus into it; axe clean; Escape closes it and focus returns to the trigger;Pre-set Filtersat 320 px, both directions): no sideways scroll; the token's editor stays inside the viewport.bdcb566, with a Storybook built from that commit; exact-head CI is the authoritative run.9e40cf11fc3) against a Storybook built from it: all 78 receipts passed, and all 124 frames are byte-identical at the exact head, so the change renders nothing new.docPropReferences.test.ts(new case, red on the base docs and green after),docPropLiterals.test.ts,themingTargets.test.ts, and the CLI'score-prop-docs.test.mjsandcore-doc-types.test.mjspass (488 cases). Core docs typecheck and strict lint on the changed files pass.core-powersearch--with-date-filters); the local run could not start Chromium, so the exact-head Touched components check is the measurement.pr-a11yrun is the measurement, and it also runs the sheet-trigger spec.Closed evidence inventory
PowerSearch,PowerSearchToken,PowerSearchFilterEditor,usePowerSearchConfig, typesPowerSearch/index.tsPowerSearch.doc.mjs,usePowerSearchConfig.doc.mjsarchitecture:public-component-apiPowerSearch.tsx,usePowerSearchSource.tsconfig,maxSearchResultsPowerSearch.tsx,PowerSearchEditPopover.tsx,PowerSearchToken.tsxmaxTokenLength,components(added)PowerSearch.tsxPowerSearch.tsxisReadOnly,hasClearPowerSearch.tsxisDisabled,disabledMessagespec:AST-085PowerSearch.tsxstatus,statusVariant,resultCountformatFilterValue.ts,powerSearchDateZone.tstimezoneIDPowerSearchBottomSheet.tsxpresentationpower-searchtargetPowerSearch.tsxthemingTargets.test.tsthemingarchitecture:component-theming-surfaceFR10 eligibility report
{ "schema": "astryx.audit-eligibility/v1", "component": "PowerSearch", "package": "core", "mode": "night-watch", "rubricVersion": "1.16.6", "repository": {"base": "9e40cf11fc3", "head": "bdcb566e35458a9fccdb2204de6172a82330e766"}, "contract": {"id": "component:PowerSearch", "authority": "current", "changed": false}, "inventory": {"closed": true, "rows": 10}, "remediations": [ {"id": "X5", "kind": "doc-drift", "evidence": "one entry per prop; new duplicate-entry doc test red on base, green after"}, {"id": "X5b", "kind": "doc-drift", "evidence": "components and three Chinese entries; CLI known-drift line removed"}, {"id": "X4", "kind": "doc-drift", "evidence": "anatomy in three doc variants"} ], "unresolved": { "objective": ["sheet flow moves focus and announces from step Effects (INV3, C3)", "editor 720 px cap and nearer-edge alignment pending (FR1, FR4-FR6)", "inline plus glyph (T17)"], "manual": ["Escape focus target after a token editor", "add-path value editor role", "sheet trigger size has no target (DEC-3)"] }, "approvals": {"specOwner": "n/a (no record change)"}, "verdict": {"autoMergeEligible": false, "reasons": ["AST-029 FR11 activation has not shipped", "one pre-existing BLOCK"]} }