Skip to content

fix(web): an unfinished PR inline comment survives a refresh that changes the diff - #21

Closed
AndreiShenets wants to merge 65 commits into
mainfrom
fix/pr-inline-draft-refresh
Closed

AndreiShenets wants to merge 65 commits into
mainfrom
fix/pr-inline-draft-refresh

Conversation

@AndreiShenets

Copy link
Copy Markdown
Owner

ℹ️ Written by Claude Opus 5.5 on behalf of AndreiShenets

Fixes pingdotgg#42199

Problem

While an agent works on a PR, a background refresh that changes the patch wipes the inline comment the reviewer is still typing (before Add to review). The draft was anchored to the file's render key, which includes a hash of the whole patch, so any change re-keyed every file: the comment box unmounted with its text, and the orphaned draft kept line selection disabled.

Fix

  • The draft finds its file by identity (path, previous path, change type) and that file's content version, and uses the file's current render key.
  • Typed text is kept by the tab, so a comment box remounted by the refresh comes back with it. Keystrokes stay local to the box.
  • If the commented file itself changed, or is gone once the diff is fully loaded, the draft is dropped instead of being attached to different lines.

Verification

  • New browser test keeps an unfinished inline comment when a background refresh changes another file: fails before the fix (comment box gone), passes after.
  • vp test run src/components/pullRequest src/components/diffs: 321 passed. React Compiler coverage, apps/web typecheck, lint and format are clean on the changed files.

Reviewed with sol-loop: 2 rounds with gpt-6.2-sol on medium. Sol verdict: approved

Written by Claude Opus 5.5 in OpenCode, in T3 Code.

juliusmarminge and others added 30 commits November 23, 2026 23:57
… the broadest mode (pingdotgg#41977)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…hment, not a file path (pingdotgg#41970)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…t read (pingdotgg#41981)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…restart (pingdotgg#37875)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…#42000)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
… moved (pingdotgg#42016)

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…on link is not a local file (pingdotgg#42023)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#42027)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…security fix (pingdotgg#42043)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#42046)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…#42037)

Co-authored-by: hanmin6 <226948540+hanmin6@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…pingdotgg#42011)

Co-authored-by: pepsi <pepsi@Pepsi-Work.local>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…t passes 128 KB (pingdotgg#42040)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ne breaks are on (pingdotgg#42055)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…heir name (pingdotgg#42062)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…2049)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ad of a blank pane (pingdotgg#42048)

Co-authored-by: Karsten Nilsen <8917480+karstennilsen@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ings (pingdotgg#42076)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…p's icon in Firefox (pingdotgg#41949)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…name limit (pingdotgg#42083)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tgg#42082)

Co-authored-by: geezoria <25051260+geezoria@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
zs-andy and others added 20 commits November 24, 2026 05:09
…gg#42120)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…fter it opens (pingdotgg#42135)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…oji crosses the name limit (pingdotgg#42133)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…cess table every second (pingdotgg#32354)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…back, and MCP app context (pingdotgg#42114)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ovider (pingdotgg#42158)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#42165)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…er it (pingdotgg#42162)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#38317)

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
…how in Servers (pingdotgg#42151)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 24, 2026
@AndreiShenets
AndreiShenets force-pushed the fix/pr-inline-draft-refresh branch from 6ffe5dd to e1531b9 Compare November 24, 2026 14:46
@github-actions github-actions Bot added size:XXL and removed size:M labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown

This PR changes the test suite by +54 test cases (browser +15, unit +9, server +30).

New browser test files: apps/web/src/components/diffs/DiffCommentAnnotation.browser.test.tsx, apps/web/src/components/files/PreviewImageContent.browser.test.tsx, apps/web/src/components/settings/TextGeneratorsSettings.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: PR refresh discards unfinished inline comments