feat: autosave diff comments#820
Conversation
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0685c42a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return; | ||
| } | ||
|
|
||
| void autosave.flush().finally(() => { |
There was a problem hiding this comment.
Flush pending comments before unmounting editors
When a host changes the displayed diff without calling the new imperative flush API, this onDestroy autosave runs after the editor is already being torn down and its onSave callback in DiffViewer derives the path/span from current component state rather than the original editor context. I checked apps/differ/src/App.svelte::selectFile, which still sets selectedFile immediately and does not bind/call flushCommentEditors; typing a new comment there and immediately selecting another file before the debounce fires can drop the draft (or save against the wrong current file) instead of autosaving it. Capture the editor's original path/span for the save callback or flush from all file-switch paths before changing the diff.
Useful? React with 👍 / 👎.
Signed-off-by: Matt Toohey <contact@matttoohey.com>
Summary: