Repository navigation
fix(Table): an unbounded column's resize handle announces a range that holds its width - #10577
Conversation
…t holds its width
A column-resize separator on a column with no maximum width rendered no
aria-valuemax, so assistive technology assumed ARIA's default of 100 and read
the width past it. Such a handle now announces the window's inline extent as
its maximum, floored at its value and minimum, as an unbounded Resizable
region does, and its width in words ("133 pixels"), since that maximum stands
in for a missing limit. The server render carries no maximum until
hydration reads the window. A column with maxWidth is unchanged. Record:
useTableColumnResize AR7 and its verification row. Adds the
@astryx.table.columnResize.widthValue catalog string.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/approve-spec 622efc6 |
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableBody | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableFooter | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
| TableHeader | 3.5 kB (0) · 3.3 kB CSS (0) | — | ✓ · ✓ · ✗ |
7 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableRow | 7.0 kB (0) · 4.0 kB CSS (0) | — | ✓ · ✓ · ✗ |
| SideNav | 112.6 kB (+2 B) · 11.4 kB CSS (0) | — | — · — · — |
| ResizeHandle | 21.5 kB (0) · 4.3 kB CSS (0) | — | ✓ · ✓ · ✓ |
| Table | 124.5 kB (0) · 18.3 kB CSS (0) | — | ✓ · ✓ · — |
| TableCell | 109.4 kB (0) · 17.9 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableHeaderCell | 109.0 kB (0) · 17.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableSelectionToolbar | 70.5 kB (0) · 13.2 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.18 MB packed (+3.3 kB); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: once a column has a committed width its handle now reports it correctly (210 px reads 210 with a maximum of 1280 instead of being pinned at 100), but five things need fixing first.
- The new value text announces an unresized column's minimum as its width (the Default story's 200 px Name column says "60 pixels", and the new Chromium spec asserts it), so either seed the value from the rendered width or reword the changeset and AR7 so they do not promise the width.
useWindowInlineExtentreadswindow.innerWidthin every handle's render, in every handle'sresizelistener and again after every commit (the inline snapshot function is new each render), whicharchitecture:react-component-runtimeINV18 rules out on a resize path; keep the width in one module-level store fed by a sharedResizeObserverentry or one shared listener, and return it from a stable snapshot function, the store shapeBottomSheetPanel.tsxuses."{width} pixels"has no plural ornumberargument and the catalog check forbids translations from adding one, so Arabic, Polish, Romanian, Russian, Serbian and Ukrainian cannot inflect "pixels"; use{width, number} {width, plural, one {pixel} other {pixels}}as the catalog's other counts do.- The window stand-in maximum re-implements Resizable's private rule (
readWindowExtentandMath.max(windowExtent, size)increateResizable.ts) instead of sharing it, so put the cached store in one utility that both call. - The record still says AR1 keeps the "current value bounds" and that no accessibility mapping changes, so point AR1 at AR7 and record the changed announced range under Compatibility and migration.
One comment-style suggestion is inline and non-blocking.
[Automated review]
Addresses review on the separator range:
- The window width every unbounded handle announces comes from one shared
store in utils/windowExtent.ts, with one resize listener and a stable
snapshot, so render and commit read no layout (INV18). Resizable's
stand-in maximum calls the same readWindowExtent and standInMaximum, so
the two share one rule; its behavior is unchanged.
- The value text is plural-aware: "{width, number} {width, plural, one
{pixel} other {pixels}}".
- Record: AR1 points at AR7 for the value bounds; Compatibility records the
changed announced range; AR7 says the handle announces its value in words
and names the known gap (the value is the minimum until a first resize).
The changeset says the same.
|
/approve-spec f0e3aba |
…-rendered-width Takes #10577's review round (shared window-width store, plural value text, AR1/AR7 record). AR7 drops its known-gap sentence: AR8 closes it.
There was a problem hiding this comment.
Changes requested: an unbounded column's handle now announces a range that holds its width (250 of 1280 with "250 pixels" in Chromium's accessibility tree, where main reads 100 of 100), and two things are left.
handleWindowResizeinpackages/core/src/utils/windowExtent.tsstill readswindow.innerWidthon every windowresizeevent, whicharchitecture:react-component-runtimeINV18 rules out on a resize path, so feed the store fromobserveResize(document.documentElement, …)and read the width inside that callback, keeping the stable snapshot.- Miss: the value text passes the raw column width, so a fractional width is spoken with three decimals ("202.656 pixels" after one ArrowRight in a 610 px window) although the catalog description promises a whole number; pass
Math.round(valueNow)and add a fractional-width case to the AR7 test.
The two earlier non-blocking comment notes still apply.
[Automated review]
|
|
||
| /** The window's width from the shared store; one read when none is held. */ | ||
| export function readWindowWidth(): number { | ||
| windowWidth ??= window.innerWidth; |
There was a problem hiding this comment.
Non-blocking: the comment above (lines 37-40) says the value is null with no subscriber "because nothing keeps it current", but this line caches a width with no subscriber. readViewportHeight in BottomSheet/BottomSheetPanel.tsx returns a direct read when nothing listens; do the same here, or reword the comment.
| * The window's inline extent, which a column with no maximum announces as its | ||
| * maximum, as an unbounded Resizable region does. Every handle shares one | ||
| * store and one listener, and render reads the stored width. The server has | ||
| * no window, so it renders none, and hydration then reads it. |
There was a problem hiding this comment.
Non-blocking (INV29 style): the second sentence restates the store's implementation. Suggested:
/**
* The window's inline width, the maximum an unbounded column announces. The
* server has no window, so it renders no maximum until hydration.
*/
humbertovirtudes
left a comment
There was a problem hiding this comment.
Requesting changes. With this change an unbounded column's resize handle announces a range that holds its width instead of reading past ARIA's default maximum of 100, and the record, catalog plural and shared helper look right. Two items remain at f0e3aba:
-
packages/core/src/utils/windowExtent.ts:46 reads window.innerWidth on every window resize event. docs/architecture/react-component-runtime.md INV18 rules out layout reads on a resize path unless a current clause requires one, and its verification row lists inner*. Suggest feeding the store from observeResize(document.documentElement, ...) and reading the width inside that callback, or citing the clause that requires the read.
-
useTableColumnResize.tsx:791 and :802 pass the raw width to the value text. After a resize the committed width starts from getBoundingClientRect (useTableColumnResize.tsx:482-487) and can be fractional, and {width, number} then speaks "202.656 pixels", although the catalog description in locales/en.json promises a whole number of CSS pixels. Suggest Math.round for the value text, plus a fractional-width test case.
Non-blocking:
- windowExtent.ts:37-40 says the value is null with no subscriber, but readWindowWidth (line 74) caches one. Reword, or read directly when nothing listens.
- The value-text assertions compare against
${now} pixels; a column of 1000px or more formats as "1,280 pixels". - #10593 replaces the "until first resized" gap. If both ship in one release, the changeset here should drop that sentence so the release notes do not contradict each other.
Heavy CI (test, build, docsite-test) is deferred at this head, so the new unit and Chromium specs have not run in CI yet.
… text - The window-width store is fed by the shared resize observer on the root element and reads innerWidth inside its report, so no resize event reads layout (INV18). The snapshot stays stable. - The value text says a whole number of pixels: a 202.656 px column reads "203 pixels". Tests: no window resize listener, and the fractional case.
|
/approve-spec 8bec1b9 |
There was a problem hiding this comment.
No blocking findings remain: both items from the last round are fixed, as the width store now reads window.innerWidth only in the shared root resize observer's callback and the value text rounds to whole pixels (with a 202.656 px test). Approval still waits on the change request humbertovirtudes left on the previous head, which clears when he re-reviews this head or an engineering owner dismisses it. Heavy CI (test, build, docsite-test) is deferred here, so the new unit and Chromium specs have not run in CI yet. Two optional comment-wording suggestions are inline.
[Automated review]
| const windowWidthListeners = new Set<() => void>(); | ||
| let stopObserving: (() => void) | null = null; | ||
|
|
||
| // The observer reports after layout, so reading the width here forces none. |
There was a problem hiding this comment.
Non-blocking (INV29): the first call to handleRootResize is the synchronous registration call observeResize makes inside subscribeToWindowWidth, not a report after layout. Suggested:
// A ResizeObserver report comes after layout, so this read forces none. The
// registration call reads once, when the first handle subscribes.| // The observation reports once at once, so a resize between the first | ||
| // render and this subscription still reaches the store. |
There was a problem hiding this comment.
Non-blocking (INV29): "reports once at once" is vague. Suggested:
// observeResize calls back once on registration, so a resize between the
// first render and this subscription still reaches the store.(Posted by Cindy's agent.) Dismissing as addressed at head 8bec1b9, with thanks. (1) windowExtent now feeds its store from observeResize(document.documentElement, …) and reads innerWidth only inside that callback; no window resize listener remains (test: windowExtent.test.ts "listens to no window resize event, and reads innerWidth once per observation report", which fails at f0e3aba). (2) The value text passes Math.round(valueNow) (test: useTableColumnResize.test.tsx "says a fractional width as a whole number of pixels", 202.656 px reads "203 pixels", which fails at f0e3aba). The latest automated review at this head confirms both with no blocking findings. The non-blocking notes are tracked: the changeset sentence is dropped in #10593's round.
There was a problem hiding this comment.
Approved pending CI: the heavy suites (test, build, docsite-test) were deferred on this head and run in the pre-merge re-run.
An unbounded column's resize handle now announces a maximum that holds its width (250 of 1280 with "250 pixels" in Chromium, and 400 in a 400 px window), and both items from the earlier change request are fixed: the width store now follows the shared root resize observation instead of a window resize listener, and the value text rounds (202.656 px reads "203 pixels"). Three comments in windowExtent.ts and useTableColumnResize.tsx no longer match the code; the inline notes suggest rewordings and are non-blocking.
[Automated review]
| const windowWidthListeners = new Set<() => void>(); | ||
| let stopObserving: (() => void) | null = null; | ||
|
|
||
| // The observer reports after layout, so reading the width here forces none. |
There was a problem hiding this comment.
Non-blocking (INV29): the first call does not come after layout. It runs synchronously inside observeResize's registration (sharedResizeObserver.ts:89-92), during useSyncExternalStore's subscribe after a commit. Suggested:
// A resize observation reports after layout, so this read forces none.
// The registration call reads once more, during subscribe after a commit.There was a problem hiding this comment.
Approved: an unbounded column's resize handle now announces a range that holds its width (250 of 1280 with "250 pixels" in Chromium's accessibility tree, where main reads 100 of 100), its maximum follows the window, and columns with maxWidth are unchanged.
Before this can merge:
- The branch now conflicts with
maininpackages/core/src/Resizable/createResizable.ts, where the warning-dedupe refactor rewrote thedevWarnimport and theQUIETconstant beside the lines this change edits; keeping both sides resolves it. - CI's
testcheck is red from one Popover rendering proof (PopoverTouchMotion.interaction.browser.spec.ts:652) inpr-interaction (4/6), which this change does not reach; updating ontomainre-runs it.
Non-blocking:
- AR7 says the announced maximum is never below the value or the minimum, but a bounded column whose
columnWidthsentry or minimum exceedsmaxWidthstill announces the smallermaxWidth(value 600 with maximum 500), as onmain; scope that sentence to a column within its bounds, or floor the bounded maximum too.
[Automated review]
|
/approve-spec 2489699 |
main moved Resizable's warnings to per-instance createDevWarnings and made QUIET null (#10655). This branch moves readWindowExtent to utils/windowExtent; the merge keeps both.
There was a problem hiding this comment.
Approved pending CI: build, test and docsite-test are deferred on this head and run before merge.
An unbounded column's resize handle now announces a range that holds its width: 250 of 1280 with "250 pixels" in Chromium's accessibility tree, where main reads 100 of 100, and a fractional width is spoken as a whole number ("133 pixels"). Columns that set maxWidth are unchanged, and the new unit tests fail on main and pass here.
Non-blocking:
- AR7 says the announced maximum is never below the value or the minimum, but a bounded column whose
columnWidthsentry exceedsmaxWidthstill announces the smallermaxWidth(600 with a maximum of 500), as onmain; scope that sentence to a column within its bounds, or floor the bounded maximum too.
[Automated review]
|
/approve-spec 5e40e28 |
There was a problem hiding this comment.
Approval waits on a spec decision. AR7 in module:Table/useTableColumnResize is a new requirement, and the newest commit (a rewording of the record's Compatibility line) means the earlier /approve-spec no longer covers this head. An engineering owner records the decision by commenting /approve-spec 4e59caf9934afba78f4ae588f99580f616cec30e, and the author may do so if they are an engineering owner. The code is unchanged since the last review and no blocking finding remains: an unbounded column's handle reads 250 of 1280 with "250 pixels" in Chromium's accessibility tree, where main reads 100 of 100.
Non-blocking:
- AR7 says the announced maximum is never below the value, but a column with
maxWidth500 and acolumnWidthsentry of 600 still announces 600 of 500, as onmain; scope that sentence to a column with no maximum, or floor the bounded maximum too.
[Automated review]
| - **AR7 — A range that holds the value.** A boundary's announced maximum is | ||
| never below its value or its minimum (`spec:AST-020` FR1). A column with a |
There was a problem hiding this comment.
Non-blocking: this sentence covers bounded columns too, but a column with maxWidth 500 and a columnWidths entry of 600 announces 600 of 500 (useTableColumnResize.tsx:798-800 passes maxWidth unchanged), as on main. Scope it to the unbounded case, for example:
An unbounded boundary's announced maximum is never below its value or its
minimum (`spec:AST-020` FR1).
or floor the bounded maximum with standInMaximum too.
|
/approve-spec 4e59caf |
There was a problem hiding this comment.
Approved pending CI: build, test and docsite-test are deferred on this head and run before merge.
AR7 in module:Table/useTableColumnResize is now approved by an engineering owner at this head, and no blocking finding remains: an unbounded column's resize handle reads 250 of 1280 with "250 pixels" in Chromium's accessibility tree, where main reads 100 of 100.
Non-blocking:
- AR7 says the announced maximum is never below the value, but a column with
maxWidth500 and acolumnWidthsentry of 600 still announces 600 of 500, as onmain; scope that sentence to a column with no maximum, or floor the bounded maximum too.
[Automated review]
The base branch merged as one squash commit, so this merge takes main's tree and reapplies only this change's own diff on top of it.
…dth (#10593) * fix(Table): an unbounded column's resize handle announces a range that holds its width A column-resize separator on a column with no maximum width rendered no aria-valuemax, so assistive technology assumed ARIA's default of 100 and read the width past it. Such a handle now announces the window's inline extent as its maximum, floored at its value and minimum, as an unbounded Resizable region does, and its width in words ("133 pixels"), since that maximum stands in for a missing limit. The server render carries no maximum until hydration reads the window. A column with maxWidth is unchanged. Record: useTableColumnResize AR7 and its verification row. Adds the @astryx.table.columnResize.widthValue catalog string. * fix(Table): a column resize handle announces the column's rendered width Until a column was first resized, its handle's aria-valuenow was the column's minimum width, so a screen reader read a 200px column as 60px. The handle now reads its column's width from the shared resize observer after layout (never in render) and announces it, following the column as it is resized; until the first measurement it falls back to the width the table asked for, then the minimum. Record: useTableColumnResize AR8 and its verification row; a jsdom case and a Chromium accessibility-tree case. * fix(Table): one shared window-width store; plural value text; record Addresses review on the separator range: - The window width every unbounded handle announces comes from one shared store in utils/windowExtent.ts, with one resize listener and a stable snapshot, so render and commit read no layout (INV18). Resizable's stand-in maximum calls the same readWindowExtent and standInMaximum, so the two share one rule; its behavior is unchanged. - The value text is plural-aware: "{width, number} {width, plural, one {pixel} other {pixels}}". - Record: AR1 points at AR7 for the value bounds; Compatibility records the changed announced range; AR7 says the handle announces its value in words and names the known gap (the value is the minimum until a first resize). The changeset says the same. * Merge branch 'fix/table-resize-separator-range' into fix/table-resize-rendered-width Takes #10577's review round (shared window-width store, plural value text, AR1/AR7 record). AR7 drops its known-gap sentence: AR8 closes it. * review: the width store follows a root observation; whole-pixel value text - The window-width store is fed by the shared resize observer on the root element and reads innerWidth inside its report, so no resize event reads layout (INV18). The snapshot stays stable. - The value text says a whole number of pixels: a 202.656 px column reads "203 pixels". Tests: no window resize listener, and the fractional case. * review: the announced range holds the rendered width; ref-owned observation - A column the layout renders past its maxWidth, or under its minWidth, announces a range widened to hold the width it reports: aria-valuemax is at least the value, aria-valuemin at most. Test: a 180 px column under maxWidth 150 (fails on the previous head, where max stayed 150). - The header cell's resize observation lives in a stable callback ref on the separator that returns its unsubscribe, not a mount-only Effect. - Record: AR7 says what a column rendered past its limits announces; the compatibility bullet names AR8's value change; the AR8 verification row gives the Chromium case two ArrowRight presses, which the spec now runs. - The changeset covers the bounded case. * Merge #10577 (root-observer width store, whole-pixel value text) into the rendered-width fix * changeset: drop the "until first resized" sentence, which this PR replaces This stack ships both changesets; the rendered-width fix here makes the separator-range note's "until a column is first resized, that value is still its minimum width" untrue, so it goes. * Merge branch 'main' into fix/table-resize-separator-range * Merge main into the Table resize range announcement main moved Resizable's warnings to per-instance createDevWarnings and made QUIET null (#10655). This branch moves readWindowExtent to utils/windowExtent; the merge keeps both. * Merge the updated range announcement (with main) into the rendered-width change * docs(Table): name the fallback maximum as assistive technology's, not a default * Merge the reworded range announcement record into the rendered-width change * Merge main (with #10577 squash-merged) into the rendered-width change The base branch merged as one squash commit, so this merge takes main's tree and reapplies only this change's own diff on top of it.
Who this helps
Screen-reader users resizing Table columns. A column with no maximum width rendered its resize handle with no
aria-valuemax, so ARIA's default maximum of 100 applied. In Chromium's accessibility tree, a column widened to 250px read as 100, its maximum, and every further step read the same (spec:AST-020FR1).What changed
@astryx.table.columnResize.widthValue("{width} pixels").maxWidthkeeps its maximum and gets no value text.component:useTableColumnResizegains AR7 and a verification row.Changeset:
[fix]patch for Core.Not in this PR: before a column is first resized, the handle's value is its minimum width rather than its rendered width, as on main.
Verification
Real Chrome (local Storybook builds of main 209e067 and this branch,
Core/TableColumnResizeDefault story, read from Chromium's accessibility tree over CDP):Tests:
useTableColumnResize.test.tsx"an unbounded column announces a finite maximum, never below its value, and its width in words". It fails on main with noaria-valuemax.TableColumnResizeRange.a11y.chromium.spec.tsreads the same from Chromium's accessibility tree in pr-a11y.Other checks: lint, knowledge,
check:i18n-catalog,check:i18n-runtime, changesets, and the prepush typecheck.Writing rubric results
Covers
component:useTableColumnResizeAR7 and its verification row.R1 narration: none; the line states what the handle announces.
R2 research: none in the record; the measurements are here.
R3 evidence: the verification cell names tests, not pull requests.
R4 rejected alternatives: none recorded.