Unlock button for locked worktrees in the sweeper - #111
Open
scgopi wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.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.lockedfact 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.Changes
GitClient/RemoteGitClient: newunlockWorktreeoperation (git -C <repo> worktree unlock -- <path>, SSH twin for remote projects).WorktreeSweepFeature:unlockTapped/unlockSucceeded/unlockFailedactions and anunlockingin-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
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.graphcodescheme test suite passes (xcodebuild test, all suites green).git worktree add --lock→ unlock via the exact client invocation →worktree list --porcelainshows 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