Skip to content

Remove the Merge Locally panel - #426

Open
frenchie4111 wants to merge 2 commits into
mainfrom
remove-merge-locally
Open

frenchie4111 wants to merge 2 commits into
mainfrom
remove-merge-locally

Conversation

@frenchie4111

Copy link
Copy Markdown
Collaborator

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:

  • squash-merged the branch into main with no confirmation
  • wrote the commit message as <branch> (squashed), losing the agent's own message
  • moved the worktree out of sight into the collapsed Merged / Closed group

Only the maintainer's own local workflow used it. For everyone else it caused confusion, so this PR removes it entirely.

Removed

  • UI: the MergeLocallyPanel / MergeLocallyBody panel (desktop right column and mobile), the 'merge' right-panel key and its toolbar label, the useLocalMergeState hook, and the onMerged / onRemoveWorktree props that only fed the panel.
  • Requests and backend methods: worktree:mainStatus, worktree:prepareMain, worktree:previewMerge, worktree:mergeLocal, plus their ElectronAPI methods and types (MainWorktreeStatus, MergeConflictPreview, MergeLocalResult).
  • Main process: src/main/local-merge.ts and its test, and from worktree.ts: mergeWorktreeLocally, prepareMainForMerge, getMainWorktreeStatus with its TTL cache (and that cache's test), previewMergeConflicts, getLocalBaseBranch.
  • prs slice: mergingByPath and the prs/localMergeStarted / prs/localMergeFinished events.
  • Repo config: the deprecated hideMergePanel field and its migration.

Kept on purpose

  • mergeStrategy (global and per repo): the GitHub PR merge button in PRStatusPanel / CollapsedRightPanel also 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.
  • No mentions found of local merge in resources/mcp-bridge.js, control-server.ts, the system prompt text, the README, CLAUDE.md or site/. 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 into prs.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 / groupWorktrees are unchanged.

Persisted config

  • config.json: no fields were removed (mergeStrategy and locallyMerged are still read), so old files load unchanged.
  • .ness.json / .harness.json: files with hideMergePanel, hiddenRightPanels.merge, 'merge' in rightPanelOrder or unknown keys load fine. effectiveRightPanelOrder already drops unknown keys, and the hidden-panel map ignores merge. We never rewrite these files on our own. The stale keys are dropped only on the next save the user triggers. New tests in repo-config.test.ts and repo-configs.test.ts cover this.

Verification

  • npm run typecheck: passes.
  • npx electron-vite build: passes.
  • npx vitest run: 199 files, 2836 tests pass.
  • Not visually verified on a headless server, because another worktree's install was about to share the disk.

🤖 Generated with Claude Code

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>
@frenchie4111
frenchie4111 deployed to evidence-review-auto November 26, 2026 18:47 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown

🟡 Evidence review: partially verified

The 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.

Claim Evidence Notes
🟡 The Merge Locally panel no longer appears in the right column/panel list. E1 Panel visibility menu on feature/login lists 'Merge Locally' before and not after. The panel body itself was not rendered in the right column in the before build either, because the fixture has no GitHub token and the panel only shows when hasGithubToken is not false. The column-level before state could not be demonstrated.
✅ Settings merge strategy copy describes GitHub's methods; third option is labelled 'Rebase and merge'. E2 Before: 'Default merge strategy' copy referencing 'Merge locally' with options Squash / Merge commit / Fast-forward only. After: 'How the merge button on a worktree's PR merges it on GitHub' with Squash and merge / Merge commit / Rebase and merge.
Test plan
  • The Merge Locally panel no longer appears in the right column for a worktree with no PR (non-main worktree).: Select the feature/login worktree in sidebar (no PR since no GitHub remote). Ensure right column visible (Meta+Shift+b if needed). Look at TOOLS column top for 'Merge Locally' section. Also open Panel visibility menu (sliders button next to TOOLS) and check for 'Merge Locally' entry. → Before: right column shows a 'Merge Locally' panel at top with Squash and merge button; Panel visibility menu lists Merge Locally. After: no Merge Locally panel; no entry in visibility menu.
  • Settings merge strategy copy describes GitHub methods; third option labelled 'Rebase and merge'.: Meta+, to open Settings, find the merge strategy section (likely under Git / Pull requests), scroll to it. → Before: 'Squash', 'Merge commit', 'Fast-forward only' labels with local merge copy. After: 'Squash and merge', 'Merge commit', 'Rebase and merge' with GitHub copy.

E1

Panel 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.

Before After
E1 before E1 after

E2

Settings > 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".

Before After
E2 before E2 after

Model anthropic/claude-haiku-5.5 · 14 actions · 302019 reviewer tokens · $0.0314 total (reviewer $0.0314, agents in app $0.0000 over 0 calls)

  • Re-run evidence review on the latest push

Automated evidence review of 72b338b9 · run log + transcript

github-actions Bot added a commit that referenced this pull request Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active (outdated) deployment
evidence-review-auto — 72b338b9 Deployed Nov 26, 2026 by frenchie4111 via review #90
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.

1 participant