Skip to content

fix(desktop): keep Review draft comments per source and across leaving - #4418

Merged
LHagfoss merged 3 commits into
mainfrom
fix/desktop-review-drafts
Nov 25, 2026
Merged

LHagfoss merged 3 commits into
mainfrom
fix/desktop-review-drafts

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Review's line comments and review note move out of component state into a small persisted store (state/reviewDrafts.ts), keyed by thread and source (uncommitted, branch, turn:N, pull:N).

  • Leaving Review (Open thread, another view) or reloading the app keeps the drafts.
  • Drafts written on one source are shown, sent and posted only from that source, so a turn's comments no longer go to a pull request under its line numbers. A source with drafts shows their count on its segment (Uncommitted · 1) or in the Turn menu.
  • Discard clears comments and note together and offers Undo in a toast.

Changelog

Review keeps your draft comments when you leave the screen or reload, and never sends one source's comments as another's.

Testing

  • bun run check (new state/reviewDrafts.test.ts: per-source keying, empty drafts forgotten, storage round trip and malformed data, cap).
  • Mock, dark theme: drafted a comment on mock-thread-1, left Review and came back. The draft and "Uncommitted · 1" are still there. Discard removed it, and Undo restored it.

Closes #4392

@github-actions github-actions Bot added the fix A bug fix label Nov 25, 2026
@LHagfoss
LHagfoss merged commit 8c98ce1 into main Nov 25, 2026
10 checks passed
@LHagfoss
LHagfoss deleted the fix/desktop-review-drafts branch November 25, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(desktop): keep Review draft comments per source and across leaving

2 participants