Skip to content

feat: autosave diff comments#820

Merged
matt2e merged 10 commits into
mainfrom
auto-save-code-comments
Jun 25, 2026
Merged

feat: autosave diff comments#820
matt2e merged 10 commits into
mainfrom
auto-save-code-comments

Conversation

@matt2e

@matt2e matt2e commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Add autosave support for new and existing diff comments.
  • Preserve comment persistence failures and harden dismissal/navigation races.
  • Add focused autosave and review state coverage.

matt2e added 9 commits June 23, 2026 13:32
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>
@matt2e matt2e requested review from baxen and wesbillman as code owners June 25, 2026 08:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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(() => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
@matt2e matt2e merged commit 5d2717e into main Jun 25, 2026
5 checks passed
@matt2e matt2e deleted the auto-save-code-comments branch June 25, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant