Conversation
Uses the @pierre/diffs 1.4 edit-session API. Edit file from the file actions menu starts a session (local diffs only); Save writes the new file contents back to the worktree via PUT /api/worktree-file, Cancel reverts. Diff reloads are deferred while a session is active, and the n/p/m shortcuts are suppressed so they don't steal editor keystrokes. Local-mode hydration now reads the new side from the worktree, since the index-line oid of a worktree diff is generally not in the object database.
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.
Summary
Adds an inline edit experience for local (working-tree) diffs, built on the
@pierre/diffs1.4 edit-session API:PUT /api/worktree-fileendpoint, Cancel rejects and restores the original diffImplementation notes
git::write_worktree_filemirrorsread_worktree_file's path validation (safe relative path, canonicalized under the repo root) and only overwrites existing files; contents capped at the blob hydration limitEditProvider+CodeView.onItemEditCompletewire up the 1.4 session lifecycle; edit toggles bump the itemversionsinceupdateItemignores same-version recordsloadDiffFilesnow reads the new side from the worktree: theindex-line oid of a worktree diff is computed on the fly and generally absent from the object database (blob hydration 404'd)n/p/mshortcuts are suppressed during an edit — the editor's input lives in shadow DOM, so the document-level handler would otherwise steal those keystrokes (this dropped every "n" typed in early testing)Test plan
pnpm test(oxlint + tsc/vite + cargo test) passes; new Rust test coverswrite_worktree_file(overwrite, no-create, traversal rejection)