Chrome-style live sidebar reorder: rows animate on mousemove, groups drag as blocks
Dragging in the AppKit sidebar previously showed only a 2px indicator line; the reorder happened after mouseup. Now drags that begin in the sidebar animate rows apart around a moving slot on every mousemove, Chrome-vertical-tabs style: a floating snapshot of the dragged row tracks the pointer (X-locked, lift shadow), the origin slot closes immediately, and escape or dropping outside animates everything back with no model change.
Group headers are now draggable and move their whole group as one block (the drop resolver already planned anchor drags as top-level block moves; the table just refused to start them). Dragging a workspace across a group's member span previews the join live and the floating row indents; the collapsed-group and pinned-tier semantics come from the existing resolver unchanged.
Mechanism: the system NSDraggingSession stays alive underneath. Our own drop overlay hides the drag image destination-side (it auto-restores on exit, so cross-window drags and bonsplit interop keep today's indicator path), resolves the same SidebarWorkspaceReorderDropResolver plan on every draggingUpdated, and a new pure permutation resolver (CmuxFoundation, unit-tested) maps that plan's indicator onto a visible row order which the table animates via moveRow. The model commits once on drop from the last previewed plan, so preview and commit agree by construction. Authoritative applies landing mid-drag are deferred when content-only and degrade the session to the classic indicator path when structural.
Verified on a fleet Mac (aws-m4pro-4, ardrec GUI session) with real cursor drags over the ARD protocol: mid-drag frames show rows reordered before mouseup for a workspace drag, a group-header block drag, and a group join with indent; escape restored the original order with no commit. 10 new unit tests on the permutation resolver pass.
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.
Summary by cubic
Adds Chrome‑style live reorder in the sidebar. Rows animate around a moving slot with a floating snapshot; group headers drag their whole block. Direct pointer tracking runs local drags and hands off cleanly to the system session.
-
New Features
- Live preview with a floating row (indent from commit destination, “+N” badge), block‑center thresholds, a sticky last‑member boundary, and a “keep current preview while riding the block” rule; a no‑op zone restores on return to origin. The widened corridor keeps preview/commit even slightly outside the sidebar.
- The system drag session stays active: the drag image hides on enter and auto‑restores on exit; cross‑window/foreign drags keep the classic indicator; Esc cancels with no commit.
-
Refactors
- Introduced
SidebarWorkspaceDirectReorderGestureand direct pointer tracking in the table to own press/drag with a drag threshold and a reliable system‑drag handoff; rebuilt the local session around immutable drag state withSidebarWorkspaceTableLocalReorderSession. - In
CmuxFoundation, addedSidebarWorkspaceReorderMovePlannerandSidebarWorkspaceReorderPreviewPermutation; resolver acceptsstickyDestinationand the preview refreshes targets after each permutation. Localized the “+N” badge string. - Tests: unit tests for the planner, permutation, sticky boundary, corridor, and gesture lifecycle; new XCUITests for slow/held drags and reorder gestures.
- Introduced
Summary by CodeRabbit
- New Features
- Added continuous local live-reorder previews in the sidebar for both individual workspaces and grouped headers, including an animated floating “dragged block” with correct indentation and a “+N” indicator for omitted snapshots.
- Introduced smarter reorder planning to generate efficient table move steps and preview permutations.
- Bug Fixes
- Improved drag-and-drop lifecycle handling, including reliable deferred apply behavior, hover reconciliation during active previews, and consistent drag-image suppression.
- Refined press/selection flow to prevent double-applying selection during drags.
- Tests
- Expanded unit tests for reorder preview permutations and move-step planning.
- Documentation
- Updated inline guidance for the reorder preview/commit flow.