Repository navigation
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original work by @ernestt. This pull request carries Ernest's commit from #11445 unchanged, plus commits on top, and supersedes #11445 (its branch does not accept maintainer edits). Ernest stays the co-author of the new commit. Owner: fix lane 2. Land path: normal review, then the merge queue; #11445 closes after this merges.
Reorder stack. Each pull request is based on the one before it.
dragicon; the reorder handle draws ithandleoption (placement,revealBehavior), superseding feat(List): the reorder handle starts its row and shows on hover or focus #11454 and feat(List): createReorderable's handle option places the reorder handle and sets how it reveals #11575Overlap checked: #11445, #11583, #12146, #11600, #10849, #11226 (#11445 is superseded, since its branch takes no maintainer edits; #12146 and #11600 build on this; #11583's grip geometry moves to its own pull request above #12146; #10849 and #11226 touch other reorder paths, not the grip, the icon registry, or ComponentIcon)
What changed on top of Ernest's commit
ComponentIcon. The handle used a copy of the shared slot renderer. It now renders<ComponentIcon slot="list-reorder-handle">.ComponentIcontakes an optionalxstylefor the icon, so the grip still passes presses on to the handle.spec:AST-103FR5 now reads "Reordering adds at most one control to a row", and records the grip's artwork as the onearchitecture:component-style-authoringINV7 exception for a list row, with measured counts: a List row at rest has 2 elements below its<li>without reordering, and 11 with it (the handle, and its grip's wrapper,<svg>and six dots). A test keeps those counts. The verification row fails "more than one added control per row, an added element outside the handle, a grip that assistive technology reaches".IconRegistryrequiresdragfrom 0.8.0. Until then a complete registry may omit it and the default grip fills in.architecture:icon-resolution-and-component-slotsINV10, the type's comment and the Changeset say so.dragicon at thesmsize in the secondary icon color, no hover fill.User need
A reorderable collection's handle draws three horizontal lines. Core List draws it, and Lab's ListInput and TransferList use the same handle. On the web, three lines read as a menu: it is the same shape as the
menuicon. People who see it expect a menu, not a grip. The glyph is also a fixed CSS drawing, so a theme or an app that wants another grip cannot change it.Problem and solution fit
dragicon.dragjoins the semanticIconNameset, with a six-dot grip as its built-in default. A theme or an app replaces it as it replaces any semantic icon:defineTheme({icons: {drag}})orregisterIcons({drag}). The bundled themes map it to Lucide'sGripVertical. The CLI already ships adragicon definition; it becomes a built-in definition.list-reorder-handle, which falls back todrag. A theme replaces the grip for the handle alone withdefineTheme({componentIcons: {'list-reorder-handle': …}}), as it does Table's sort indicator.nullhides the grip and keeps the handle.dragicon at thesmsize (16px), as a bare glyph with no hover fill, in the handle's secondary icon color. The handle keeps its 28px box, its focus ring, its touch hit area, its reorder-mode fill, its keyboard path and its announcements.Current specification
This pull request amends three records; the decisions to approve are those amendments. It conforms to three others without changing them.
Amended:
spec:AST-103(reorderable collections) FR5: one added control per row, the grip's artwork inside the handle as the list row's INV7 exception, the measured counts, and the verification row above.architecture:icon-resolution-and-component-slotsINV10: a new sharedIconNamedoes not break a completeIconRegistrywritten before it; a complete registry mapsdragfrom 0.8.0. The record's new cleanup entryCLN-0030stages that 0.8.0 change:IconRegistrybecomesRecord<IconName, ReactNode>again, with its migration (add adragentry to a registry typed asIconRegistry), rollback, andpendingstate for 0.8.0's[breaking]Changeset.component:List: the additive theme surface line forcomponentIcons['list-reorder-handle'], the FR5 line now naming one control with its grip inside it, and DD1.Conforms to, unchanged:
spec:AST-084(icon sets) FR4 and FR15:drag.doc.mjsgainsbuiltIn: true, and every icon set mapsdrag.spec:AST-082(native-first surfaces) FR17: Apple mapsdragtoline.3.horizontal, the system's reorder glyph; Android maps it todrag_indicator.architecture:public-component-apiINV25: the public rows to approve are theIconNamevalue'drag', theComponentIconSlotMapslot'list-reorder-handle', andIconRegistry'sdragentry, required from 0.8.0.Public delta and caller burden
IconNamegains'drag'.defineThemeicons are a partial map, so no theme has to change.IconRegistry, the type of a complete registry, keepsdragoptional until 0.8.0, so a registry typed with it still compiles (spec:AST-017FR5). An omitteddragdraws the default grip. From 0.8.0 a complete registry mapsdrag: the Changeset tells such a registry to add adragentry, as the bundled themes do here.ComponentIconSlotMapgains the stateless slot'list-reorder-handle', listed in List'stheming.componentIcons.drag(AST-084 FR15). Until it does,integration checkreportsicon_builtin_definition_missingfor it. That is a change to the experimental icon-set feature, so it has its own[experimental]patch Changeset for@astryxdesign/cli(spec:AST-084FR0,spec:AST-017FR22); the stable[feat]Changeset covers the rest.dragicon (before: three CSS lines). Its color stays--color-icon-secondary. No prop, size, focus, keyboard or announcement change.ComponentIcon(internal) takes an optionalxstylefor its icon.IconName.dragjoins the generated built-in names.Design and alternatives
dragfor icon sets. The slot maps to the shared name (INV3).dragicon.dragrequired inIconRegistrynow: rejected. It would break every complete registry in a patch; it becomes required in 0.8.0.menuglyph, and six dots are the common drag affordance. The Apple platform map keeps the system's three-line reorder glyph, where people expect it.Evidence
Real Chromium, static Storybook builds of
mainand of this branch, at 2x. Captures are below.First load
The
dragartwork joins the default icon map that every page rendering anIconloads. First-load JS gzip delta in bytes, Core built with its ownbuild:esmat the base (48a3d9d) and at this head, each reference page bundled in production mode (React, React DOM and StyleX external). Chunk counts are unchanged, and deferred modules stay lazy:Captures
List, at rest
mainList, pointer over a handle (no hover fill)
mainList, keyboard focus on a handle
mainList, reorder mode (the pressed fill stays)
mainList, dark mode
mainListInput (Tag options), pointer over a record
mainListInput (Tag options), keyboard focus on a handle
mainTransferList (Default)
mainScope
Components: Icon, ComponentIcon, ComponentIconSlotMap, IconRegistry, List, ListInput, TransferList (shared reorder handle), themes, CLI icon definitions, native icon names
Formatting note
packages/cli/assets/docs/icons.doc.mjsgains one row. Prettier also reindents the rest of that file: the file was not Prettier-formatted on main, and the commit hook formats every staged file.Testing
At this head:
vitest run --project uifor Core List and Icon and Lab ListInput and TransferList: 20 files, 461 tests pass. New: the FR5 counts (2 elements below a plain row, 11 with reordering, 8 inside the handle).check:knowledge.From Ernest's head, unchanged by the commit on top: the full
uiproject (1,023 files), the CLI isolation golden, the touch and reorder-mode interaction specs, andpnpm bundle:cli-themesand the native generator.Writing rubric results
Records:
docs/specs/AST-103-reorderable/spec.md(FR5 and its verification row),docs/architecture/icon-resolution-and-component-slots.md(INV10 and cleanup record CLN-0030),docs/specs/components/List/List.spec.md(the theme-surface line, the FR5 line, DD1).