Repository navigation
feat(desktop): add editable Monaco diff view for uncommitted changes - #387
Conversation
Allow editing files directly in the diff view for unstaged and staged changes: - Added saveFile tRPC mutation to write file contents - DiffEditor modified side is now editable with Cmd+S to save - Shows "Editable ⌘S to save" badge in toolbar - When saving staged files, automatically switches to unstaged view 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces file-saving functionality to the desktop application. A new TRPC endpoint Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChangesContent as ChangesContent<br/>(React Component)
participant DiffViewer as DiffViewer
participant Mutation as saveFile<br/>(TRPC Mutation)
participant Backend as Backend<br/>(File System)
participant Store as useChangesStore
participant Utils as TRPC Utils<br/>(Cache)
User->>DiffViewer: Press Ctrl/Cmd+S to save
DiffViewer->>DiffViewer: handleSave triggered
DiffViewer->>ChangesContent: Call onSave(content)
ChangesContent->>Mutation: Invoke saveFile(worktreePath, filePath, content)
rect rgb(200, 220, 255)
Mutation->>Backend: Write content to disk (UTF-8)
Backend-->>Mutation: Success/Error
end
Mutation->>Utils: Invalidate file content cache
Mutation->>Utils: Invalidate file status cache
Mutation->>ChangesContent: onSuccess callback triggered
rect rgb(220, 255, 220)
ChangesContent->>Store: selectFile(staged → unstaged)
Store-->>ChangesContent: Updated selection
end
ChangesContent->>DiffViewer: Re-render with updated state
DiffViewer-->>User: Reflect saved changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
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 |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
Summary
saveFiletRPC mutation to write file contents to disk⌘S/Ctrl+Sto saveTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.