Repository navigation
fix(ResizeHandle): a grow arrow reopens a collapsed pane - #7512
Conversation
…arrow leaves it collapsed One keyboard step (10px) is smaller than the collapse threshold (40px by default), so a grow arrow on a collapsed pane used to change nothing (APG Window Splitter: the arrows move the separator). The grow arrow now reopens the pane through the hook's restore (its previous size), the same path Enter uses; a hand-built region falls back to its minimum. The shrink arrow on a collapsed pane is a no-op. Three red-armed tests, incl. reversed + RTL.
…drops its gap; DEC and verification follow
|
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 |
… its minimum (ruling a); Enter keeps restore-previous-size
…its collapsedSize
|
/approve-spec 43196c2 |
There was a problem hiding this comment.
The fix works as described, and the new keyboard tests fail on main and pass with this change. One change is needed before approval: the only direction test sets isReversed and RTL together, where the two flips cancel, so it would still pass if the collapsed branch ignored direction entirely. Please add a reversed case in LTR and an RTL case without isReversed (ArrowRight leaves the pane collapsed, ArrowLeft opens it at 110) and cite them in the AR1 verification row.
[Automated review]
| expect(separator).toHaveAttribute('aria-valuenow', '50'); | ||
| }); | ||
|
|
||
| it('a grow arrow opens a collapsed pane in the reversed layout and under RTL too', () => { |
There was a problem hiding this comment.
This test sets isReversed and RTL in the same render, so grows() multiplies −1 by −1 and ArrowRight grows exactly as in the default layout. It, and the rest of the suite, still passes when the collapsed branch ignores direction entirely. Please add the two single-flip cases, where ArrowLeft is the growing arrow; for example:
it('a grow arrow opens a collapsed end-side pane with ArrowLeft', () => {
render(
<Harness
config={{defaultSize: 200, minSize: 100, maxSize: 400, collapsible: true}}
handleProps={{isReversed: true}}
/>,
);
const separator = getSeparator();
act(() => separator.focus());
fireEvent.keyDown(separator, {key: 'Enter'});
fireEvent.keyDown(separator, {key: 'ArrowRight'});
expect(separator).toHaveAttribute('aria-valuetext', 'Collapsed');
fireEvent.keyDown(separator, {key: 'ArrowLeft'});
expect(separator).toHaveAttribute('aria-valuenow', '110');
});and the same under RTL without isReversed, then cite both in the AR1 verification row.
…rections, each on its own
|
/approve-spec 8d68457 |
There was a problem hiding this comment.
This change looks ready to approve: the arrow that grows a collapsed pane now reopens it one step above its minimum (or at collapsedSize when that is larger), the shrinking arrow stays inert, and the new keyboard tests fail on main, pass here, and now include separate reversed-only and RTL-only cases, which resolves the earlier request. Before merging, coordinate with #7485 so that whichever lands second drops its bare-start-collapsed known-failure row, and consider updating the description's Authority paragraph, which still says "regardless of collapsedSize".
[Automated review]
…7512), so its known-failure row goes
## What this proves `component:Resizable` AR1 (the Window Splitter adoption recorded in #7464 under `spec:AST-020` FR15) now has an executable contract and a binding. A keyboard or screen-reader user on a resize handle gets: a named separator that states its position and bounds, says which axis it lies along, names the pane it resizes, moves by a step with the arrows (the inline arrows following the reading direction under RTL, and flipping with `isReversed`), collapses and restores the pane with Enter, jumps to the bounds with Home/End, and — when disabled — is exposed `aria-disabled` and does not move (its Tab-order removal is the component's own test, outside this contract). Test-only: no runtime, docs, or Changeset. Enforcement follows `spec:AST-020` FR9: APG-required parts are `required`; Home/End (optional in APG) are `advisory` (End is compared against the `aria-valuemax` the separator exposes, or the minimum Home reached when none is exposed) until AR1 is current. ## Expectations (AST-020 FR13) | Expectation | Sources | Layer | Enforcement | | --- | --- | --- | --- | | `windowsplitter.separator.role-and-name` | WCAG 4.1.2, APG Window Splitter, APG Window Splitter | accessibility-tree | required | | `windowsplitter.separator.position-and-minimum` | WCAG 4.1.2, APG Window Splitter | dom | required | | `windowsplitter.separator.maximum` | WCAG 4.1.2, APG Window Splitter | dom | required | | `windowsplitter.separator.orientation` | WCAG 4.1.2, APG Window Splitter | dom | required | | `windowsplitter.separator.controls-pane` | WCAG 1.3.1, APG Window Splitter | dom | required | | `windowsplitter.keys.arrows-move` | WCAG 2.1.1, APG Window Splitter | real-browser | required | | `windowsplitter.keys.enter-collapses-and-restores` | WCAG 2.1.1, APG Window Splitter | real-browser | required | | `windowsplitter.keys.home-end` | WCAG 2.1.1, APG Window Splitter | real-browser | advisory | | `windowsplitter.separator.unavailable-keeps-position` | WCAG 4.1.2, APG Window Splitter | real-browser | required | Exemptions: `1.1.1-non-text-content` → the binding component; `1.3.1-info-and-relationships` → the binding component and composing page (remainder only); `1.3.2-meaningful-sequence` → the binding component and composing page; `1.3.5-identify-input-purpose` → the binding component; `1.4.1-use-of-color` → the binding component and theme; `1.4.3-contrast-minimum` → the binding component and theme; `1.4.11-non-text-contrast` → the binding component and theme; `2.1.1-keyboard` → the composing page (remainder only); `2.1.2-no-keyboard-trap` → the binding component and composing page; `2.4.2-page-titled` → the page; `2.4.3-focus-order` → the composing page; `2.4.4-link-purpose` → the binding component; `2.4.6-headings-and-labels` → the binding component and caller content (remainder only); `2.4.7-focus-visible` → the binding component and theme; `2.4.11-focus-not-obscured` → the composing page; `2.5.2-pointer-cancellation` → the binding component; `2.5.3-label-in-name` → the binding component; `2.5.8-target-size` → the binding component and theme; `3.1.1-language-of-page` → the page; `3.2.2-on-input` → the caller and composing page; `3.2.4-consistent-identification` → the composing page; `3.3.1-error-identification` → the binding component and composing page; `3.3.2-labels-or-instructions` → the binding component and composing page; `4.1.2-name-role-value` → the binding component (remainder only); `4.1.3-status-messages` → the caller and the assistive-technology verification record, spec:AST-009; `apg-interaction` → the binding component's record (remainder only); `forced-colors` → the binding component and theme; `reduced-motion` → the binding component and theme; `at-facing-strings` → the binding component and caller content ## Known failures (exact records, reconciled in both lanes) | Binding / state | Expectation | Exact failure | User impact | Authority / fix | | --- | --- | --- | --- | --- | | `ResizeHandle` / `bare-unbounded-in-container` | `windowsplitter.separator.maximum` | `the splitter exposes no aria-valuemax` | A screen-reader user on a pixel-only region inside a container with no maximum hears no maximum. | `component:Resizable` AR1's recorded gap (measuring the container would add an observer to an all-pixel region — Performance and resources); closes only with a record decision. | | `ResizeHandle` / `bare-snapped` | `windowsplitter.keys.arrows-move` | `ArrowRight (grow) left aria-valuenow at 200, not 210` | A keyboard user on a region with snap points presses an arrow and nothing happens: a 10 px step snaps back to its starting point. | `component:Resizable` AR1 (arrows move the splitter); moving to the adjacent snap point is a component decision for its own spec-backed patch. | | `ResizeHandle` / `bare-documented-usage` | `windowsplitter.separator.controls-pane` | `the splitter carries no aria-controls` | A screen-reader user on a handle rendered the documented minimal way hears a separator with no named pane. | `component:Resizable` AR1's recorded gap (the Handle names the pane it resizes with `aria-controls` only when its caller passes one; SideNav does); a component decision for its own spec-backed patch. | ## Shape - `internal/a11y-spec/src/patterns/window-splitter.ts` — `WINDOW_SPLITTER_PATTERN`, 9 expectations with WCAG and APG sources (APG Window Splitter wording verified against the published pattern on 2026-10-13); every other checklist dimension exempted to a named owner. - `window-splitter.fixtures.ts` — HTML splitter between two panes whose `<script>` implements the keyboard model; every expectation has a violating twin (`WINDOW_SPLITTER_MUTATIONS`). - `window-splitter.jsdom.test.ts` (36 cases) and `window-splitter.chromium.spec.ts`. - No harness change: `Home`/`End`/`PageUp`/`PageDown` are already on `main`. - `packages/core/src/Resizable/__tests__/ResizeHandle.a11y.{states,renders,known-failures,test}.tsx` and `ResizeHandle.a11y.chromium.spec.ts` — twelve states: bare horizontal, bare vertical (ArrowDown grows), reversed (ArrowLeft grows), RTL (ArrowLeft grows), collapsible, collapsible with `minSize` 20 below `collapsedSize` 50 (Enter reopens it since #7479), a pane that starts collapsed (`defaultIsCollapsed`; announces the minimum; the grow arrow opens it since #7512, and the collapse-and-restore row, which assumes an open pane, does not apply), unbounded (window stand-in since #7481), unbounded pixel-only with a `containerRef` — the first `useResizable` example — which reports no maximum (exact known failure backed by the record's gap), snapped (`snaps` [100, 200, 300, 400]; a 10 px arrow step snaps back, recorded as an exact known failure on the arrows row), the documented minimal usage with no `aria-controls` passed (exact known failure on the pane-relationship row, backed by the record's gap), disabled. SideNav is excluded (`sidenav-binding`): it hides its handle while collapsed, so it binds separately with states shaped for that.- `apps/storybook/stories/WindowSplitterA11y.stories.tsx` — one `no-visual` story per state through `renderResizeHandleState`. - `.github/workflows/ci.yml` — "Run Window Splitter accessibility contract" step; scope decided through `pr-scope-touches.sh` from the base; runs when Resizable, the harness, the stories, or the contract change (SideNav is not watched: it is excluded from this binding). - README row and index export. ## Source lines behind the binding facts `role="separator"`, `aria-orientation` = `vertical` for a horizontal layout (ResizeHandle.tsx L693–694), `aria-valuemax` from a configured maximum or the reported stand-in (window extent, or the container's content box while a percentage bound observes it; a pixel-only region in a container reports none), `aria-valuetext` "Collapsed" while collapsed (L698), `tabIndex` −1 and `aria-disabled` when disabled (L700), props spread accepts `aria-controls` (L730); keys: ArrowRight/Down `+step·rtl·sign`, ArrowLeft/Up the inverse (`KEYBOARD_STEP` 10 at L58, `getRTLMultiplier` L450; the shared arrow branch from L563 opens a collapsed pane on the grow arrow since #7512), Home to min, End only to a configured maximum (L606–623); Enter and double-click collapse and restore through the hook's own transitions (`toggleCollapse` L375; #7479 on `main`). The three known failures are `bare-unbounded-in-container` (no `aria-valuemax` for a pixel-only region in a container; the record's owned gap), `bare-snapped` (an arrow step snaps back; fix in flight) and `bare-documented-usage` (no `aria-controls` unless the caller passes one; the record's owned gap). ## Ownership exclusions `RESIZE_HANDLE_EXCLUSIONS`: SideNav binding (hides its handle while collapsed; binds separately); pointer drag model (pointer capture, foreign-pointer moves ignored, pointercancel/lost-capture ending, double-click collapse and restore, grab-zone geometry — proven by `ResizeHandle.test.tsx`'s jsdom pointer suites; ResizeHandle has no Escape cancel and no Chromium pointer suite); F6 pane cycling (optional, not adopted). ## Retained local tests (AST-021 FR6, FR14) `ResizeHandle.test.tsx` keeps its role, value-property and keyboard assertions. Removal blocker: `component:Resizable` is `draft` and its AR1 verification row cites these titles (including the Enter-restore and aria-valuemax tests the merged fixes added); the duplicates come out with the record pass that makes the record current, once this binding is on `main` and cited instead. ## Evidence - Vitest Resizable directory green (incl. 16 binding cases, known failures matched); pattern jsdom self-test 36/36; tsc (core, a11y-spec, storybook), eslint, Prettier, use-client, visual-workflow-owner clean. - Real Chromium: the CI step on this PR runs the fixture self-test (conforming pass, every mutation fails) and the twelve binding states, reconciling the three known failures exactly (the two Enter-restore rows were emptied when #7479 landed and the unbounded `aria-valuemax` row when #7481 landed).
What changes for users
A keyboard user on a collapsed
ResizeHandlepane presses the arrow that grows it and the pane opens one step above its minimum — the value the separator announced while collapsed (100 → 110), or at itscollapsedSizewhen that is larger — where one bare 10 px step used to stay below the 40 px collapse threshold and change nothing (APG Window Splitter: the arrow moves the separator from where it is). The arrow that shrinks it leaves it collapsed. Enter and double-click still restore the previous size.Authority
Path (a):
spec:AST-020FR15 (current) plus the owner's 2026-10-13 adopt-and-patch approval for ResizeHandle's APG Window Splitter adoption; the maintainers' ruling (a) on 2026-10-13: the grow arrow opens a collapsed pane one step above its minimum regardless ofcollapsedSize; the shrink arrow stays a no-op; Enter keeps restore-previous-size.component:ResizableAR1 recorded the gap in #7510.Shape
ResizeHandle.tsx: the four arrow keys share one branch; on a collapsed pane only the grow direction (afterisReversedand RTL) acts:_onResizeStart(); _onResizeMove(Math.max(_minSizePx + step, _collapsedSize)); _onResizeEnd(), which uncollapses the region and lands at min + step (or the threshold when that is larger) for hook-built and hand-built regions alike. Open panes step as before.main): "a grow arrow opens a collapsed pane one step above its minimum; the shrink arrow leaves it collapsed", "a grow arrow opens a collapsed pane at its collapsedSize when the minimum sits below it", "a grow arrow opens a collapsed pane in the reversed layout and under RTL too", "in a reversed layout, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "under RTL, ArrowLeft opens a collapsed pane and ArrowRight leaves it collapsed", "a grow arrow opens a hand-built collapsed region one step above its minimum". Resizable + SideNav: 367/367.Record
Per the fix-PR rule,
component:ResizableAR1 states the behaviour ("…and the arrow that grows a collapsed pane opens it one step above its minimum, or at itscollapsedSizewhen that is larger (the shrinking arrow leaves it collapsed)"), the gap sentence and the decision drop "a plain arrow cannot reopen a collapsed pane…", the pending-contract clause drops the collapsed-pane arrow gap, and the AR1 verification row cites the three new titles.Order
Merges after #7485 and empties its
bare-start-collapsedknown-failure row (if #7485 merges first, that row is removed here instead).Writing rubric results
R1 narration: none; AR1 and the decision stay present tense (the gap is deleted, not rephrased as history).
R2 research: none in the record.
R3 evidence: the verification cell cites test titles, not this pull request.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: unchanged.