Repository navigation
fix(List): disable the reorder hint's move past either end - #11680
georgegiosue wants to merge 2 commits into
Conversation
Move up is disabled while the row in reorder mode is first, and Move down while it is last. The buttons use aria-disabled, so a screen reader's focus in the hint stays, and they update after each move. Fixes meta#11609
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval of this pull request waits on an engineering owner's decision about the reorder hint's end state, plus one number from you.
- An engineering owner needs to decide whether the reorder-mode hint should disable a move past the list's first or last place, as this pull request does with
aria-disabledand a 0.5 opacity dim, because the reorderable spec (AST-103 FR4) only says each hint move does what its key does and states nothing about the ends. - Please add to the description the first-load gzip delta, base against head, for a page that renders
Listwithoutreorderable, whicharchitecture:component-import-boundariesINV10 asks of a change that grows an optional feature (the engine is reached only throughcreateReorderable, so it is likely 0 B).
An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. The change itself looks sound: the new unit tests fail on main and pass here, and the disabled buttons stay focusable and inert as the focusable-disabled spec requires.
Claims and files checked
Claims:
- Changeset: the hint disables Move up while the row is first and Move down while it is last: verified (
listReorderEngine.tsx:2639,:2645; unit test). - Changeset: the buttons update after each move: verified (children observer callback at
:930-938; unit test waits for the change). - Changeset: focus stays on the handle: verified (unit test, Chromium interaction test, browser probe).
- On
mainthe moves stay enabled at the ends and a press does nothing and announces nothing: verified (the step returns before any announcement; the hint button had no disabled state). - The spec ties each hint move to its key and says nothing about the ends: verified.
- The controller tracks which end the row sits at, updated on mode change and by the existing children observer: verified (
:1111,:909-913,:930-938). - The hint button takes a disabled flag that sets
aria-disabled, drops the click handler and dims to 0.5, without nativedisabled: verified (:2559-2566). - A move into a pinned row stays enabled and is refused and announced: verified (
:2281-2283; pinned-row story unchanged; existing test passes). - The new unit tests fail on
main: verified (2 of 67 fail there). - They pass after the change, and the unchanged paths (Done, arrow keys, refused pinned moves) still pass: verified (214 of 214 in the List folder).
- Regression tests in the unit and interaction specs: verified.
- Scope is List only, with no public API change and nothing hidden under the fix label: verified (no API rows; the disabled look is described in the body); whether it counts as a defect is the decision above.
- No internal context in public text: verified.
- Vitest 214 passed: verified. Playwright Chromium 13 passed: verified. WebKit 11 passed: not reproduced here.
- Typecheck, ESLint, Prettier, changeset check and the pre-review script with 0 findings: verified.
Files:
packages/core/src/List/listReorderEngine.tsx: waits on the owner decision; one optional comment suggestion inline.packages/core/src/List/__tests__/ListReorder.test.tsx: clear.packages/core/src/List/__tests__/ListReorderMode.interaction.browser.spec.ts: clear..changeset/list-reorder-hint-disables-ends.md: clear.
There was a problem hiding this comment.
Approval of this pull request waits on an engineering owner's decision about the reorder hint's end state.
- The reorderable spec (AST-103 FR4) says each hint move does what its key does and says nothing about the list's ends, so an engineering owner needs to decide whether Move up and Move down are disabled there, as this pull request does with
aria-disabledand a 0.5 opacity dim, or whether the hint should do something else at an end, such as announce the row's place.
An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner. The implementation itself checks out: the new tests fail on main and pass here, the disabled moves stay focusable and inert, and the first-load size you reported for a plain List page is unchanged. Thanks for dropping the redundant field comment.
Claims and files checked
Claims:
- Changeset: the hint disables Move up while the row is first and Move down while it is last: verified (
listReorderEngine.tsx:2638,:2644; unit test atListReorder.test.tsx:1212). - Changeset: the buttons update after each move: verified (children observer callback at
listReorderEngine.tsx:929-937; the unit test waits for each change). - Changeset: focus stays on the handle: verified (unit test, Chromium interaction test, browser probe).
- On
mainthe moves stay enabled at the ends, and a press does nothing and announces nothing: verified (stepreturns before any announcement; browser probe onmain). - The spec ties each hint move to its key and says nothing about the ends: verified.
- The controller tracks which end the row sits at, updated on mode change and by the existing children observer: verified (
listReorderEngine.tsx:1110,:929-937). - The hint button takes a disabled flag that sets
aria-disabled, drops the click handler and dims to 0.5, without nativedisabled: verified (listReorderEngine.tsx:2525-2527,:2558-2565). - Kbd paints its own colour, so the whole button dims: verified (
Kbd.tsx:61). - A move into a pinned row stays enabled and is refused and announced: verified (browser probe on the pinned-rows story).
- The new unit tests fail on
main: verified (2 of 67 fail there). - They pass after the change, and Done, the arrow keys and refused pinned moves still pass: verified (214 of 214 in the List folder).
- Regression tests in the unit and interaction specs: verified.
- The docs reference page's first-load gzip is unchanged (0 B): verified (rebuilt with the repository's size-check options; the reorder engine is not in that page's eager graph; the absolute figure differs by build setup).
- Scope is List only, with no new public API or default hidden under the fix label: verified (no API rows; the disabled look is stated in the description); whether it ships is the decision above.
- No internal context in public text: verified.
- Vitest 214 passed: verified. Playwright Chromium 13 passed: verified. WebKit 11 passed: not reproduced here.
- Typecheck, ESLint, Prettier, the changeset check and the pre-review script with 0 findings: verified.
Files:
packages/core/src/List/listReorderEngine.tsx: waits on the owner decision; otherwise clear.packages/core/src/List/__tests__/ListReorder.test.tsx: clear.packages/core/src/List/__tests__/ListReorderMode.interaction.browser.spec.ts: clear..changeset/list-reorder-hint-disables-ends.md: clear.
Fixes #11609
User impact
In a reorderable
List, the reorder hint's Move up stays enabled on the first row and Move down on the last. A press does nothing and announces nothing.Problem and solution fit
controller.step()returns early past either end, butHintButtonhas no disabled state. The fix disables the move that cannot act, so the button matches its key.Expected behavior and authority
spec:AST-103FR4: each hint move "does exactly what its key does". The spec does not say what the hint shows at an end.Smallest restoration
childListobserver.HintButtontakesisDisabled:aria-disabled="true", noonClick, 0.5 opacity (Kbd paints its own color). Not nativedisabled, so a screen reader's focus in the hint stays.Evidence
main.ListReorder.test.tsx(ends, single row) andListReorderMode.interaction.browser.spec.ts(real clicks at both ends).component-import-boundariesINV10): docs reference page (Text, Heading, Link, Card, Divider,Listwithoutreorderable), esbuild minified, base vs head: 142,936 B → 142,936 B gzip, 0 B delta.listReorderEngineis not in that bundle.Scope
Components: List
Testing
vitest --project ui packages/core/src/List/: 214 passedplaywright test --config playwright.interaction.config.ts ListReorderMode: Chromium 13 passed, WebKit 11 passed (2 skipped by the spec)check:changesetsandpnpm review:pre(0 findings): all pass