Repository navigation
fix(workspace-board): sync Linear on context-menu Move to Status - #10176
Conversation
The board's right-click "Move to Status" only wrote the local workspaceStatus and silently dropped the Linear sync that drag-and-drop performs. Thread an onAssignWorkspaceStatus callback from the drawer through the kanban card chain into WorktreeContextMenu so the menu funnels through the same local-first + Linear-sync path (moveWorktreesToStatus) as drag-and-drop. Outside the board (sidebar list) the menu keeps its local-only behavior.
|
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 (2)
📝 WalkthroughWalkthroughAdds an optional workspace-status assignment callback across worktree cards, kanban cards, status lanes, and the lane grid. The drawer handles multi-worktree status moves by filtering unchanged items, batching metadata updates, recording the board action, and synchronizing Linear task statuses. Context menus delegate to the callback when provided and retain local updates otherwise. Tests cover enabled, disabled, and unchanged-status synchronization cases. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
Extract the context-menu status-assign routing into a pure planWorkspaceStatusAssignment helper (behavior-preserving) and unit-test it, so the board Linear-sync vs sidebar local-only branch — the exact path stablyai#10175 regressed on — cannot silently flip back unnoticed. Covers board-sync-forwards-all-ids, local-only-writes-only-changed, and the same-status no-op case. Addresses code-review finding: the added drawer tests exercised the sync wiring via a mocked LaneGrid but never the menu's routing branch. Co-authored-by: Orca <[email protected]>
AmethystLiang
left a comment
There was a problem hiding this comment.
Reviewed via a 11-persona parallel code review (correctness, adversarial, reliability, performance, api-contract, security-surface, maintainability, testing, project-standards, agent-native, previous-comments) plus independent validation.
Verdict: zero functionality regression, zero performance regression.
- Behavior parity:
moveWorktreesToStatusfaithfully mirrors the existingmoveWorktreeToStatus/dropWorktreesInStatus(no-op filter, recordFeatureInteraction, batch write, sync on changed ids). - Selection correctness:
activeContextWorktreesis captured in the render closure; the synchronoussetMenuOpenState(false)can't move the wrong worktrees. - Performance: the new callback shares the exact useCallback dep profile of the already-threaded drop callback; every hop forwards the prop directly (no new inline closures); sidebar path leaves it undefined/stable — no new re-render surface.
- Contract:
WorkspaceStatus = string, so the handoff is type-safe; all 6 prop declarations identical/optional and backward-compatible.
Added regression coverage (2c7e64a): extracted the context-menu routing into a pure planWorkspaceStatusAssignment helper and unit-tested the board-sync vs sidebar local-only branch — the exact path #10175 regressed on — since the original drawer tests exercised the sync wiring via a mocked LaneGrid but never the menu's routing branch.
…blyai#10176) * fix(workspace-board): sync Linear on context-menu Move to Status The board's right-click "Move to Status" only wrote the local workspaceStatus and silently dropped the Linear sync that drag-and-drop performs. Thread an onAssignWorkspaceStatus callback from the drawer through the kanban card chain into WorktreeContextMenu so the menu funnels through the same local-first + Linear-sync path (moveWorktreesToStatus) as drag-and-drop. Outside the board (sidebar list) the menu keeps its local-only behavior. * test(workspace-board): guard context-menu Move to Status routing Extract the context-menu status-assign routing into a pure planWorkspaceStatusAssignment helper (behavior-preserving) and unit-test it, so the board Linear-sync vs sidebar local-only branch — the exact path stablyai#10175 regressed on — cannot silently flip back unnoticed. Covers board-sync-forwards-all-ids, local-only-writes-only-changed, and the same-status no-op case. Addresses code-review finding: the added drawer tests exercised the sync wiring via a mocked LaneGrid but never the menu's routing branch. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: ElNelyo <[email protected]> Co-authored-by: Jinjing <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
Fixes #10175 — the workspace board context-menu "Move to Status" silently drops the Linear sync that drag-and-drop performs.
Root cause
handleAssignWorkspaceStatusinWorktreeContextMenuonly wrote the localworkspaceStatus. The Linear sync (maybeSyncWorkspaceBoardTaskStatuses) lived inWorkspaceKanbanDrawerand was unreachable from the shared menu component, which receives no sync callback. So drag-and-drop synced to Linear, but the right-click menu did not.Fix
Thread an
onAssignWorkspaceStatuscallback from the drawer through the kanban card chain (LaneGrid → StatusLane → KanbanCard → WorktreeCard → WorktreeContextMenu). The menu now funnels through the newmoveWorktreesToStatus(batch equivalent of the existing single-worktreemoveWorktreeToStatus), which performs the local-first write and the Linear sync — identical to drag-and-drop. Outside the board (sidebar list) the menu keeps its existing local-only behavior, since Linear sync is scoped to workspace-board moves.Screenshots
N/A — pure logic fix; no visual change. The board context menu and lanes render exactly as before.
AI Review Report
getWorkspaceBoardTaskStatusSyncRequest), settings resolution, and toast handling in a single place (WorkspaceKanbanDrawer), avoiding duplication and matching the existing drag-drop path exactly.worktreeIds[]and the batch path filters out no-op (same-status) entries before writing or syncing, mirroringdropWorktreesInStatus.Security Audit
linearUpdateIssueruntime client already used by drag-drop.Testing
WorkspaceKanbanDrawer.task-status-sync.test.tsx:tsc --noEmit -p config/tsconfig.tc.web.json— cleanoxlint(+ react-doctor via lint-staged) andoxfmt— cleanworkspace-board-task-status-sync,WorktreeCard.*,workspace-kanban.*)Notes
max-linesdisables added; the prop-threading touches several files but each change is a single optional prop.Closes #10175