Open
Conversation
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 optional editor autosave with a configurable delay, plus safer save/discard behavior so pending autosaves do not overwrite discarded or deleted changes.
Screenshots
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildAI Review Report
pending saves before proceeding.
lib/path.test.ts
Cross-platform confirmation
Yes — the review explicitly checked cross-platform compatibility for macOS, Linux, and Windows, including:
platform misuse in the changed code
Net: the PR looks solid on persistence, path handling, and save/discard coordination.
Security Audit
Basic security review for this PR focused on the new autosave path, settings persistence, and discard/delete
coordination.
Input handling: reviewed the new editorAutoSave and editorAutoSaveDelayMs settings. The delay is clamped in the
settings UI and normalized again at the autosave write site, so missing, hand-edited, NaN, or out-of-range values
fall back to a safe bounded delay instead of becoming immediate-save behavior.
Command execution: no new shell, subprocess, or arbitrary command execution was introduced. The PR only uses existing
renderer-to-main IPC for file writes, deletes, git discard, and settings persistence.
Path handling: reviewed file mutation paths for autosave, discard, and delete flows. The new matching logic uses
existing absolute filePath values plus joinPath/worktree-relative matching rather than hardcoded separators, so no
new macOS/Linux/Windows path portability risk was introduced in this change.
IPC surface: no new privileged IPC endpoints were added. The PR reuses existing window.api.settings,
window.api.fs.writeFile, window.api.fs.deletePath, and window.api.git.discard flows. The main risk reviewed here was
write ordering: pending autosaves could previously land after discard/delete. The new quiesce flow addresses that
race before destructive mutations proceed.
Auth/secrets: no auth, token, credential, or secret-handling code was added or modified.
Dependencies: no new dependencies were added as part of this PR. There is an unrelated local package.json
modification in the worktree, but it was not part of the autosave feature/security review.
Fixes Enable auto-saving for file editing #216