feat(desktop): add editable Monaco diff view for uncommitted changes

Merged
KI
1y ago
+134-26

Summary

  • Enable editing files directly in the Monaco diff view for unstaged and staged changes
  • Added saveFile tRPC mutation to write file contents to disk
  • Modified side of DiffEditor is now editable with ⌘S / Ctrl+S to save
  • Shows "Editable ⌘S to save" badge in the diff toolbar when editable
  • When saving from staged view, automatically switches to unstaged view (since edits become new unstaged changes)

Test plan

  • Open a workspace with uncommitted changes
  • Select an unstaged file - verify "Editable" badge appears and you can edit the right side
  • Make changes and press ⌘S - verify file saves and diff updates
  • Select a staged file - verify you can also edit it
  • Save changes in staged view - verify it switches to unstaged view showing new changes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added in-place file editing directly in the changes view.
    • Implemented save functionality to persist edited files to disk.
    • Added visual indicators for edit mode and saving status.
    • Introduced keyboard shortcut (Ctrl/Cmd+S) for quick saving.

✏️ Tip: You can customize this high-level summary in your review settings.