Skip to content

fix(workspace-board): sync Linear on context-menu Move to Status - #10176

Merged
AmethystLiang merged 2 commits into
stablyai:mainfrom
ElNelyo:fix/kanban-context-menu-linear-sync
Jul 24, 2026
Merged

AmethystLiang merged 2 commits into
stablyai:mainfrom
ElNelyo:fix/kanban-context-menu-linear-sync

Conversation

@ElNelyo

@ElNelyo ElNelyo commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #10175 — the workspace board context-menu "Move to Status" silently drops the Linear sync that drag-and-drop performs.

Root cause

handleAssignWorkspaceStatus in WorktreeContextMenu only wrote the local workspaceStatus. The Linear sync (maybeSyncWorkspaceBoardTaskStatuses) lived in WorkspaceKanbanDrawer and 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 onAssignWorkspaceStatus callback from the drawer through the kanban card chain (LaneGrid → StatusLane → KanbanCard → WorktreeCard → WorktreeContextMenu). The menu now funnels through the new moveWorktreesToStatus (batch equivalent of the existing single-worktree moveWorktreeToStatus), 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

  • Approach chosen: prop-threading (Option 1) over calling the sync directly from the menu (Option 2). This keeps the sync orchestration, gating (getWorkspaceBoardTaskStatusSyncRequest), settings resolution, and toast handling in a single place (WorkspaceKanbanDrawer), avoiding duplication and matching the existing drag-drop path exactly.
  • Scope: the callback is optional. The sidebar-list usage does not pass it, so its behavior is unchanged (local-only) — consistent with the fact that drag-drop (the only other sync trigger) also only exists on the board.
  • Multi-select: the handler accepts a worktreeIds[] and the batch path filters out no-op (same-status) entries before writing or syncing, mirroring dropWorktreesInStatus.
  • Risks: low. No change to the sync module itself, no store middleware added, no new network paths. The only behavioral change is that the board context-menu now also triggers the already-existing sync.

Security Audit

  • No secrets, tokens, or credentials introduced or logged.
  • No new network calls — the Linear update goes through the existing linearUpdateIssue runtime client already used by drag-drop.
  • Worktree ids and status ids are already-trusted store values; no untrusted input reaches the Linear API.
  • No changes to auth, IPC, or filesystem paths.

Testing

  • New regression tests in WorkspaceKanbanDrawer.task-status-sync.test.tsx:
    • syncs Linear when the board context-menu assigns a status (enabled)
    • does not sync when the setting is disabled
    • does not sync a no-op move that keeps the same status
  • tsc --noEmit -p config/tsconfig.tc.web.json — clean
  • oxlint (+ react-doctor via lint-staged) and oxfmt — clean
  • Existing sidebar test suite green (workspace-board-task-status-sync, WorktreeCard.*, workspace-kanban.*)

Notes

  • The fix is intentionally scoped to the workspace board. Extending Linear sync to the sidebar-list context menu would be a separate, deliberate behavior change (the setting is named "Sync task status from workspace board").
  • No max-lines disables added; the prop-threading touches several files but each change is a single optional prop.

Closes #10175

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.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 019d596f-6145-4fcf-b2b7-6dff772e402c

📥 Commits

Reviewing files that changed from the base of the PR and between 1e00738 and 2c7e64a.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/WorktreeContextMenu.test.ts
  • src/renderer/src/components/sidebar/WorktreeContextMenu.tsx

📝 Walkthrough

Walkthrough

Adds 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, screenshots, testing, AI review, security, and notes, but omits the required explicit cross-platform compatibility confirmation. Add an explicit note that the AI review checked macOS, Linux, and Windows behavior, including shortcuts, paths, shell behavior, and Electron-specific differences.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main behavior change: syncing Linear from the workspace-board Move to Status action.
Linked Issues check ✅ Passed The code now routes board context-menu status moves through the shared sync path and preserves local-only sidebar behavior, matching #10175.
Out of Scope Changes check ✅ Passed The changes are limited to the context-menu sync path, related prop threading, and regression tests; no unrelated functionality was added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang self-requested a review July 23, 2026 20:03
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 AmethystLiang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: moveWorktreesToStatus faithfully mirrors the existing moveWorktreeToStatus/dropWorktreesInStatus (no-op filter, recordFeatureInteraction, batch write, sync on changed ids).
  • Selection correctness: activeContextWorktrees is captured in the render closure; the synchronous setMenuOpenState(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.

@AmethystLiang AmethystLiang reopened this Jul 24, 2026
@AmethystLiang
AmethystLiang merged commit 0bb7551 into stablyai:main Jul 24, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Workspace board "Move to Status" context menu doesn't sync Linear

2 participants