Repository navigation
fix(review): recover local Git drafts after diff changes - #1645
Merged
backnotprop merged 8 commits intoOct 28, 2026
Merged
Conversation
adoptDraftTarget(undefined) (a failed or superseded local switch) opened autosave before the page-load draft read settled, so a save could land on top of a draft the recovery banner had not offered yet. Only an applied switch, which supersedes that read, needs to open autosave.
Contributor
Author
|
Hey @backnotprop thanks for jumping on my PRs :) I dont mean to put pressure but i am slowly fixing thigns that affect me! I think this is the last gap that is relevant for my workflow! But happy to put my tokens to good use if you have other ideas. |
Preserve local draft identity alongside upstream host control and stale-tab guards. Resolve draft identity before publishing snapshots so synchronous host status and close retain accurate draft counts.
…pdate the drafts guide The local draft target is resolved before the review server listens. Run its three git calls in one parallel round and kill each after 2s; a slow or hung repo falls back to patch-only drafts, as before. Move the PR's AGENTS.md notes into docs/agent-guides/code-review.md.
…cover from a switch onto no target - A diff switch reports draftState without the legacy unscoped fallback, so an old draft is only ever offered by the page-load restore banner. - An applied switch onto no target (git identity unreadable) resumes saving and clears the paused notice; a decision there still clears the targets the page saved earlier. - Resolve the switch's draft target alongside the other switch adverts.
After a switch onto no draft target the page still owns the targets it saved, so Send and Close must name it for the server to clear them.
1 task
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.
Closes #1590.
Extends the existing PR draft recovery to local Git reviews. Unsubmitted comments remain discoverable after edits, commits, refreshes, and restarts. Matching line text/context stays inline at the same coordinates; changed or missing anchors remain in the sidebar as Outdated.
Draft identity is the canonical worktree root, branch (commit when detached), and comparison/applicable base. Both patch and target keys are scoped, so identical patches on different branches or worktrees cannot share comments or tombstones. Existing unscoped drafts remain readable on an exact patch and migrate on save; their original review identity cannot be recovered retroactively.
Review focus:
localGitDraftTargetKeyreuses viewed-progress identity independently of that feature's setting. Automatic startup base upgrades normalize against the locally discovered tracking ref; explicitly selected bases stay distinct.