feat: drag-and-drop worktree reordering with persistence#270
feat: drag-and-drop worktree reordering with persistence#270Guilhem-lm wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @Guilhem-lm's task in 3m 3s —— View job Code Review — drag-and-drop worktree reorderingReviewed the full diff against Below are findings, none of which are merge-blockers. 🟡 Worth addressing1. Stale drop indicator on invalid hover — 2. Touch / mobile has no reorder path — 🟢 Minor / nits3. 4. CLI reorder bypasses the 5. Logic duplicated across the package boundary — ✅ Confirmed correct
(Note: I tried to leave items 1 & 2 as inline comments but the GitHub inline-comment API returned an error, so they're consolidated here.) |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
webmux | beee042 | Commit Preview URL Branch Preview URL |
Jun 17 2026, 01:13 PM |
…order args Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks for the thorough review! Addressed in beee042: 🟡 #1 — Stale drop indicator ✅ Fixed. 🟢 #3 — Acknowledged, not changing:
|
|
Claude finished @Guilhem-lm's task in 1m 46s —— View job Code Review — drag-and-drop worktree reordering (re-review of
|
centdix
left a comment
There was a problem hiding this comment.
Better to just store the ordering in local storage
Summary
Adds drag-and-drop reordering of the worktree list with a persisted custom order, available across both the web dashboard and the CLI. Previously the list was always sorted alphabetically by branch.
The order is stored per-project in
.webmux/order.json(a{ schemaVersion, branches[] }global branch order), mirroring the existing archive-state pattern. The sidebar sorts by this order (ordered branches first, unknown/new branches appended alphabetically), so newly created worktrees slot in predictably and renamed/removed branches degrade gracefully.Demo
Screen.Recording.2026-06-17.at.15.06.19.mov
Changes
Persistence (backend)
WorktreeOrderStatetype +WORKTREE_ORDER_STATE_VERSIONindomain/model.tsgetProjectOrderStatePath/readWorktreeOrderState/writeWorktreeOrderStateinadapters/fs.tsorder-service.ts:createWorktreeOrderState(dedupe),moveBranchInOrder,pruneWorktreeOrder,buildWorktreeOrderComparatorOrderStateService(locked mutations, skip-write-if-unchanged), mirroringArchiveStateService; wired intoruntime.tsbuildWorktreeSnapshotssorts by the saved order instead of plain alphabeticalreadProjectSnapshotprunes stale branches and passes the order throughPUT /api/worktrees/orderendpoint (apiSetWorktreeOrder)API contract
setWorktreeOrderpath, request/response schemas, contract entry, exported typesFrontend
App.svelte)moveBranchInOrder(sibling-validated) andapplyBranchOrder;WorktreeListRowgainsparentBranchCLI parity
webmux listhonors the saved orderwebmux reorder <branch> --before|--after <branch>command (parsing, usage, handler, root-command wiring, shell completions)Checks
svelte-check: 0 errors / 0 warningstsc --noEmit: cleanmoveBranchInOrder/applyBranchOrder/parentBranch(frontend); reorder parsing + end-to-end reorder→list (CLI)webmuxand the serverManual testing
/Users/guilhem/Devel/windmill, 31 worktrees): UI loads,GET /api/worktreesreturns the list,PUT /api/worktrees/orderreturns 200localStorage.clearenv issue; git/lifecycle/instance-registry suites) are present on the clean base tooTest plan
webmux reorder <branch> --before <other>thenwebmux listreflects the new orderwebmux reorder <unknown> --after <branch>errors cleanlyGenerated with Claude Code