Skip to content

fix(SideNav): the resize handle names the nav it resizes with aria-controls - #7473

Merged
cixzhang merged 5 commits into
mainfrom
fix/resizehandle-aria-controls
Oct 14, 2026
Merged

cixzhang merged 5 commits into
mainfrom
fix/resizehandle-aria-controls

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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:Resizable AR1 (Window Splitter adoption under spec:AST-020 FR15, #7464) names this as the implementation gap it closes.

Fix

ResizeHandle already passes aria-controls through ({...props}, ResizeHandle.tsx L670; BaseProps carries 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 column ResizeHandle is a different local component). SideNav now gives its <nav> an id — a consumer's id wins, otherwise useId() — and passes aria-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 with SideNav.tsx reverted to main; 204/204 with the fix. tsc, eslint (hook order kept), Prettier clean.

Changeset

@astryxdesign/core patch [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.

…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.
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 13, 2026 10:38pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 13, 2026
@astracat-bot

astracat-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 14, 2026, 3:15 AM UTC

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

44 of 448 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 238,081
Chat Full AI Chat probe dark 237,048
Markdown Default probe light 159,625
Markdown Default probe dark 158,986
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
TableRowExpansion Detail Panel neutral dark 5,150
TableRowExpansion Detail Panel neutral light 4,068

and 24 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 forwards id={undefined} erases the nav's id while the handle keeps aria-controls pointing at the generated id; moving id={navId} after {...props} and adding a test for that case fixes it.

[Automated review]

Comment thread packages/core/src/SideNav/SideNav.tsx Outdated
const navElement = (
<nav
ref={mergedNavRef}
id={navId}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{...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}>

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

cixzhang added a commit that referenced this pull request Oct 14, 2026
…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".
@cixzhang
cixzhang merged commit 13ae375 into main Oct 14, 2026
56 checks passed
cixzhang added a commit that referenced this pull request Oct 14, 2026
…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.
@github-actions
github-actions Bot deleted the fix/resizehandle-aria-controls branch October 14, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 2129d49a Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant