feat(desktop): add bulk git operations to changes sidebar#802
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds five git helper functions (discard/stash/pop), re-exports them, exposes TRPC endpoints in the staging router, and wires stash/discard UI controls, dialogs, and mutations into ChangesView and ChangesHeader. Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as ChangesView / ChangesHeader
participant Mutation as TRPC Mutation
participant Router as Staging Router
participant Git as Git Helper (simpleGit)
User->>UI: Trigger "Stash" / "Discard All" action
UI->>Mutation: mutation.mutate({ worktreePath })
Mutation->>Router: TRPC endpoint call
Router->>Git: call gitStash / gitDiscardAll*
Git->>Git: validate worktree & run git commands
Git-->>Router: resolve/reject
Router-->>Mutation: return { success: true } / error
Mutation->>UI: update state, refetch status
UI->>User: show success/error toast, update UI
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add VSCode-like operations: discard all changes (staged/unstaged), stash, stash including untracked, and pop stash. Includes confirmation dialogs for destructive discard operations.
ee09683 to
7943579
Compare
Remove destructive color and hide discard buttons by default, showing them only when hovering over the section header.
- Restructure header into two rows - Row 1: Base branch selector, view mode toggle, refresh - Row 2: Stash dropdown (with VscGitStash icon), PR status
- BaseBranchSelector: handles branch selection logic and UI - StashDropdown: stash operations dropdown menu - RefreshButton: refresh with spin animation - PRStatusLink: PR status display with loading state
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
* feat(desktop): add bulk git operations to changes sidebar Add VSCode-like operations: discard all changes (staged/unstaged), stash, stash including untracked, and pop stash. Includes confirmation dialogs for destructive discard operations. * style(desktop): show discard buttons only on hover like VSCode Remove destructive color and hide discard buttons by default, showing them only when hovering over the section header. * refactor(desktop): make stash props required in ChangesHeader * style(desktop): move stash/PR to second row, use VSCode git stash icon - Restructure header into two rows - Row 1: Base branch selector, view mode toggle, refresh - Row 2: Stash dropdown (with VscGitStash icon), PR status * style(desktop): move all action buttons to second row * style(desktop): align all action buttons to start * refactor(desktop): extract ChangesHeader into smaller components - BaseBranchSelector: handles branch selection logic and UI - StashDropdown: stash operations dropdown menu - RefreshButton: refresh with spin animation - PRStatusLink: PR status display with loading state
Summary
Test plan
Summary by CodeRabbit
New Features
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.