Repository navigation
fix(SideNav): the resize handle names the nav it resizes with aria-controls - #7473
Conversation
…ntrols APG Window Splitter requires the separator to reference the primary pane (component:Resizable AR1 implementation gap). SideNav is the shipped composition of a pane and a ResizeHandle, so it gives the nav an id (a consumer's id wins) and passes aria-controls to the handle. Red-armed tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression44 of 448 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 24 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Approval is on hold until a maintainer provides or identifies a current spec claim on main that adopts the APG Window Splitter aria-controls relationship for SideNav's resize handle: today spec:AST-020 ends at FR14 and component:Resizable is a draft without AR1, while the proposed FR15 and AR1 are still in open #7458 and #7464. Separately, one fix is needed before this can land:
- The nav's
id={navId}is set before{...props}, so a wrapper that forwardsid={undefined}erases the nav'sidwhile the handle keepsaria-controlspointing at the generated id; movingid={navId}after{...props}and adding a test for that case fixes it.
[Automated review]
| const navElement = ( | ||
| <nav | ||
| ref={mergedNavRef} | ||
| id={navId} |
There was a problem hiding this comment.
{...props} (L625) is spread after this id, so a caller that forwards id={undefined} (for example a wrapper passing its own optional id through) erases the nav's id while the handle keeps aria-controls={navId}, which then references no element. Setting the id after the spread fixes it; a regression test rendering <SideNav resizable id={undefined}> should assert that the reference resolves.
{...props}
id={navId}>…id={undefined} cannot erase it
There was a problem hiding this comment.
Approval is on hold until a maintainer provides or identifies a current spec claim on main that adopts the APG Window Splitter aria-controls relationship for SideNav's resize handle (and the <nav> id it points at): today spec:AST-020 ends at FR14 and component:Resizable is a draft without AR1, while the proposed FR15 and AR1 are still in open #7458 and #7464. The earlier id={undefined} issue is fixed — the nav's id now follows the prop spread and has a regression test — and this review found no other change needed.
[Automated review]
…rols gap this fix closes" This reverts commit 87f76e3.
There was a problem hiding this comment.
No changes are requested: the resize handle's aria-controls and the <nav> id it points at follow the APG Window Splitter relationship that spec:AST-020 FR15 adopts, which is current on main. The three new tests in SideNav.test.tsx cover the generated, caller-supplied and forwarded-undefined id cases, and the earlier id={undefined} issue stays fixed. One thing for release notes and consumers: every default-mode SideNav <nav> now renders a generated id when none is passed, so DOM snapshots may change.
[Automated review]
…aria-valuemax (#7481) ## What changes for users A screen-reader user on a `ResizeHandle` whose region sets no `maxSize` hears a maximum instead of an open-ended range: the separator reports `aria-valuemax` as the basis the hook already measures and clamps against — the window extent on the region's axis (height for a vertical region: the released no-container basis is the window *width* on both axes, so a vertical region used to announce the wrong extent), or the container's content box while a percentage bound already observes it. It never falls below the current size (a pane larger than the window reports itself as the maximum) nor, while collapsed, below `aria-valuemin`. Scope, per the maintainers' 2026-10-13 ruling (option B, no new observation): pixel-only regions inside a container still report no maximum — measuring one would add an observer to an atomic pixel path (`component:Resizable` Performance). **End movement for an unbounded region is not in this PR**: End still moves only to a configured maximum, and the record keeps that gap for a later change. ## Shape - `useResizable.ts`: computes the stand-in (`windowExtent` via `useSyncExternalStore`, hydration-safe; measured container basis when observed; floors at size / resolved min while collapsed) and registers it in a module-private `WeakMap` keyed by the returned props object. `getEffectiveMaxPx` (this module only; not re-exported) hands it to the handle. `ResizableProps` is exactly as released (`architecture:knowledge-contracts` INV11). - `ResizeHandle.tsx`: `aria-valuemax` = configured max, else the registered stand-in; End unchanged from `main`. - One commit on top of #7479 (no merge commits); merges after it. ## Tests (red on #7479's head, green here) `ResizeHandle.test.tsx`: "reports the window basis as aria-valuemax when no maximum is configured; End leaves an unbounded region alone", "never reports a maximum below the current size, and End does not shrink the region", "never reports aria-valuemax below aria-valuemin while collapsed in a small window", "reports the window height, not the width, for an unbounded vertical region", "reports the container basis as aria-valuemax while a percentage bound already observes it", plus the pixel-only-in-container case stays unreported. ## Record Code-only by the maintainers' ruling for the Resizable trio (#7479 → #7481 → #7473); the combined Resizable record PR that follows narrows the `aria-valuemax`/End gap to "pixel-only regions in a container report no maximum; End does not move an unbounded Handle".
…trols fixes (#7510) ## Record change `component:Resizable` (draft) AR1 and its decision entry catch up with the three fixes now on `main` — #7479 (Enter and double-click restore the previous size, and reopen below the collapse threshold), #7481 (an unbounded Handle reports a measured stand-in as `aria-valuemax`), #7473 (SideNav passes `aria-controls`) — so record and code say the same thing. - Deleted: the two Enter gaps (reopen at the minimum; no reopen below `collapsedSize`). - Added before the gaps: "An unbounded Handle reports a measured stand-in as `aria-valuemax`: the window's extent along its axis when no container is supplied, or its container's content box while a percentage bound observes it, never below its current size or, while collapsed, its minimum." - Gaps now: "the Handle names the pane it resizes with `aria-controls` only when its caller passes one (SideNav does); an unbounded Handle in a container that no percentage bound observes carries no `aria-valuemax`, because measuring that container would add an observer to a region whose bounds are all in pixels (Performance and resources); End does not move an unbounded Handle; and a plain arrow cannot reopen a collapsed pane whose `collapsedSize` (40 px by default) is larger than one 10 px step." The last gap is the Window Splitter binding's `bare-start-collapsed` known failure (#7485); its fix follows this record. - DEC: the gap list matches. - AR1 verification row: adds the fix tests, all verified on `main` — `ResizeHandle.test.tsx` "restores the previous size, not the minimum, when Enter reopens a collapsed pane", "reopens on Enter even when the minimum size sits below the collapse threshold", "reports the window basis as aria-valuemax when no maximum is configured; End leaves an unbounded region alone", "reports the container basis as aria-valuemax while a percentage bound already observes it", "never reports aria-valuemax below aria-valuemin while collapsed in a small window", "reports no aria-valuemax for an unbounded pixel-only region in a container, which stays unobserved"; `SideNav.test.tsx` "names the nav it resizes with aria-controls (APG window splitter)"; `aria-controls` leaves the pending-contract clause. ## Full pass against `main` Every AR1 claim re-read against `ResizeHandle.tsx`/`useResizable.ts` on `main`: role/name/orientation/value properties, `aria-valuetext` while collapsed, `aria-disabled`, arrow directions and RTL mirroring, Shift step, Home/End, Enter collapse/restore (now true), the stand-in maximum (true per #7481), and each remaining gap (true: `aria-controls` is caller-supplied; pixel-only-in-container reports none; End uses only a configured maximum; a plain arrow on a collapsed pane stays at the minimum — reproduced in jsdom). Existing verification titles re-checked. Frontmatter, FR1–FR6, ORD and OQ1 unchanged. ## Writing rubric results R1 narration: none; AR1 and the decision stay present tense (the two fixed gaps are deleted, not rephrased as history). R2 research: none in the record. R3 evidence: the verification cell cites test titles and the pending contract, not pull requests. R4 rejected alternatives: none added. R5 change references: none. R6 open questions: unchanged — OQ1 (Handle `direction` target-state reflection) keeps its question.
Problem
A screen-reader user on SideNav's resize handle heard a separator with a name and value but no relationship to what it resizes. APG Window Splitter requires the separator to reference its primary pane with
aria-controls;component:ResizableAR1 (Window Splitter adoption underspec:AST-020FR15, #7464) names this as the implementation gap it closes.Fix
ResizeHandlealready passesaria-controlsthrough ({...props}, ResizeHandle.tsx L670;BasePropscarries the ARIA attributes), and SideNav is the one shipped composition in the repository that renders both a pane and a ResizeHandle (LayoutPanel documents the pairing but renders no handle; Table's columnResizeHandleis a different local component). SideNav now gives its<nav>an id — a consumer'sidwins, otherwiseuseId()— and passesaria-controls={navId}to the handle. No visual or behavioural change.Evidence
SideNav.test.tsx: "names the nav it resizes with aria-controls" and "keeps a consumer's nav id and points the handle at it". Red arm: both fail withSideNav.tsxreverted to main; 204/204 with the fix. tsc, eslint (hook order kept), Prettier clean.Changeset
@astryxdesign/corepatch[fix].Not done here
Enter reopening a collapsed pane at its minimum rather than its previous size is recorded in the Resizable record as a gap only: restoring the previous size is optional in the pattern.
Record
Code-only by the maintainers' ruling: the Resizable trio (#7479 → #7481 → #7473) merges without record edits, and one Resizable record PR then deletes or narrows all three AR1 gaps together.