Repository navigation
[Component Audit] OverflowList: items and the overflow indicator are no longer cut off in themes with a different spacing scale - #12401
Conversation
|
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 |
|---|---|---|---|
| OverflowList · Storybook | 11.2 kB (+190 B) · 3.6 kB CSS (0) | 240 (+3) | ✓ · ✓ · ✓ |
| Tokenizer | 105.9 kB (+76 B) · 20.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 376.9 kB (+54 B) · 2.5 kB CSS (0) | — | — · — · — |
2 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentThread | 370.1 kB (+27 B) · 2.4 kB CSS (0) | — | — · — · — |
| PowerSearch | 310.2 kB (+16 B) · 25.6 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.65 MB packed (+539 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the gap fix works (OverflowList items no longer truncate in the matcha theme, and the default theme renders the same), but two things need fixing first.
- A
gap-only prop change no longer measures in its commit as the OverflowList record's FR7 requires, becauseOverflowList.tsxstops passinggaptouseOverflowInternal; passing the gap step again (whichreadsGapignores for the arithmetic) with a rerender test fixes it. - The description's overlap notes are wrong: #11996 and #12238 both conflict with this branch in
OverflowList.tsxanduseOverflow.ts, and both sum the hook'sgapoption for their new size bounds, which this change leaves at 0 for OverflowList.
Two non-blocking suggestions are inline and in the review: drop the comment that restates gapTokens, and qualify the existing "count indicator" recommendation beside the new "don't".
Claims and files checked
Review mode: full; reason: no-earlier-review
- Title: items and the indicator are no longer cut off in themes with another spacing scale. Verified: in the matcha theme the Resizable story truncates every label on the base and none on the head, and the new unit test fails on the base and passes on the head.
- Changeset: the list fits with the gap it renders under another spacing scale or root font size. Verified: spacing tokens are rem and the hook reads the computed gap (
useOverflow.ts:463-465); every visible item was affected, not only the last. - Description: the audit evidence and scorecard are still being finalized. A status statement with nothing to verify.
- Description: overlap with #11996 and #12238 was checked and shares no lines. False: both conflict in two files and depend on the hook's
gap. - Audit spec header: CI runs it only for an OverflowList audit pull request. Verified in the accessibility contract runner's audit routing.
.changeset/overflow-list-audit-theme-gap.md: clear.packages/core/src/OverflowList/OverflowList.doc.mjs: non-blocking; the existing count-indicator recommendation needs a condition.packages/core/src/OverflowList/OverflowList.test.tsx: clear; the new test fails on the base.packages/core/src/OverflowList/OverflowList.tsx: blocking (gap no longer reaches the hook); non-blocking comment.packages/core/src/OverflowList/__tests__/OverflowListAudit.a11y.chromium.spec.ts: clear; follows the existing audit-spec pattern; not run.packages/core/src/hooks/useOverflow.ts: clear; the gap read sits in the existing measurement pass.
| 6: 24, | ||
| 8: 32, | ||
| 10: 40, | ||
| /** The spacing token for each gap step, as a CSS value. */ |
There was a problem hiding this comment.
Non-blocking: this restates the constant's name and type. Drop it, or keep only the reason, for example: "The multi-row height cap needs the token, not a class."
…pec checks each resize step
There was a problem hiding this comment.
Changes requested: the gap fix works and a gap change now measures again in its commit, but one thing still needs fixing first.
- The description's overlap notes are wrong: #11996 and #12238 both conflict with this branch in
OverflowList.tsxanduseOverflow.ts(#12238 on the gap lines themselves), and both size the list from the hook'sgapoption, which this change leaves at 0 for OverflowList, so please correct both lines to name the conflicting files and that dependency.
Two non-blocking suggestions remain: drop or shorten the comment that restates gapTokens, and qualify the existing "count indicator" recommendation beside the new "don't".
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none since the last review.
- Title: items and the indicator are no longer cut off in themes with another spacing scale. Verified: in the matcha theme the Resizable story ellipsizes every label, the indicator included, on the base and none on the head; the default theme is unchanged.
- Changeset: the list fits with the gap it renders under another spacing scale or root font size. Verified: spacing tokens are rem and the hook reads the computed gap (
useOverflow.ts:463-466); the new unit test fails on the base. - Description: the audit evidence and scorecard are still being finalized. A status statement with nothing to verify.
- Description: overlap with #11996 was checked; this change reads the gap rather than sizing the box. False: both files conflict, and #11996 sums the hook's
gap, which this change leaves at 0. - Description: overlap with #12238 shares no lines with the gap change. False: it conflicts on the gap lines in both files and sums the hook's
gap. - Latest commit: a new gap step fits the list again. Verified: the rerender test fails on the previous revision and passes here.
- Audit spec header: CI runs it only for an OverflowList audit pull request. Verified in the accessibility contract runner's audit routing.
.changeset/overflow-list-audit-theme-gap.md: clear.packages/core/src/OverflowList/OverflowList.doc.mjs: non-blocking; the existing count-indicator recommendation needs a condition.packages/core/src/OverflowList/OverflowList.test.tsx: clear; both gap tests fail on the base, and the rerender test fails on the previous revision.packages/core/src/OverflowList/OverflowList.tsx: non-blocking comment at line 93; otherwise clear.packages/core/src/OverflowList/__tests__/OverflowListAudit.a11y.chromium.spec.ts: clear; follows the existing audit-spec pattern; not run.packages/core/src/hooks/useOverflow.ts: clear; the gap read sits in the existing measurement pass and a new token measures again.
…ender The overflow report read the items through a ref that render wrote, a side effect during render. The layout Effect now reads the items directly; its key comparison still keeps the report to real changes.
|
/approve-spec 20cfc04 |
There was a problem hiding this comment.
Changes requested: the gap fix works and the ref write during render is gone, but two claims in the description are still wrong at this head.
- The overlap notes for #11996 and #12238 are wrong: both conflict with this branch in
OverflowList.tsxanduseOverflow.tson the gap lines themselves, and both sum the hook'sgapoption, which this change now leaves at 0 for OverflowList, so please correct both lines to name the conflicting files and that dependency. - The audit result still lists the ref write during render as an open FIX (in the §7 row, the After defect counts and the eligibility report's unresolved list) and names the previous commit as the exact head, while this head removes that ref, so please close the FIX and name the reviewed head.
Both are description edits; the code itself needs no change for this verdict. Two non-blocking suggestions remain: drop or shorten the comment that restates gapTokens, and qualify the existing "count indicator" recommendation beside the new "don't". CI has not run on this draft head yet.
Claims and files checked
Review mode: same-head; reason: none
- Title: items and the indicator are no longer cut off in themes with another spacing scale. Verified: in the matcha theme the Resizable story ellipsizes every label, the indicator included, on the base and none on the head.
- Changeset: the list fits with the gap it renders under another spacing scale or root font size. Verified: spacing tokens are rem and the hook reads the computed gap (
useOverflow.ts:463-466); both new unit tests fail on the base. - Description: matcha renders gap step 2 as 12 px, not 8 px. Verified (
matchaTheme.ts:260). - Description: a raised base font size changes the rendered gap. Verified: the default tokens are rem (
tokens.stylex.ts:191). - Description: nothing changes in the default theme at the default font size. Verified: the default-theme frame is pixel-identical.
- Description: the fit reads the rendered gap and measures again when the step changes; the multi-row cap uses the token. Verified (
useOverflow.ts:463-466,:562;OverflowList.tsx:410) and by the two new tests. - Description: the public
useOverflowhook and its numericgapoption are unchanged. Verified (no API surface change). - Description: the component contract is current and unchanged. Verified.
- Description: the measurement copy is hidden, inert, zero-height and takes no pointer input. Verified (
OverflowList.tsx:58-67,:386-390). - Description: the ref written during render is gone and the report still fires only on real changes. Verified (
OverflowList.tsx:358-381; theonOverflowChangesuite passes). - Description: the OverflowList, Toolbar, Breadcrumbs, TabList and
useOverflowsuites, typecheck and lint pass. Verified at this head. - Description: a gap set through
xstyle,classNameorstyleis not measured, and this predates the change. Verified: the measure copy carries only thegapclass (OverflowList.tsx:390). - Description: a new "don't" in all three doc variants. Verified (
OverflowList.doc.mjs:162,:271,:314). - Description: overlap with #11996 and #12238 was checked. False (first finding).
- Description: the ref write is an open FIX, the after counts, the unresolved list and the exact head. False (second finding).
- Description: browser audit receipts and before/after pixel measurements. Not rerun; consistent with the matcha frames.
.changeset/overflow-list-audit-theme-gap.md: clear.packages/core/src/OverflowList/OverflowList.doc.mjs: non-blocking; the existing count-indicator recommendation needs a condition.packages/core/src/OverflowList/OverflowList.test.tsx: clear; both gap tests fail on the base.packages/core/src/OverflowList/OverflowList.tsx: non-blocking comment at line 93; otherwise clear.packages/core/src/OverflowList/__tests__/OverflowListAudit.a11y.chromium.spec.ts: clear; not run.packages/core/src/hooks/useOverflow.ts: clear; the gap read sits in the existing measurement pass.
There was a problem hiding this comment.
Approved pending CI: adding the accessibility label started a second CI run on this head, and its remaining unit shards have not finished yet.
OverflowList now fits items, and caps its multi-row height, with the gap the theme actually renders: in themes with a larger spacing scale, or at a raised root font size, the list stops squeezing its chips into ellipses and the two-row list stops clipping its second row, while the default theme is unchanged. Two non-blocking suggestions remain: drop or shorten the comment that restates gapTokens (OverflowList.tsx:93), and qualify the existing "count indicator" recommendation beside the new "don't" in OverflowList.doc.mjs.
Claims and files checked
Review mode: same-head; reason: none
- Title: items and the indicator are no longer cut off in themes with a different spacing scale. Verified: in matcha the Resizable story ellipsizes every chip on the base and none on the head, and the MultiRow story's second row is clipped on the base and fits on the head.
- Changeset: with another spacing scale or root font size the list fits with the gap it renders, so the last item and the indicator are no longer cut off. Verified (
useOverflow.ts:463-466): at a 20 px root the base truncates labels at 464-467 px frames and the head does not, and both new unit tests fail on the base. - Description: matcha renders gap step 2 as 12 px, not 8 px. Verified (
matchaTheme.ts:260). - Description: raising the base font size changes the rendered gap. Verified: the spacing tokens are rem (
tokens.stylex.ts:189-191), and the 20 px-root frames show the fit following it. - Description: a two-row list in matcha cut 2 px off its second row (bottom 91 px in an 89 px box) and now fits. Verified: the cap grows from 64 px to 66 px.
- Description: the multi-row cap was 4 px short at gap step 2 in matcha. Verified: 12 px rendered against the table's 8 px per row break.
- Description: nothing changes in the default theme at the default font size. Verified: the neutral frames are pixel-identical and the stable visual regression passed.
- Description: the fit reads the rendered gap and measures again when the step changes, and the cap uses the token. Verified (
useOverflow.ts:463-466,:562;OverflowList.tsx:410) and by the two new tests. - Description: the public
useOverflowhook and its numericgapoption are unchanged. Verified (useOverflow.ts:348-357; no package export changes). - Description: the component contract is current and unchanged. Verified.
- Description: the measurement copy is hidden, inert, zero-height and takes no pointer input. Verified (
OverflowList.tsx:58-67,:386-390). - Description: the render-time ref write is gone and the report still fires only on real changes. Verified (
OverflowList.tsx:357-381; theonOverflowChangesuite passes). - Description: the last commit only removes that ref, and the browser receipts ran on its parent. Verified: the last commit changes only
OverflowList.tsx, in that report code. - Description: the base and exact head named in the audit result. Verified.
- Description: the OverflowList, Toolbar, Breadcrumbs, TabList and
useOverflowsuites pass 297 of 297. Verified at this head. - Description: Core typecheck and strict lint pass. Verified: CI typecheck and lint pass on this head.
- Description: #11996 conflicts on the gap lines, sums the hook's
gap, and is superseded by #12238. Verified: both files conflict with this head, its width math sumsgap, and #12238 states it supersedes #11996. - Description: #12238 conflicts on the gap lines and its inline sizes sum the hook's
gap. Verified at its current head. - Description: audit scores and defect counts, with the code-health fix closed at this head and the scores as scored on the parent commit. Consistent.
- Description: a gap set through
xstyle,classNameorstyleis not measured, as before. Verified (OverflowList.tsx:390,:412-415). - Description: a new "don't" in all three doc variants. Verified (
OverflowList.doc.mjs:160-163,:269-272,:312-315). - Description: the audit spec makes 50 receipts with 62 frames, checks axe on every story root and covers both directions. Verified from its case list; it passed in CI on this head.
- Description: independent Chromium and Firefox stills show the default theme unchanged, the matcha and y2k MultiRow story cut before and whole after, and the drawn gap matching the fit only after. Verified for matcha in Chromium by this review's frames, and y2k uses the same 12 px step 2; the Firefox runs and width sweeps were not rerun.
- Description: at a 12 px root the drawn gap is 6 px while the base assumes 8 px. Consistent: the step-2 token is 0.5rem; this review checked a 20 px root instead.
- Description: the visual baseline shows no change in the default theme at the default font size. Verified: the stable visual regression passed on this head.
- Description: the exact-head accessibility run is the accessibility measurement. Verified: the accessibility browser-spec job ran the audit spec on this head and passed, and the touched-component audit found 0 issues on all 12 stories.
- Description: the exact-head right-to-left run is the right-to-left measurement. Partly: the full right-to-left job is label-gated and skipped, but the touched-component right-to-left check passed on this head.
- Description: the audit receipts pass at the parent commit and the base run fails only the two matcha multi-row receipts. Not rerun; consistent with this review's frames and the CI pass on this head.
- Description: auto-merge is not eligible because the audit activation has not shipped. Verified: that record is accepted, not shipped.
.changeset/overflow-list-audit-theme-gap.md: clear.packages/core/src/OverflowList/OverflowList.doc.mjs: non-blocking; qualify the existing count-indicator entry.packages/core/src/OverflowList/OverflowList.test.tsx: clear; both gap tests fail on the base.packages/core/src/OverflowList/OverflowList.tsx: non-blocking comment at line 93; otherwise clear.packages/core/src/OverflowList/__tests__/OverflowListAudit.a11y.chromium.spec.ts: clear; passed in CI on this head.packages/core/src/hooks/useOverflow.ts: clear; the gap read sits in the existing measurement pass.
User impact
In a theme whose spacing scale differs from the default (the matcha theme renders gap step 2 as 12 px, not 8 px), or when a person raises their browser's base font size, OverflowList now fits items with the gap it actually draws. Before, it always assumed the default pixel sizes, so a two-row list in matcha cut 2 px off its second row, the overflow indicator included, and a single row could show an item that no longer fit, cut off at the list's edge. In the default theme at the default font size nothing changes.
Builders also get one more "don't" in the docs: an indicator that only shows a count leaves the collapsed items out of reach, so make it a control, such as a dropdown menu.
Audit result
core/OverflowList(released in@astryxdesign/coreunder./OverflowList)1.16.668510fe2bfd20cfc048ac2a0b2470db2a117f8dd8b0bbe9f4d9(reviewed head; the browser receipts below ran at40353b8, and20cfc048only removes the render-time ref in the overflow report)component:OverflowList(authority: current), unchanged. No observational backfill was needed: the record is current and covers the public surface.useOverflowhook and its numericgapoption are unchanged. Plus docs, unit tests, a browser evidence spec, and a[fix]changeset.Overlap checked: #11996 (conflicts in
OverflowList.tsxanduseOverflow.tson the gap lines; it sums the hook's numericgapoption, which this PR leaves at 0 for OverflowList, so it must read the rendered gap after this merges; it is superseded by #12238)Overlap checked: #12238 (conflicts in
OverflowList.tsxanduseOverflow.tson the gap lines; its inline sizes sum the hook's numericgapoption, which this PR leaves at 0 for OverflowList, so #12238 merges after this and switches to the rendered gap when it merges main)aria-hidden,inert, invisible, zero-height, and takes no pointer input (FR1, AR1); the caller's indicator reaches the collapsed items (AR2: the dropdown story's menu lists exactly the collapsed actions); axe clean on every story rootoverflow-listtarget on the visible container; gap from spacing tokens; neutral light and dark and matcha checkedgap, count limits,maxRows,collapseFrom,behavior,overflowRenderer,onOverflowChange,refand passthrough on the visible container (FR6); child introspection is the allowlisted exceptionspacingToPx) shadowed the spacing tokens, so the fit math and the multi-row height used the default scale in every theme (rubric C15). FIX closed at20cfc048: the latest collapsed set was written to a ref during render (overflowItemsRef.current = overflowItems); the layout effect now reads the items directly§11 is not run for an existing core component.
Why the score moved: the §7 BLOCK (and its §4 and §5b cross-references) closes with the rendered gap, and the §8 FIX closes with the new "don't". The §7 FIX closed at
20cfc048after scoring; the scores above are as scored at40353b8.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
spacingToPxturned thegapstep into default-scale pixels (step 2 = 8 px). Spacing tokens are rem and a theme can change the scale, so in matcha (12 px) the fit math under-counted every gap and the multi-rowmaxHeightwas 4 px shortcomponent:OverflowListFR2 (the items that fit the measured width), FR4 (that many measured rows plus gaps;gapsets the spacing)maxHeightuses the spacing token incalc(). Unit:fits items with the gap the theme rendersfailed before the change and passes after;fits again when the gap step changescovers a new step. Browser: before, the matcha multi-row list's second row ended at 91 px inside a box that ends at 89 px; after, it fitsoverflowItemsRef.current = overflowItemsran during render, a side effect, so the reporting layout effect could read the latest setarchitecture:react-component-runtimeroles 1 and 3, INV3 (a latest-value ref only throughuseCommittedRef; here no ref is needed)bestPractices, and nothing on reaching collapsed itemsNeeds Review
xstyle,className, orstylereaches only the visible list, not the measurement copy, so the fit math uses thegapprop's spacing. This was already true before this PR;gapis the documented way to set the spacing.Evidence
OverflowListAudit.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,No Overflow,With Badges,Collapse From Start,Capped Items,Multi Row,Capped Multi Row; neutral light and dark in both directions, matcha light and dark): the measurement copy isaria-hidden,inert,visibility: hidden, 0 px tall, and takes no pointer input; no shown child reaches past the list's inline edges or its bottom; the indicator sits on the collapse edge; no axe violation on the story root;Resizable, neutral and matcha, both directions): the person-resizable frame is narrowed from 520 to 120 px in ten steps; at every step the frame exists, the list narrows, nothing is clipped, and the indicator sits at the end; at 120 px the indicator shows;With Dropdown Overflow, light and dark): narrowed to 220 px, nothing is clipped; the "+N" trigger opens a menu with exactly N items, none of them a shown item;Defaultat 320 px, both directions): no sideways scroll.40353b8, with a Storybook built from that commit. Local Chromium ran with--single-processbecause the local machine's sandbox refuses the browser's multi-process start; exact-head CI is the authoritative run.94d1618: every receipt passed except the two matcha multi-row receipts, which clipped the second row (bottom 91 px in an 89 px box).OverflowList.test.tsx; the OverflowList folder plus theuseOverflowandcomputeOverflowsuites pass. Core typecheck and strict lint pass.pr-rtlrun is the measurement.pr-a11yrun is the measurement.Closed evidence inventory
OverflowList,OverflowListProps,OverflowItemOverflowList/index.tsOverflowList.doc.mjsarchitecture:public-component-apiOverflowList.tsxOverflowList.tsx,useOverflow.ts,computeOverflow.tsminVisibleItems,maxVisibleItemssuites; rendered-gap cases (new)gap,minVisibleItems,maxVisibleItems,collapseFrom,behaviorOverflowList.tsxmaxRowssuite; rendered-gap cases (new)maxRows,gapOverflowList.tsxonOverflowChangesuiteonOverflowChangeOverflowList.tsxxstyleuseOverflow.tsFR10 eligibility report
{ "schema": "astryx.audit-eligibility/v1", "component": "OverflowList", "package": "core", "mode": "night-watch", "rubricVersion": "1.16.6", "repository": {"base": "68510fe2bfd", "head": "20cfc048ac2a0b2470db2a117f8dd8b0bbe9f4d9"}, "contract": {"id": "component:OverflowList", "authority": "current", "changed": false}, "inventory": {"closed": true, "rows": 8}, "remediations": [ {"id": "C15", "kind": "bug-fix", "evidence": "red-then-green unit case; matcha multi-row second row clipped before, fits after"}, {"id": "X3-X16", "kind": "doc-drift", "evidence": "new don't in three doc variants"}, {"id": "C11-ref", "kind": "code-health", "evidence": "render-time ref write removed; OverflowList, Toolbar, Breadcrumbs, TabList and useOverflow units pass"} ], "unresolved": { "objective": [], "manual": ["gap set through xstyle/className/style reaches only the visible list (pre-existing)"] }, "approvals": {"specOwner": "n/a (no record change)"}, "verdict": {"autoMergeEligible": false, "reasons": ["AST-029 FR11 activation has not shipped"]} }