Skip to content

feat(core): a Lab collection that runs its own reorder mode shares List's reorder parts - #14028

Open
humbertovirtudes wants to merge 1 commit into
mainfrom
feat/reorder-internal-shared-parts
Open

humbertovirtudes wants to merge 1 commit into
mainfrom
feat/reorder-internal-shared-parts

Conversation

@humbertovirtudes

@humbertovirtudes humbertovirtudes commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3639. Prerequisite for #3956 and #3958 (drag-and-drop Table columns in Lab).

Stack: #14028 → #14018 → #14019 → #14020

User need

A Lab collection that reorders along the inline axis, such as a Table's columns, needs the same reorder mode hint, strings, pointer input, edge autoscroll, drop bounds and preview copy that a List's rows use. Today those parts are private to Core's reorder engine, so a Lab collection has to copy them, and the copies drift: a column hint without the hint's fade-in, or a move button whose touch band anchors to the hint and lands a tap on Done. A reorderable object's start(key) also reaches only List sessions, so an app's own "Move column" action cannot start reorder mode for a column (spec:AST-103 FR4a).

Design

A new internal entry, @astryxdesign/core/internal/reorder-mode, gives Lab the parts of List's reorder. List's session now uses the same modules, so List does not change.

  • ReorderModeHint (List/ReorderModeHint.tsx): reorder mode's hint, moved out of the engine. It takes axis: 'block' | 'inline': the block axis offers Move up and Move down, as today; the inline axis offers Move left and Move right. The catalog gains @astryx.list.reorderMoveLeft and @astryx.list.reorderMoveRight.
  • reorderMessagesFrom(t) (List/reorderMessages.ts): the announcement strings, moved out of the engine.
  • attachReorderMouse(container, isCoarsePointer, …) and attachReorderHold(container, isCoarsePointer, …) (List/reorderPointer.ts): the session's pointer input, moved out of the engine with its pointer rule. A mouse, or a pen where the primary pointer is fine, drags from a handle once it moves 4 px; a finger, and a pen where the pointer is coarse, after the touch layer's hold. The caller says only whether the primary pointer is coarse, so List and Lab each make one call. One listener serves a whole collection. Each reports the began, changed, ended and cancelled positions, now with both x and y.
  • reorderAutoscroll (List/reorderAutoscroll.ts) with autoscrollStep: the drag's edge autoscroll on UIKit's reorder tick, as the engine runs it.
  • watchReorderScroll (List/reorderScrollWatch.ts): the drag's watch of its scroller, moved out of the engine. It skips the drag's own scroll events, and folds a scroll the drag did not cause, such as a wheel's or one around the scroller, into the drag in a later frame in which the drag wrote nothing, so the drag's one read of the offset forces no layout.
  • previewCopyOf and bareCopyOf: List's preview copy, moved from the engine beside inertClone in motion/inertClone.ts. previewCopyOf copies content with inertClone, and content holding a canvas that reads back empty gets its bare box, bareCopyOf: the element without its children, ids, test ids, names, label ties or autofocus. List's engine calls previewCopyOf as it called its private copy, and a Lab preview calls the same two, so both previews copy and fall back alike.
  • movableRange, paintedBackground and getNodeText (the text a reorder handle is named by, block by block, as Table's resize handle reads it), re-exported as they are.
  • mountReorderStarter(reorderable, {startByKey}) in @astryxdesign/core/internal/reorder: lets the object's start(key) reach a collection that runs its own reorder mode. The engine keeps one list of starters per object, so start still finds the one mounted last.

internal/reorder keeps its rule that it loads no reorder code (its test still passes), which is why the parts get their own entry. The architecture:react-component-runtime INV12 source boundary check, which keeps the inert clone to the copy mechanism and the reorder's preview, now lists internal/reorder-mode.ts as the entry Lab's column preview reaches it through.

Owner decision

This adds an internal entry and modules another package imports, so it needs an owner API decision (pre-review checklist item a) for each of: the entry packages/core/src/internal/reorder-mode.ts; the modules it exports, List/ReorderModeHint.tsx (with the inline hint's "Move left" and "Move right" names), List/reorderPointer.ts, List/reorderAutoscroll.ts, List/reorderScrollWatch.ts and List/reorderMessages.ts, with previewCopyOf and bareCopyOf (moved beside inertClone) and the re-exported movableRange, autoscrollStep, paintedBackground and getNodeText; and mountReorderStarter in internal/reorder.ts.

The component:List Owns bullet records it, so it needs an ENGOWNER approval of the record change, with the INV12 boundary check's new entry. Related: #11226 adds reorderable.attach for plain elements along the block axis; an inline axis there could later serve Table columns too.

Testing

Check Result
vitest --project ui packages/core/src/internal/reorderShared.test.tsx 7/7 pass. New: previewCopyOf copies a cell without its id and hidden, and gives a cell whose canvas cannot be read its bare box with its classes; bareCopyOf copies no children or id. Also: the hint offers Left, Right and Done on the inline axis and Down on the block axis, and none outside the mode; the strings read as List's, and getNodeText reads a two-block header as "Due date"; the autoscroll ticks on a step and stops; a mouse drags past the slop, and neither a finger nor a pen under a coarse pointer drags at once; start(key) reaches a mounted starter until it leaves; the scroll watch skips the drag's own scroll, folds another one frame later, and stops (6/6)
vitest --project ui packages/core (every Core suite, the INV12 boundary check included) 995 files, 25,327 tests pass
At the top of the stack (#14020): vitest --project ui packages/core packages/lab 1,104 files, 26,825 tests pass
Chromium 149 (Chrome for Testing 149.0.7827.55), ListReorder*.interaction.browser.spec.ts 68/68 pass: List's pointer, touch-hold, wheel-during-drag and reorder-mode specs over the moved modules
Core typecheck; pnpm build pass
eslint --max-warnings=0 (strict), Prettier pass
pnpm check:repo (knowledge, changesets, i18n runtime and catalog, sync), sync-exports --check, changeset coverage pass
check:component-import-boundaries --base-ref origin/main; pnpm size:pages --base origin/main hold; every reference page +0 / +0 bytes
pnpm review:pre 0 findings; 1,685 authored lines, most of them moved from the engine; merge into main clean

Writing rubric results

R1 narration: none; the new Owns bullet states what the entry gives.
R2 research: none.
R3 evidence: no pull request or commit cited; verified_by gains internal/reorderShared.test.tsx.
R4 rejected alternatives: none in the record.
R5 change references: none.
R6 open questions: none added.
R7 project status: none.

Scope

Components: List, createReorderable

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

@vercel

vercel Bot commented Nov 29, 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 Dec 2, 2026 9:38am UTC

Request Review

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 29, 2026
@astracat-bot

astracat-bot Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Dec 2, 2026, 9:35 AM UTC

@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · ebaa99e

Storybook · Sandbox · built from this PR's head

Current run: Heavy CI deferred: runs when review passes and before merge. Lint, typecheck and any path-filtered checks ran on this push.


Generated by PR Enrichment workflow | View current CI run

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

This pull request is reviewed as part of its stack; see the review on #14020.

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.

This pull request is reviewed as part of its stack; see the review on #14020.

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.

This pull request is reviewed as part of its stack; see the review on #14020.

Automated review (maintainer link)

…st's reorder parts

A new internal entry, @astryxdesign/core/internal/reorder-mode, gives Lab the parts of List's reorder: the mode hint, which now offers Up and Down or Left and Right, the strings, the pointer input with a finger's hold, the edge autoscroll, the drop bounds and the preview copy. internal/reorder gains mountReorderStarter, so a reorderable object's start(key) reaches such a collection. List's session uses the same parts, so List does not change. The catalog gains Move left and Move right.
@humbertovirtudes
humbertovirtudes force-pushed the feat/reorder-internal-shared-parts branch from b57e894 to ebaa99e Compare December 2, 2026 09:24

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

This pull request is reviewed as part of its stack; see the review on #14020.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — ebaa99eb Deployed Dec 2, 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. needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant