Repository navigation
fix(Table): a column resize handle announces the column's rendered width - #10593
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.
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c88e1cf |
There was a problem hiding this comment.
Requesting changes: unbounded columns now announce their real width (200 instead of 60 in the Default story), but three things need fixing first.
- A column rendered wider than
maxWidth, or narrower than a globalminWidth, now gets anaria-valuenowoutside itsaria-valuemin/aria-valuemax, and Chromium then announces the limit instead (300 for a 416px column with min 80 and max 300), so keep the announced range holding the value, or say in AR8 what such a column announces, and add a test withmaxWidthbelow the rendered width. - The changeset says the handle "now announces its column's rendered width", which does not hold for bounded columns until the first point is fixed, so fix that or narrow the wording to columns within their limits.
- The new mount-only
useEffectinResizeHandledoes only attach-time work, so move it to a stable callback ref on the separator that subscribes the header cell withobserveResizeand returns the unsubscribe, and drophandleRef.
Non-blocking: the comment above valueNow is one 31-word sentence; two shorter sentences would keep it under the 25-word limit.
[Automated review]
| // A focusable role="separator" requires a numeric aria-valuenow, so it | ||
| // falls back to the width the table asked for, then to the column's | ||
| // minWidth, until the column has been measured. |
There was a problem hiding this comment.
Non-blocking: one 31-word sentence, over the 25-word limit for a description. Suggested: "A focusable separator needs a numeric aria-valuenow. Until the column is measured, it uses the requested width, else minWidth."
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.
…-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.
|
/approve-spec 0944bd4 |
There was a problem hiding this comment.
Requesting changes: unbounded and in-limit columns now announce their real width (200 instead of 60 in the Default story), but the three fixes from the previous review are still needed.
- A column rendered wider than
maxWidth, or narrower than a globalminWidth, gets anaria-valuenowoutside itsaria-valuemin/aria-valuemax(useTableColumnResize.tsx:811), so Chromium announces 300 for a 416px column undermaxWidth: 300; keep the range holding the value, or have AR7 and AR8 say what such a column announces, and add a bounded test case. - The changeset (
.changeset/table-resize-rendered-width.md:5) promises every handle announces its column's rendered width, which bounded columns do not get until the first fix lands, so fix that or narrow the wording. - The mount-only Effect at
useTableColumnResize.tsx:429-442only subscribes the header cell when the handle attaches, which is a ref's job under react-component-runtime INV6: use a stable callback ref on the separator (:827) that returns the unsubscribe, and drophandleRef.
When you edit the record, also name AR8's value change in its compatibility bullet, and give the "after keyboard resizes" state in the AR8 verification row an arrow-key step in the Chromium case.
[Automated review]
… 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.
…vation - 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.
… the rendered-width fix
…laces 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.
|
/approve-spec c500071 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet (the pull request is a draft against the stacked branch), so it is not ready to merge, and it lands after #10577.
Every resizable column's handle now announces its rendered width inside a range that holds it, and the three changes from the previous review are in: a column stretched past maxWidth or squeezed under its minimum announces its width (416 for a 416px column under maxWidth: 300), the changeset matches that, and the header cell is observed from the separator's callback ref. The new unit and Chromium tests fail on the base and pass here.
Non-blocking suggestions:
- Add a unit case with
minWidthabove the measured width: removing theMath.minclamp onaria-valueminstill passes every current test. - In the record, list the new minimum clause and the past-limits test in AR7's verification row.
- Update the description's "What changed" and writing-rubric results to cover the AR7 amendment and the range widening.
- Tighten the comments at
useTableColumnResize.tsx:425-427and:808-810(inline).
[Automated review]
| }; | ||
| }; | ||
| try { | ||
| render(<ResizeTable minWidth={60} maxWidth={150} />); |
There was a problem hiding this comment.
Non-blocking: with minWidth={60} and 180px cells, the aria-valuemin <= 180 assertion holds with or without Math.min(minWidth, valueNow), so removing that clamp still passes all 50 tests. Add a case with minWidth above the measured width, for example minWidth={250} with 180px cells, expecting aria-valuemin="180".
| // The column's rendered width, which the handle announces. The shared | ||
| // resize observer reports it after layout, so render never reads layout. | ||
| // The handle's ref observes its header cell while the handle is attached. |
There was a problem hiding this comment.
Non-blocking: the third sentence narrates the ref, and "reports it after layout" leaves out that the first value comes from one getBoundingClientRect read when the ref attaches. Suggested: "Render never reads layout. The shared resize observer reports the width. Its first call, at attach, reads the cell once."
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.
|
/approve-spec 3278cd8 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet (the pull request is a draft against the stacked branch), so it is not ready to merge, and it lands after #10577.
Every resizable column's handle announces its rendered width inside a range that holds it. The newest commit only merges the updated base branch: the new unit and Chromium tests still fail on the base and pass here, and the spec changes carry an engineering owner's approval for this head.
Non-blocking suggestions:
- Add a unit case with
minWidthabove the measured width: removing theMath.minclamp onaria-valueminstill passes every current test. - In the record, list the new minimum clause and the past-limits test in AR7's verification row.
- Update the description to cover the AR7 amendment and to name the record
module:Table/useTableColumnResize. - Tighten the comments at
useTableColumnResize.tsx:425-427and:808-810(open inline threads).
[Automated review]
|
/approve-spec 4ba5ee3 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is still a draft.
Every resizable column's handle now announces its rendered width inside a range that holds it, and the record changes carry an engineering owner's approval for this head.
Before this can land:
- Merge
maininto the branch. Since #10577 landed, the branch conflicts withmainin five files;mainholds #10577's final version of each, so keeping this branch's side leaves only this change. The merge makes a new head, which needs a fresh/approve-spec <full head SHA>from an engineering owner (the author may post it as one) and a new review. - Mark the pull request ready for review so CI runs.
Non-blocking suggestions:
- Add a unit case with
minWidthabove the measured width: removing theMath.minclamp onaria-valueminstill passes every test. - List AR7's new minimum and past-maximum clauses in AR7's own verification row.
- Update the description: drop the "Stacked on #10577" note, use the record id
module:Table/useTableColumnResize, and mention the AR7 amendment.
[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.
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) | — | ✓ · ✓ · ✗ |
5 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TableRow | 7.0 kB (0) · 4.0 kB CSS (0) | — | ✓ · ✓ · ✗ |
| Table | 124.9 kB (0) · 18.3 kB CSS (0) | — | ✓ · ✓ · — |
| TableCell | 109.6 kB (0) · 17.9 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableHeaderCell | 109.2 kB (0) · 17.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| TableSelectionToolbar | 70.7 kB (0) · 13.2 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.20 MB packed (+507 B); 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.
Approved. Every resizable column's handle now announces the column's rendered width from the first layout (200 instead of 60 in the Default story), and its range widens to hold a column the layout renders past its limits. The new unit test and Chromium spec fail on main and pass here, and the record's AR8 and amended AR7 carry an engineering owner's spec approval for this text.
Non-blocking:
- Removing the
Math.minclamp atuseTableColumnResize.tsx:823still passes every test; a case withminWidth={250}and 180px cells, expectingaria-valuemin="180", would guard it. - AR7's verification row could name the new minimum and past-maximum clauses and their tests.
- The description still asks reviewers to review #10577 first, names the record
component:useTableColumnResizeinstead ofmodule:Table/useTableColumnResize, and its main column predates #10577.
[Automated review]
|
/approve-spec e715473 |
Who this helps
Screen-reader users resizing Table columns. Until a column was first resized, its resize handle announced the column's minimum width as its value: in Chromium's accessibility tree on main, a 200px column read as 60 (
spec:AST-020FR1).Stacked on #10577 (the handle's range); review that first.
What changed
borderBoxSize, or one read in the observer's first call). Render never reads layout.component:useTableColumnResizegains AR8 and a verification row.Changeset:
[fix]patch for Core.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"announces its column's rendered width before any resize, not the minimum". It fails on fix(Table): an unbounded column's resize handle announces a range that holds its width #10577's head, where the value is the minimum.TableColumnResizeRange.a11y.chromium.spec.ts"a handle announces its column's rendered width before any resize" compares the accessibility tree with each header cell's width.Other checks: lint, knowledge, and the prepush typecheck.
Writing rubric results
Covers
component:useTableColumnResizeAR8 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.