Skip to content

Unlock button for locked worktrees in the sweeper - #111

Open
scgopi wants to merge 1 commit into
mainfrom
issue-92-unlock-worktrees
Open

Unlock button for locked worktrees in the sweeper#111
scgopi wants to merge 1 commit into
mainfrom
issue-92-unlock-worktrees

Conversation

@scgopi

@scgopi scgopi commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #92.

Locked worktrees (git worktree lock) appeared in the worktree sweeper but could only be explained, not acted on — git refuses their removal even with --force, so the row's tooltip said "unlock it first" and sent the human to the terminal.

  • Unlock button on locked rows: runs git worktree unlock — locally, or over SSH for remote projects — right from the sweeper sheet. The button shows "Unlocking…" and disables while the command runs, so a double click can't race two unlocks.
  • Delete option after unlock: on success the row's locked fact clears in place, it re-tiers, and it is selected — so "unlock, then delete" is one click on the existing Remove button. All the standing safety rails still apply: the dirty-file discard confirmation, and the removal-time re-check against live loop bindings.
  • A failed unlock surfaces git's error in the sheet's failure line and leaves the row locked.

Changes

  • GitClient / RemoteGitClient: new unlockWorktree operation (git -C <repo> worktree unlock -- <path>, SSH twin for remote projects).
  • WorktreeSweepFeature: unlockTapped / unlockSucceeded / unlockFailed actions and an unlocking in-flight set; the effect runs in the child since the sheet stays open, unlike removals.
  • WorktreeSweepView: Unlock button on locked rows; the locked tooltip now points at the button instead of the terminal.

Testing

  • New WorktreeSweepUnlockTests: a locked row can't be selected, unlocking clears the lock and selects the row, and a failed unlock surfaces the error and leaves the row locked.
  • Full graphcode scheme test suite passes (xcodebuild test, all suites green).
  • Verified the live command path against a real locked worktree (git worktree add --lock → unlock via the exact client invocation → worktree list --porcelain shows the lock cleared), and the app builds and launches with the change. Driving the sheet's button by script was blocked by macOS accessibility permissions in this environment, so the click-path is covered by the reducer tests rather than end-to-end UI automation.

🤖 Generated with Claude Code

A locked worktree (git worktree lock) could be seen in the sweeper but not
acted on — git refuses removal even when forced, so the row said 'unlock it
first' and left the human to the terminal. Locked rows now carry an Unlock
button: it runs git worktree unlock (locally or over SSH for remote
projects), clears the row's lock fact in place, and selects the freed row so
removal is one click away — with the dirty-file confirmation still standing.

Closes #92

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

For worktrees that are locked, we need an unlock button to unlock and provide option to delete

2 participants