Repository navigation
Remove the Merge Locally panel - #426
frenchie4111 wants to merge 2 commits into
Conversation
The panel sat at the top of the right column for every worktree without a PR, merged into main with one click and no confirmation, overwrote the agent's commit message with "<branch> (squashed)", and moved the worktree into the collapsed Merged / Closed group. Removed: MergeLocallyPanel (desktop + mobile), the 'merge' right-panel key and its toolbar entry, useLocalMergeState, the worktree:mainStatus / prepareMain / previewMerge / mergeLocal handlers and backend methods, local-merge.ts, mergeWorktreeLocally / prepareMainForMerge / getMainWorktreeStatus (+ cache) / previewMergeConflicts, and the prs slice's mergingByPath + localMergeStarted/Finished events. Kept: mergeStrategy (the GitHub PR merge button uses it; Settings copy now describes GitHub's methods), merge-conflict-request.ts (PR flow), and the read-only side of config.locallyMerged so worktrees already merged this way stay under Merged / Closed instead of jumping back to Active. Nothing adds entries any more, so that map only shrinks. Repo configs still carrying hideMergePanel / hiddenRightPanels.merge / 'merge' in rightPanelOrder load cleanly and are never rewritten on their own; the stale keys drop on the next user-initiated write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🟡 Evidence review: partially verifiedThe Merge Locally entry is gone from the Panel visibility menu, and the Settings merge-strategy copy and labels now describe GitHub's methods. In this fixture, the Merge Locally panel body did not render in the right column even before the change (no GitHub token, so the panel's gate hid it), so the visible column change could not be shown; only the menu entry proves removal.
Test plan
E1Panel visibility menu on feature/login. Before: "Merge Locally" is listed at the top with a move-up/down control. After: the entry is gone and the list starts at PR Status.
E2Settings > GitHub > Default merge strategy. Before: "Merge locally" copy, a "Squash" option, "Merge commit", and "Fast-forward only". After: "How the merge button on a worktree's PR merges it on GitHub", with "Squash and merge", "Merge commit" and "Rebase and merge".
Model
Automated evidence review of |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>




Why
In a new-user dogfood pass, the Merge Locally / Squash and merge panel appeared at the top of the right column for every worktree that had no PR, including ones with zero commits. A single click:
<branch> (squashed), losing the agent's own messageOnly the maintainer's own local workflow used it. For everyone else it caused confusion, so this PR removes it entirely.
Removed
MergeLocallyPanel/MergeLocallyBodypanel (desktop right column and mobile), the'merge'right-panel key and its toolbar label, theuseLocalMergeStatehook, and theonMerged/onRemoveWorktreeprops that only fed the panel.worktree:mainStatus,worktree:prepareMain,worktree:previewMerge,worktree:mergeLocal, plus theirElectronAPImethods and types (MainWorktreeStatus,MergeConflictPreview,MergeLocalResult).src/main/local-merge.tsand its test, and fromworktree.ts:mergeWorktreeLocally,prepareMainForMerge,getMainWorktreeStatuswith its TTL cache (and that cache's test),previewMergeConflicts,getLocalBaseBranch.prsslice:mergingByPathand theprs/localMergeStarted/prs/localMergeFinishedevents.hideMergePanelfield and its migration.Kept on purpose
mergeStrategy(global and per repo): the GitHub PR merge button inPRStatusPanel/CollapsedRightPanelalso reads it (squash → squash, merge-commit → merge, fast-forward → rebase). The Settings copy now describes GitHub's methods, and the third option is labelled "Rebase and merge" because that is what it does on GitHub. The stored value is unchanged.merge-conflict-request.ts: this is the PR flow's "ask the agent to fix conflicts with the base" message. It has nothing to do with the local merge.resources/mcp-bridge.js,control-server.ts, the system prompt text, the README, CLAUDE.md orsite/. The historical release notes are untouched.Worktrees users already merged locally
I chose to keep them under Merged / Closed. The merge recorded
config.locallyMerged(branch → tip SHA), and the poller turns it intoprs.mergedByPath. I kept that read path and removed every writer, so the map only shrinks. An entry is pruned once its branch moves past the recorded SHA or its worktree is removed.Why: a worktree whose work is already on main jumping back to Active after an update would be the surprising outcome. It would also lose the merged-worktree behaviour, such as sleeping on boot. GitHub-merged and closed PRs group exactly as before, because
isWorktreeMerged/groupWorktreesare unchanged.Persisted config
config.json: no fields were removed (mergeStrategyandlocallyMergedare still read), so old files load unchanged..ness.json/.harness.json: files withhideMergePanel,hiddenRightPanels.merge,'merge'inrightPanelOrderor unknown keys load fine.effectiveRightPanelOrderalready drops unknown keys, and the hidden-panel map ignoresmerge. We never rewrite these files on our own. The stale keys are dropped only on the next save the user triggers. New tests inrepo-config.test.tsandrepo-configs.test.tscover this.Verification
npm run typecheck: passes.npx electron-vite build: passes.npx vitest run: 199 files, 2836 tests pass.🤖 Generated with Claude Code