Skip to content

fix(List): disable the reorder hint's move past either end - #11680

Open
georgegiosue wants to merge 2 commits into
meta:mainfrom
georgegiosue:fix/list-reorder-hint-disable-ends
Open

georgegiosue wants to merge 2 commits into
meta:mainfrom
georgegiosue:fix/list-reorder-hint-disable-ends

Conversation

@georgegiosue

@georgegiosue georgegiosue commented Nov 14, 2026 •

Copy link
Copy Markdown

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, but HintButton has no disabled state. The fix disables the move that cannot act, so the button matches its key.

Expected behavior and authority

spec:AST-103 FR4: each hint move "does exactly what its key does". The spec does not say what the hint shows at an end.

Smallest restoration

  • The controller tracks which end the mode's row sits at. It updates on mode change and on the list's existing childList observer.
  • HintButton takes isDisabled: aria-disabled="true", no onClick, 0.5 opacity (Kbd paints its own color). Not native disabled, so a screen reader's focus in the hint stays.
  • A move into a pinned row stays enabled, because it is refused and announced.

Evidence

First row Last row
Before
After
  • Reproduction before the change: the new unit tests fail on main.
  • Result after the change: they pass. Moves update the disabled state after each commit.
  • Representative unchanged path: Done, arrow keys, and refused moves into pinned rows.
  • Regression test: ListReorder.test.tsx (ends, single row) and ListReorderMode.interaction.browser.spec.ts (real clicks at both ends).
  • First-load size (component-import-boundaries INV10): docs reference page (Text, Heading, Link, Card, Divider, List without reorderable), esbuild minified, base vs head: 142,936 B → 142,936 B gzip, 0 B delta. listReorderEngine is not in that bundle.

Scope

Components: List

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest --project ui packages/core/src/List/: 214 passed
  • playwright test --config playwright.interaction.config.ts ListReorderMode: Chromium 13 passed, WebKit 11 passed (2 skipped by the spec)
  • Typecheck, ESLint, Prettier, check:changesets and pnpm review:pre (0 findings): all pass

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

vercel Bot commented Nov 14, 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 Nov 14, 2026 5:27am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Nov 14, 2026
@astracat-bot

astracat-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 20, 2026, 1:19 AM UTC

@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 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-disabled and 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 List without reorderable, which architecture:component-import-boundaries INV10 asks of a change that grows an optional feature (the engine is reached only through createReorderable, 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 main the 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 native disabled: 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.

Automated review (maintainer link)

@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 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-disabled and 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 at ListReorder.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 main the moves stay enabled at the ends, and a press does nothing and announces nothing: verified (step returns before any announcement; browser probe on main).
  • 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 native disabled: 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.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 715792f2 Deployed Nov 14, 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. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] List: the reorder hint's Move up stays enabled on the first row, and Move down on the last

2 participants