Repository navigation
Conversation
createReorderable objects gain attach(container, {items}): each handle
becomes a named reorder mode toggle in the Tab order, with List's arrow
moves, hint, announcements and Escape, and start(key) reaches attached
items. A move counts when items() reports it by the end of the task that
ran onReorder; otherwise it is refused and announced with the new
@astryx.list.reorderNotMoved message. The elements attach owns sit in the
nearest theme scope, and detach removes everything it added. Pointer and
touch drags of attached handles come next.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/AudioPlayer | 243.0 kB (+159 B) · 1.8 kB CSS (0) | — | — · — · — |
| lab/VideoPlayer | 240.8 kB (+149 B) · 2.1 kB CSS (0) | — | — · — · — |
| lab/Comments | 395.2 kB (+131 B) · 2.5 kB CSS (0) | — | — · — · — |
27 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/MediaFullscreenButton | 232.9 kB (+129 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaPlaybackRate | 232.9 kB (+129 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaPlayButton | 232.9 kB (+129 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaSeekButton | 232.9 kB (+129 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaVolume | 232.9 kB (+127 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 388.4 kB (+125 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/MediaCaptionsButton | 232.9 kB (+124 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTime | 232.9 kB (+124 B) · 1.5 kB CSS (0) | — | — · — · — |
| lab/MediaTimeSlider | 232.9 kB (+124 B) · 1.5 kB CSS (0) | — | — · — · — |
| MoreMenu | 137.4 kB (+114 B) · 20.1 kB CSS (0) | — | — · — · — |
| SideNav | 118.3 kB (+114 B) · 12.7 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 111.2 kB (+114 B) · 20.3 kB CSS (0) | — | — · — · — |
| TableCell | 111.3 kB (+111 B) · 20.5 kB CSS (0) | — | — · — · — |
| DropdownMenu | 137.2 kB (+110 B) · 20.1 kB CSS (0) | — | — · — · — |
| Markdown | 214.5 kB (+106 B) · 23.8 kB CSS (0) | — | — · — · — |
| BreadcrumbItem | 106.6 kB (+103 B) · 14.3 kB CSS (0) | — | — · — · — |
| Table | 129.6 kB (+101 B) · 21.5 kB CSS (0) | — | — · — · — |
| ContextMenu | 110.2 kB (+98 B) · 19.9 kB CSS (0) | — | — · — · — |
| DropdownMenuSubMenu | 83.1 kB (+97 B) · 11.5 kB CSS (0) | — | — · — · — |
| lab/TransferList | 143.4 kB (+28 B) · 1.4 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 155.7 kB (+23 B) · 1.6 kB CSS (0) | — | — · — · — |
| PowerSearch | 323.3 kB (+22 B) · 27.6 kB CSS (0) | — | — · — · — |
| lab/ListInput | 100.5 kB (+18 B) · 1.3 kB CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 107.7 kB (+16 B) · 1.8 kB CSS (0) | — | — · — · — |
| CheckboxList | 78.4 kB (0) · 8.5 kB CSS (0) | — | — · — · — |
| List | 20.5 kB (0) · 3.0 kB CSS (0) | — | ✓ · ✓ · — |
| ListItem | 84.3 kB (0) · 13.0 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 8.08 MB packed (+14.4 kB); no new dependencies.
API changes: core +1 · ~0 · −0
1 API change (advisory)
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | core |
. · Types · interface Reorderable |
attach: (container: HTMLElement, options: { items: () => ReadonlyArray<{ readonly key: TKey; readonly element: HTMLElement; readonly handle: HTMLElement }> }) => { detach(): void } |
import type {Reorderable} from '@astryxdesign/core'; const x: Reorderable = {attach: …} |
Touched components checked; for the full suite, add ci:run-visual for Visual.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
This pull request needs an engineering owner's spec decision and some changes before it can be approved.
Spec decision. The pull request adds two requirements to spec:AST-103 FR4b that the record on main does not state: where the elements attach owns sit (the nearest theme scope, else the document body), and when attach reads items() (with the new gap for items added later). An engineering owner records the decision by commenting /approve-spec <full head SHA> on the pull request; the author may do so if they are an engineering owner.
Changes needed
- The story's inline
refcallback (createReorderable.stories.tsx:95) attaches again on every render, so the first arrow move ends reorder mode without an announcement, and the browser spec's mode and announcement steps cannot pass. - Handles are named from the item's raw
textContent, so the story's grips read "Reorder Ace of spades⋮⋮" and all five tests inReorderableAttachMode.interaction.browser.spec.tsfail; reusereadAccessibleNamefromutils/accessibleName.tswith the handle's subtree left out, instead of the separatenameOf. - A move the app applies by re-rendering its rows is announced as "Can't move …", because the commit check compares element identity rather than reading the key at
tofromitems(). - A move applied in a microtask queued after
attach's own check, still within the task, is announced as "Can't move …"; re-readitems()in the next-task fallback before announcingnotMoved. - In a horizontal or grid container, Left and Right do nothing and the hint offers only up and down, against FR4's axis rule; implement the axis or state the gap in FR4b and the docs.
- After reorder mode,
detachleaves an inlineposition: relativeon a static container, becauseprepareModesaves the engine's ownrelativeas the original value; drop that copy and let the engine own the positioning.
…-rendered and later moves, and states the axis gap - Items are named with readAccessibleName, the handle's subtree left out. - A move lands when the moved key is at its new place, so a re-rendered row commits; the end-of-task fallback reads the items again first, so a later microtask in the same task commits. - The story attaches once (a stable ref callback). - detach no longer leaves an inline position: the controller owns it. - AST-103 FR4b states the vertical-axis gap and names the List engine entries attach reuses.
|
/approve-spec ffab19b |
|
Decision: D-20261111-340 |
There was a problem hiding this comment.
Changes requested. The spec:AST-103 edits are approved for this head and the first round's findings are fixed; five defects and one test gap remain.
- Miss: inside a modal
<dialog>the page opens,attachputs the hint outside the dialog (attachReorderable.ts:189-191,:343), where the browser makes it inert, so its Move up, Move down and Done buttons take no click or tap and a pointer or touch user cannot reorder there; put the owned elements in the enclosing open modal and amend FR4b's placement sentence to match. detachunmounts the hint's React root synchronously (attachReorderable.ts:450), so a React app that detaches in a ref callback's cleanup, as the story does, logs React's "Attempted to synchronously unmount a root while React was already rendering" error once reorder mode has been used; defer the unmount.- Miss: an item whose
handleis its ownelementgets a Reorder toggle that enters reorder mode, but the arrow keys move nothing, because the engine looks for a row's key only in handles below the row (listReorderEngine.tsx:940-953). - Miss:
detachwrites back the container's whole savedclassattribute (attachReorderable.ts:329-334,:453), which undoes class changes the app made while attached; remove only the class tokensattachadded. - Miss:
isNativelyFocusable(attachReorderable.ts:105-114) re-declares the focusable elements that the sharedFOCUSABLE_SELECTOR(hooks/focusableSelector.ts) owns and already differs from it; use the shared selector and delete the copy. - FR4b's verification row names states that
attachbuilds but no test covers: a container in a page-opened modal dialog, one object attached to two containers, a keyless item, an item with no accessible name, a server import, and a handle with its owntabindex="-1".
The first fix changes an approved FR4b sentence, so the next head needs an engineering owner's /approve-spec again. Inline comments carry the non-blocking notes.
| ); | ||
| } | ||
|
|
||
| /** Puts back the handle attributes and the container style `attach` set. */ |
There was a problem hiding this comment.
Non-blocking (INV29): snapshot restores any listed attributes, and here the handle attributes and the container's class, not "the container style". Suggested rewrite: "Saves names on element; returns the restore."
… is its item, and restores only its own classes - detach hides the hint's host at once and unmounts its React root after the task's synchronous work, so a React app may detach while it renders. - The engine takes an attached item that is its own handle. - detach removes only the class tokens attach added. - The type names stay internal; attach is typed inline, so it is the only new public name. - Tests cover a modal container, one object on two containers, a keyless item, an unnamed item, and a server import; a JSDoc block is back on its method.
|
/approve-spec 254e4f4 |
|
Decision: D-20261111-383 |
…gains no owned element
|
/approve-spec cdadef7 |
There was a problem hiding this comment.
Changes requested: attach keeps a container that is itself a dialog or theme scope free of the elements it owns, but that leaves the hint unusable when the container is itself an open modal dialog, and one description claim is stale.
- When the container is itself an open modal
<dialog>,ownedParentOf()(attachReorderable.ts:212-215) puts the hint and its instructions outside it, so the modal makes the hint inert and a click or a tap on Move down moves nothing, againstspec:AST-103FR4's tappable hint and FR4b's own "so a modal dialog does not make them inert"; keep the owned elements in a container that is the open modal dialog and state that exception in FR4b and the description, or record the inert hint as an FR4b implementation gap. - The description's Evidence says
attachReorderable.test.tshas 31 passing tests, but it has 32, and the case for a container that is itself a dialog or theme scope is not listed.
Either record change needs an engineering owner's /approve-spec at the new head. Everything else checks out against the approved FR4b, and the remaining notes are non-blocking.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review (0): none.
- Changeset,
attachreorders plain elements fromitems()(key, element, handle in order): verified (createReorderable.ts:93-116, unit tests). - Changeset, each handle becomes a reorder toggle named for its item: verified (
attachReorderable.ts:305-393, unit tests, Chromium). - Changeset, Space or Enter starts, arrows move, Escape ends, each move is announced: verified, with Up and Down only as the same note says (unit tests, Chromium).
- Changeset, an unapplied move is refused and announced: verified (unit tests for a move never applied and one applied a task later).
- Changeset,
start(key)reaches attached items anddetach()removes whatattachadded: verified (unit tests). - Changeset, attached items move up and down and have no drag yet: verified (List's key handler; no drag wiring).
- Description, handles are Tab stops named "Reorder" plus the item's name: verified (unit tests, Chromium).
- Description, moves announce place and neighbours, and refusals name the item: verified (unit tests).
- Description, the hint is List's own hint in an owned React root mounted at first use: verified (
attachReorderable.ts:414-434). - Description, announcements use the shared channel, or the dialog's own region inside a modal: verified (
attachReorderable.ts:219-230, unit test). - Description, a move counts when
items()reports it by the end of the task, with no mutation watching: verified (attachReorderable.ts:448-473). - Description,
items()is read at attach, at each press, key orstart, and after each move: verified (synccalls and the controller hooks). - Description, every row's name is registered, keyless and fixed rows included: verified (unit test with a keyless neighbour).
- Description, owned elements go in the nearest dialog, else theme scope, else body, and the container gains none: verified (
attachReorderable.ts:212-215, unit test), but a container that is itself a modal dialog then gets an inert hint (blocking finding). - Description, the insertion-line class comes and goes with
attach, and the engine sets and restoresposition: relative: verified (attachReorderable.ts:414-425,listReorderEngine.tsx:2143-2165). - Description, the new types are not exported from the package root: verified (
index.ts:197-203; one added public row). - Description, engine exports, optional
notMoved, narrowerkeyDownevent type, List announcements unchanged, landing by key: verified (List suites pass). - Description, the handle mark lives in the private-attribute owner module, and Lab's adapted objects delegate
attach: verified. - Description, two new catalog strings, the attached description naming no drag: verified (
en.json). - Description, the record, doc entry, story and changeset edits as listed: verified.
- Description, unit tests "31 pass": false, the file has 32 tests.
- Description, unit tests fail on the base because
attachdoes not exist there: verified (basecreateReorderable.ts). - Description, each listed unit-test case exists: verified.
- Description, the browser spec's coverage and its CI legs: verified by reading; it did not run on CI at this head (draft).
- Description, first-load deltas within the 307 B limit: consistent with an earlier measurement of this change (menu +121 B, table +109 B, other pages +0); nothing on those pages' import path changed since.
- Description, the regression run at an earlier commit: stated for that commit; the same suites pass at this head.
- Description, Core and Storybook typecheck, eslint, knowledge and i18n checks: verified at this head.
- Description, known and queued follow-ups: still present as described.
.changeset/reorderable-attach-plain-elements.md: clear.apps/storybook/stories/createReorderable.stories.tsx: clear.docs/specs/AST-103-reorderable/spec.md: the placement sentence leaves a modal-dialog container's hint inert (blocking finding).packages/core/locales/en.json: clear.packages/core/src/List/listReorderContext.ts: clear.packages/core/src/List/listReorderEngine.tsx: clear.packages/core/src/internal/reorder.ts: clear.packages/core/src/privateAttributes/listReorder.stylex.ts: clear.packages/core/src/reorderable/__tests__/ReorderableAttachMode.interaction.browser.spec.ts: clear.packages/core/src/reorderable/attachReorderable.server.test.ts: clear.packages/core/src/reorderable/attachReorderable.test.ts: clear.packages/core/src/reorderable/attachReorderable.ts: blocking finding at 212-215; non-blocking comment notes at 5-23 and 136.packages/core/src/reorderable/createReorderable.doc.mjs: non-blocking, still callsstart(key)"its one method" (line 44).packages/core/src/reorderable/createReorderable.ts: clear.packages/core/src/utils/accessibleName.ts: clear.
…and instructions, so a modal one leaves them usable
|
/approve-spec 1929ed1 |
There was a problem hiding this comment.
Approved pending CI: some of CI's test shards have not finished on this head, and the merge guard requires them green. reorderable.attach matches the reorderable spec's attach requirement and the edits an engineering owner approved for this head, and its new browser spec now passes in Chromium and WebKit.
Two non-blocking points:
- Every click anywhere in the container re-reads
items()and re-names every item (attachReorderable.ts:478); syncing only when the click lands in a handle would keep long lists cheap. - The description's land-path line still says the pull request is held as a draft for an owner decision, which is no longer true.
Claims and files checked
Review mode: same-head; reason: none
- Changeset,
attach(container, {items})reorders plain elements fromitems()in order: verified (createReorderable.ts:103-116, unit tests). - Changeset, each handle becomes a reorder toggle named for its item: verified (unit tests; the browser spec finds "Reorder " on each grip).
- Changeset, Space or Enter starts, the arrow keys move, Escape ends, and screen readers hear each move: verified, Up and Down only, as the same note says (unit tests; browser spec in Chromium and WebKit).
- Changeset, a move not applied by the end of the task is refused and announced: verified (unit tests for a move never applied and one applied a task later).
- Changeset,
start(key)reaches attached items anddetach()removes whatattachadded: verified (unit tests). - Changeset, attached items move up and down and have no drag yet: verified (only click, keydown and focusout listeners,
attachReorderable.ts:511-513). - Description, before this change
createReorderablereordered only collections: verified (the base object has noattach). - Description, handles are Tab stops named "Reorder" plus the item's name: verified (unit tests, browser spec).
- Description, moves announce place and neighbours, and refusals name the item: verified (unit tests, browser spec).
- Description, the hint is List's own hint in an owned React root mounted at first use: verified (
attachReorderable.ts:416-438). - Description, announcements use the shared channel, or the dialog's own region inside a modal: verified (
attachReorderable.ts:221-232, unit test). - Description, a move counts when
items()reports it by the end of the task, with no mutation watching: verified (attachReorderable.ts:450-475; no observer in the module). - Description,
items()is read at attach, at each press, key orstart, and after each move: verified; it is also read on every other click in the container (non-blocking point above). - Description, every row's name is registered, keyless and fixed rows included: verified (unit test with a keyless neighbour).
- Description, owned elements go in a container that is itself a dialog, else the nearest dialog, theme scope or body, and any other container gains none: verified (
attachReorderable.ts:213-217, unit tests). - Description, the insertion-line class comes and goes with
attach, and the engine sets and restoresposition: relativeat each mode entry: verified (attachReorderable.ts:416-426,listReorderEngine.tsx:1066-1080,:2142-2164). - Description, the attach types are not exported from the package root: verified; they are declared in
attachReorderable.ts, and the root exports only the factory,Reorderable,ReorderableOptionsandReorderMove. - Description, the engine exports, optional
notMoved, narrowerkeyDownevent type, List's unchanged announcements and landing by key: verified (List passes nonotMoved; List suites pass). - Description, the handle mark lives in the private-attribute owner module, and Lab's adapted objects delegate
attach: verified. - Description, two new catalog strings, the attached description naming no drag: verified (
en.json:626,:646). - Description, the record, doc entry, story and changeset edits as listed: verified.
- Description, 33 unit tests pass and fail on the base because
attachdoes not exist there: verified (33 pass at this head; the base object has noattach). - Description, each listed unit-test case exists: verified.
- Description, the browser spec's coverage and that it runs on CI's browser legs: verified (all five cases passed on this head in Chromium and WebKit).
- Description, the first-load deltas stay within the 0.3 KB limit: verified (CI's size analysis on this head: List +0 B, menus about +110 B, Table +110 B).
- Description, the regression run of 361 tests at an earlier commit: stated for that commit; the same suites run 363 tests at this head, all passing.
- Description, Core and Storybook typecheck, eslint and the knowledge and i18n checks: verified by CI on this head (its typecheck job covers Core and Storybook, and its lint job runs eslint and the knowledge and i18n checks).
- Description, the known and queued follow-ups: still present as described.
- Description, the land-path line (held as a draft for an owner decision): out of date; a process note, not a claim about the code.
.changeset/reorderable-attach-plain-elements.md: clear.apps/storybook/stories/createReorderable.stories.tsx: clear.docs/specs/AST-103-reorderable/spec.md: clear.packages/core/locales/en.json: clear.packages/core/src/List/listReorderContext.ts: clear.packages/core/src/List/listReorderEngine.tsx: clear.packages/core/src/internal/reorder.ts: clear.packages/core/src/privateAttributes/listReorder.stylex.ts: clear.packages/core/src/reorderable/__tests__/ReorderableAttachMode.interaction.browser.spec.ts: clear.packages/core/src/reorderable/attachReorderable.server.test.ts: clear.packages/core/src/reorderable/attachReorderable.test.ts: clear.packages/core/src/reorderable/attachReorderable.ts: non-blocking notes at 5-23, 136 and 478.packages/core/src/reorderable/createReorderable.doc.mjs: non-blocking note at 44.packages/core/src/reorderable/createReorderable.ts: clear.packages/core/src/utils/accessibleName.ts: clear.
| const unmount = mountSession(options.startedBy ?? options, controller); | ||
|
|
||
| const onClick = (event: MouseEvent) => { | ||
| sync(); |
There was a problem hiding this comment.
Miss, non-blocking: sync() runs before the handle check, so every click anywhere in the container re-reads items() and re-names every item. Naming deep-clones each item's element, twice for a wired handle (:254, :323). In an editor or a long card list, each click on content pays for that, though FR4b reads only "at each press … on a handle". Find the target in items()' handles first, and sync only when it is in one.
rubyycheung
left a comment
There was a problem hiding this comment.
Design approval for keyboard reordering of plain elements. Compared the exact base and this head: Tab reaches the named handle; Space and Enter enter reorder mode; arrow moves apply with focus retained and position announcements; Escape keeps the move; the hint buttons and start(key) work. This approval covers the keyboard-only scope, not pointer/touch dragging or the documented naming, cleanup and secondary-window follow-ups. Verified in desktop Chromium, not full CI.
# Conflicts: # docs/specs/AST-103-reorderable/spec.md # packages/core/src/privateAttributes/listReorder.stylex.ts # packages/core/src/reorderable/createReorderable.doc.mjs # packages/core/src/reorderable/createReorderable.ts # packages/core/src/utils/accessibleName.ts
|
/approve-spec 2effe0e |
|
/approve-spec 044385a |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft, and the merge guard requires its checks green. reorderable.attach matches the reorderable spec's attach requirement and the edits an engineering owner approved for this head, and the new commit gives the reorder hint the container's direction in right-to-left layouts.
Non-blocking points:
- Every click anywhere in the container re-reads
items()and re-names every item (attachReorderable.ts:484-486); syncing only when the click lands in a handle keeps long lists cheap. - The new comment at
attachReorderable.ts:438-440is one long sentence with two topics; see the inline suggestion. createReorderable.doc.mjsstill callsstart(key)"its one method" just before it documentsattach.
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Changeset,
attach(container, {items})reorders plain elements without a collection component: verified (createReorderable.ts:130-143,:176-182; unit tests). - Changeset,
items()returns each item's key, element and handle in order: verified (createReorderable.ts:133-139). - Changeset, each handle becomes a reorder mode toggle named for its item: verified (
attachReorderable.ts:338-395; unit tests; the browser spec finds "Reorder "). - Changeset, Space or Enter starts, the arrow keys move, Escape ends, and screen readers hear each move: verified, Up and Down only, as the same note says (unit tests; browser spec).
- Changeset, a move not applied by the end of the task is refused and announced: verified (unit tests for a move never applied and one applied a task later).
- Changeset,
start(key)reaches attached items: verified (attachReorderable.ts:154-166; unit test; browser spec). - Changeset,
detach()removes everythingattachadded: verified (attachReorderable.ts:524-557; unit tests), apart from the queued description-restore follow-up. - Changeset, attached items move up and down, with no drag yet: verified (only click, key and focus-out listeners,
attachReorderable.ts:517-519). - Description, before this change
createReorderablereordered only collections: verified (the base object has noattach). - Description, handles are Tab stops named "Reorder" plus the item's name, with Space or Enter, Up and Down, Escape or Done: verified (unit tests, browser spec).
- Description, moves announce place and neighbours, and a refused move names the item: verified (unit tests;
en.json:646). - Description, the hint is List's own hint in an owned root mounted at first use: verified (
attachReorderable.ts:416-437). - Description, announcements use the shared channel, or the dialog's own region inside a modal: verified (
attachReorderable.ts:221-232; unit test). - Description, a move counts when
items()reports it by the end of the task, with no mutation watching: verified (attachReorderable.ts:456-479; no observer in the module). - Description,
items()is read at attach, at each press, key orstart, and after each move: verified; it is also read on every other click in the container (non-blocking point above). - Description, every row's name is registered, keyless and fixed rows included: verified (
attachReorderable.ts:245-263; unit test with a keyless neighbour). - Description, owned elements go in a container that is itself a dialog, else the nearest dialog, theme scope or body, and any other container gains none: verified (
attachReorderable.ts:213-217; unit tests). - Description, the insertion-line class comes and goes with
attach, and the engine sets and restoresposition: relativeat each mode entry: verified (attachReorderable.ts:417-426;listReorderEngine.tsx:2221-2238). - Description, the attach types are not exported from the package root: verified (
index.ts:198-204). - Description, the engine exports, optional
notMoved, narrowerkeyDownevent type, List's unchanged announcements and landing by key: verified (List passes nonotMoved). - Description, the handle mark in the private-attribute module and Lab's delegation of
attach: verified. - Description, the two new catalog strings, the attached description naming no drag: verified (
en.json:626,:646). - Description, the record, doc entry, story and changeset edits as listed: verified.
- Description, the unit tests fail on the base and 33 pass: the base has no
attach; the file now holds 35 cases (two direction cases came later), not yet run on this head. - Description, each listed unit case and the browser spec's coverage: verified as written; not yet run on this head.
- Description, first-load deltas within the 0.3 KB limit: stated for an earlier merge; the shared-module changes are unchanged since.
- Description, the regression run and the typecheck, lint and catalog checks: stated for earlier commits; not yet run on this head.
- Description, the known and queued follow-ups: still present as described.
- Description, the land-path line (held for an owner decision): out of date; the decision is recorded for this head.
.changeset/reorderable-attach-plain-elements.md: clear.apps/storybook/stories/createReorderable.stories.tsx: clear.docs/specs/AST-103-reorderable/spec.md: clear.packages/core/locales/en.json: clear.packages/core/src/List/listReorderContext.ts: clear.packages/core/src/List/listReorderEngine.tsx: clear.packages/core/src/internal/reorder.ts: clear.packages/core/src/privateAttributes/listReorder.stylex.ts: clear.packages/core/src/reorderable/__tests__/ReorderableAttachMode.interaction.browser.spec.ts: clear.packages/core/src/reorderable/attachReorderable.server.test.ts: clear.packages/core/src/reorderable/attachReorderable.test.ts: clear.packages/core/src/reorderable/attachReorderable.ts: non-blocking notes at 5-23, 136, 438-440 and 484-486.packages/core/src/reorderable/createReorderable.doc.mjs: non-blocking note at 50.packages/core/src/reorderable/createReorderable.ts: clear.packages/core/src/utils/accessibleName.ts: clear.
| // The host sits outside the container's direction region, so it takes | ||
| // the container's direction each time the mode starts: the hint's | ||
| // buttons then mirror as List's hint does. |
There was a problem hiding this comment.
Non-blocking (INV29): this is one 28-word sentence with two topics, over the 25-word limit for a description. Suggested:
// The host sits outside the container's direction region. It copies that
// direction at each mode start, so the hint mirrors as List's hint does.
User impact
List), such as a card stack or an editor's blocks, with a keyboard or a screen reader.createReorderablereordered only Astryx collections, so an app with its own elements had to build its own reorder handle, keyboard model and announcements, or go without.reorderable.attach(container, {items})turns each item's handle into the same reorder toggle List rows have:start(key)reaches attached items;detach()removes everythingattachadded.Spec
spec:AST-103FR4b (attach), FR4 (reorder mode), FR4a (start), and FR1'snotMovedlabel.items()reports it by the end of the task that ranonReorder; there is no mutation watching; and the owned elements go in the nearest enclosing dialog, else the nearest theme scope.Changes
reorderable/attachReorderable.ts(new, internal):aria-pressed, name, Tab stop, description, and the private handle mark;items()at attach, at each press, key orstart, and after each move;dialog, else the nearest[data-astryx-theme], elsebody: hidden instructions and a fixed, sizeless hint host, with the hint itself in the top layer. A container that is itself a dialog holds them, so a modal one leaves the hint usable; any other container gains no element (the search starts at its parent), and its parent gains them only when it is that dialog, theme scope or body;detachremoves it. The shared reorder engine setsposition: relativeon a static container at each mode entry and restores it when the mode ends.createReorderable.ts: theattachmethod and its types (ReorderableItem,ReorderableAttachOptions,ReorderableAttachment). The types are not exported from the package root.List/listReorderEngine.tsx: exportsmountSession,messagesFromandListReorderModeHintforattach.ReorderMessagesgains an optionalnotMoved, which the end-of-task fallback announces instead of the unchanged place.keyDowntakes the key-event fields it reads, so native events work. List passes nonotMoved, so its announcements are unchanged; it shares the engine's landing by key withattach.privateAttributes/listReorder.stylex.ts:markReorderHandle, so the attribute's name stays in its owner module.internal/reorder.ts: Lab's adapted objects delegateattachto the owner's.en.json:@astryx.list.reorderNotMoved("Can't move {label}"), records-decided by FR1'snotMovedlabel, and@astryx.list.reorderHintKeyboard, the attached handles' description ("Press Space or Enter, then the arrow keys to move this item one place at a time. Press Escape when you are done."). It names no drag, because attached handles start none yet; List keeps its own hint.AST-103: FR4b's gap now covers drags, the keyboard-only description, and moves by Up and Down only; one sentence on where owned elements go and whenitems()is read; the later-added-item gap; the verification row names the unit tests and the new key;verified_bylists the new tests.createReorderable.doc.mjsdocumentsattach. A new story,Core/createReorderable"Attach plain elements", shows a React app rendering a plain<ol>.[feat]patch.Evidence
attachReorderable.test.ts, 33 pass, red onmainbecauseattachdoes not exist):start(key), and anisReorderableend row ("Can't move past Pinned");detachrestoring every attribute and removing every owned element;ReorderableAttachMode.interaction.browser.spec.ts): Tab order and names, Space and Enter, arrow moves applied withsetStateand announced, the hint's Move down and Done, Escape,start(key), and the list holding only its<li>s. It runs on CI's browser legs.pnpm size:pages --base main --page list=List --unused-on table,menu,list, main 8a5008a against this head's merge): docs +0 B, form +0 B, menu +110 B gzip, table +108 B gzip; a List page withoutreorderable+0 B. Each page without the feature passes INV10's 307 B limit.tsc, eslint,check:knowledge,check:i18n-catalogandcheck:i18n-runtime.Known and queued
Queued as follow-ups, outside this change:
detachwrites back the handle's description as it was atattach, not as the app last set it.createReorderabledoc still callsstart(key)"its one method".Writing rubric results
Run over the
AST-103edits (FR4b paragraph, verification row, front matter).(Posted by Cindy's agent on her behalf.)
Owner: Astryx fix-loop lane 0. Land path: Held as a draft for an owner decision on AST-103 FR4b. Then CodeBunny approval, Specs stamp, CI, and the merge queue. If the decision goes the other way, this closes with that reason.