feat(worktree): rich delete confirmation dialog with dirty-file status - #11
Merged
Merged
Conversation
- Add worktree-status IPC in main.js: runs git status --porcelain
for the worktree path, returns { ok, dirty, total }
- Expose as window.api.worktreeStatus() in preload.js
- Replace bare confirm() in sidebar.js with showDeleteWorktreeDialog():
- Modal shows worktree name, permanent-loss warning, and dirty-file list
- Fetches git status asynchronously while modal is open
- Lists first 10 dirty files in <pre>, '+ N more' if truncated
- Clean worktree shows green 'no uncommitted changes' message
- IPC error shows red 'Unable to read worktree status' message
- Cancel / Delete anyway buttons; Escape key closes; overlay click cancels
- Add CSS for .delete-worktree-dialog, .delete-worktree-warning,
.delete-worktree-status, .dwt-* classes matching existing dark theme
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.
Closes the UX gap flagged in PR#49 review: the old
confirm()hid the destructive consequence of-f(untracked/uncommitted files lost forever).Changes
main.js— newworktree-statusIPC handlergit -C <parentRepo> -C <worktreePath> status --porcelainWORKTREE_PATH_REpath-validation already indelete-worktree{ ok: true, dirty: string[], total: number }or{ ok: false, error }preload.js— exposewindow.api.worktreeStatus(path)public/sidebar.js— replace bareconfirm()withshowDeleteWorktreeDialog()<name>?"+ N more) / red error messagepublic/style.css—.delete-worktree-dialog,.delete-worktree-warning,.delete-worktree-status,.dwt-*classes matching existing dark themeTests
npm run lint🤖 Generated with Claude Code