Repository navigation
fix(sidebar): preserve hidden rows in manual order - #16488
Conversation
466177c to
ade5f2e
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds a global manual-order catalog for Git worktrees and folder workspaces. Drag handlers use catalog ranks and complete worktree IDs to preserve hidden rows and sparse durable ranks. Metadata updates now persist folder-workspace changes separately and write Git worktree changes to known owner hosts. Unit, integration, and end-to-end tests cover ordering, duplicate IDs, filtered drops, owner routing, persistence, activity updates, reload behavior, and asynchronous watcher assertions. Merge Risk: 🔵 Low · up to The change preserves hidden rows in manual ordering and is mergeable with owner awareness, but the restart coverage relies on a fixed one-second delay that may intermittently flake on slower or loaded CI machines. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description follows the required template and covers the change, rationale, linked issue, visual proof, testing, review notes, compatibility considerations, and checklist status. It also documents the unrelated repository-wide typecheck:e2e failure.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/renderer/src/components/sidebar/WorktreeList.tsx (1)
109-112: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider one shared hook for the catalog.
WorkspaceKanbanDrawer.tsxbuilds the same memoized catalog from the same two inputs. A shareduseWorktreeManualOrderCatalog()hook keeps the sidebar and the board on identical inputs if the sources change later.♻️ Proposed hook
// src/renderer/src/components/sidebar/use-worktree-manual-order-catalog.ts export function useWorktreeManualOrderCatalog(): WorktreeManualOrderCatalog { const allWorktrees = useAllWorktrees() const folderWorkspaces = useAppStore((s) => s.folderWorkspaces) return useMemo( () => buildWorktreeManualOrderCatalog({ worktrees: allWorktrees, folderWorkspaces }), [allWorktrees, folderWorkspaces] ) }tests/e2e/manual-worktree-order-persistence.spec.ts (1)
153-154: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPoll the persisted UI and worktree state before relaunch.
The 1-second sleep does not guarantee completion of the debounced
window.api.ui.setcall. Pollwindow.api.ui.get()forsortBy === 'manual', and query persisted worktree data for themanualOrdervalues. Do not usewindow.api.settings.get()forsortBy; it belongs toPersistedUIState.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9c5dce0c-2ca1-4317-b12d-cb90091a4b31
📒 Files selected for processing (16)
src/renderer/src/components/sidebar/WorkspaceKanbanDrawer.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/use-workspace-kanban-worktree-actions.tssrc/renderer/src/components/sidebar/workspace-kanban-sidebar-drop.test.tssrc/renderer/src/components/sidebar/workspace-kanban-sidebar-drop.tssrc/renderer/src/components/sidebar/worktree-list/drag/use-status-mutations.tssrc/renderer/src/components/sidebar/worktree-manual-order-catalog.test.tssrc/renderer/src/components/sidebar/worktree-manual-order-catalog.tssrc/renderer/src/components/sidebar/worktree-manual-order-ranks.tssrc/renderer/src/components/sidebar/worktree-manual-order.test.tssrc/renderer/src/components/sidebar/worktree-manual-order.tssrc/renderer/src/store/slices/folder-workspace-owner-routed-mutations.test.tssrc/renderer/src/store/slices/worktrees-metadata-persistence.test.tssrc/renderer/src/store/slices/worktrees/listing/worktree-owner-settings.tssrc/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.tstests/e2e/manual-worktree-order-persistence.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
(cherry picked from commit c8567eb)
ELI5
Manual order could still depend on Smart-sort metadata for rows hidden by filters or collapsed groups. Those rows could jump when revealed. This change gives every known row a durable manual rank the first time a real drag establishes Manual order, while preserving hidden rows in their existing slots.
What Changed
manualOrder.sortOrderwrites, reload, folder rows, and duplicate host ownership.Why
Manual uses
manualOrder ?? sortOrder.sortOrderis mutable Smart-sort state, so leaving filtered or collapsed rows withoutmanualOrdermeans the displayed Manual order is not fully user-owned. PR #14284 backfills only rendered rows and also targets an older Board persistence path; this branch applies the stronger complete-known-row behavior to current main.Linked Issue
STA-3921
Related hypothesis: #14284
Visual Proof
N/A — this fixes ordering persistence without changing component visuals. A real Electron drag/reload flow is covered by
manual-worktree-order-persistence.spec.ts.Testing
Passed after rebasing onto latest
origin/main:pnpm -s typecheckmanual drag survives activity and persisted-profile reload(1/1)a → c → bafter a persisted Smart reorder and full process restart; all four rows, including a collapsed row, retained finitemanualOrderorca-data.json; openclaw's SSH row was read back from the client-owned profile with the correct SSHhostId; all three fixtures were removedpnpm -s typecheck:e2eremains red on unrelated repository-wide pre-existing errors; it reports no error from this spec.Review
Three fresh same-worktree OpenCode reviews covered persistence boundary/efficiency, product semantics, and migration/regression compatibility. Their initial blockers led to the shared complete catalog, required rank inputs, defensive merge, same-ID host fan-out, folder support, and a stronger E2E refresh oracle. All three final verdicts are READY.
Invariant: after a real user reorder establishes Manual mode, Manual is one durable order for every known non-archived workspace. Filters and collapsed groups are presentation-only; they do not remove rows from that order.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (targeted checks passed; full E2E typecheck has unrelated existing failures)