feat: add conflict-safe file editing - #35
Conversation
There was a problem hiding this comment.
Pull request overview
Adds conflict-safe, revision-gated file editing to the Files pane, integrating controller-backed saves and draft/conflict handling so the UI can safely edit only complete previews and avoid overwriting host changes.
Changes:
- Introduces per-path file drafts (
clean/dirty/saving/conflict/error) with save/discard actions and conflict detection on preview refresh. - Adds
files.writeaction availability and wires live + fixture controllers to dispatch revision-gated writes and resolve outcomes. - Extends tests to cover local draft lifecycle, revision-stale conflicts, and save result settling.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/web/test/panes-live.test.ts | Extends live-pane tests for files.write enablement and revision-gated save/conflict behavior. |
| apps/web/test/panes-files.test.ts | Adds unit tests for draft editing, save promotion, conflict on host change, and truncated-preview edit blocking. |
| apps/web/src/features/panes/model.ts | Adds fileWrite to the action availability model. |
| apps/web/src/features/panes/live-inspector.ts | Wires files.write availability and implements revision-gated writeFile controller behavior. |
| apps/web/src/features/panes/inspector-store.ts | Adds draft state/actions and implements preview/write outcome reconciliation logic. |
| apps/web/src/features/panes/fixtures.ts | Extends fixture controller to persist edited content and resolve write outcomes as saved. |
| apps/web/src/features/panes/FilesPane.tsx | Adds editor UI (textarea) and Save/Discard controls driven by draft and fileWrite availability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd8b443941
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cd8b443 to
a8386c2
Compare
Summary
files.writecommandsVerification
pnpm checkpnpm testpackage.json, and entered editor modeScreenshots