Skip to content

feat(web): pending reviews, ranges, resolution, comment edit and delete (review-parity PR 4) - #103

Merged
PastaPastaPasta merged 7 commits into
masterfrom
feat/web-review-pending
Sep 28, 2026
Merged

PastaPastaPasta merged 7 commits into
masterfrom
feat/web-review-pending

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Review-parity PR 4 (docs/design/review-parity-spec.md §7, §4.1): GitHub-style pending reviews in the browser. It is stacked on #96 (PR 3); the diff below is only this PR's commits once #96 merges.

What changes

Pending reviews

  • Each line composer offers "Add single comment" or "Start a review" / "Add review comment". A single comment posts at once. A review comment stays local, unpublished and free, until the review is submitted.
  • The "Review changes" panel has a summary, a verdict (Comment / Approve / Request changes), the list of pending comments, and "n documents · ≈ DASH". Pending comments show in place on the diff, marked Pending, with Edit and Delete.
  • Submit writes the review and then each comment, with progress. A failure keeps what landed. Retry finishes the submit and never writes a document twice (submitReviewDraft, with reconcile).
  • The draft freezes the moment a submit begins (attemptedAt, the verdict and the trimmed summary are saved first). The page offers no edits while documents are written, and the auto-save stands down.
  • The summary and verdict are saved to the draft as you type. A summary-only draft is kept. Nothing is offered until the stored draft has loaded, so a comment added early can't overwrite it.
  • Where drafts live. A pending review is kept in this browser (IndexedDB, keyed by network, identity and PR), not on the account, because a draft on Platform would cost a write per edit. The panel, a new "You have a pending review" banner, and the composer say so plainly: other browsers and devices don't see it. It survives reloads and signing out and back in on this browser. A private repo's draft lives only in memory, for the open tab.
  • If the PR moves while a review is pending, the panel offers to re-anchor the comments whose lines still exist. Comments anchored to another head are listed separately ("pending comments on an older version") instead of on unrelated lines, and a comment added on a newer head keeps that head.

Ranges, threads, comments

  • Multi-line comments: click a line number, then shift-click another to select a range. Range threads tint their lines.
  • The PR author or a member can resolve and unresolve a thread (threadResolve / threadUnresolve events). A resolved thread collapses with a "Show" link.
  • You can edit your own comments ("edited" marker; in a private repo, a sealed edit with the revision guard from feat(web): PR page IA: tabs, reviewers card, drafts, head sync, checks (review-parity PR 3) #96) and delete them.
  • A reply whose parent was deleted says so. If the parent is a comment this reader can't open (private repo), it says that instead.
  • A review whose comments were partly deleted reads "n of m comments shown: the rest are still landing or were deleted".

Tests

  • Unit:
    • the draft model: add, edit, remove, verdict, freeze at submit, cost, the partial message, re-anchor, splitting by head, a comment keeping its own head, emptiness;
    • the resumable submit: resume after a failure, adopt writes that landed unsaved;
    • drafts across sign-out and sign-in: kept for the same identity, never shown to another identity or network;
    • orphaned replies (deleted or hidden);
    • range selection.
    • pnpm typecheck, pnpm lint and pnpm test pass: 2,046 tests.
  • Live on devnet moutai (e2e/review-pending.spec.ts, the spec's own freshly minted identities, a build of this PR's head served on a port checked to be ours): 7/7.
    • p1: pending review, a line, a 3-line range and another line; nothing is written (checked with dg).
    • p2: the draft survives a reload and a sign-out and sign-in in the same browser; the "saved in this browser only" wording shows.
    • p3: the summary and verdict survive a reload; a submit cut off after 2 documents resumes with Retry; nothing is written twice (dg pr view --comments: 1 review, 3 comments, the right locations).
    • p4: the author replies and resolves; dg agrees.
    • p5: edit (edited) and delete.
    • p6: a review made with dg shows in the web.
    • p7: a single comment posts at once; axe clean on the Files tab.
  • Evidence: evidence/impl/web-review-parity/pr4-live/.

Notes

  • The e2e unlock() helper now clicks Sign in again if its first click landed before hydration. That race intermittently timed out live specs.
  • Suggestions (PR 5) and the merge box (PR 6) follow once the browse-cache invalidation (G4) lands: a browser commit to the PR branch needs the cached reader to see the new pack.

🤖 Generated with Claude Code

PastaPastaPasta and others added 6 commits September 27, 2026 19:19
… delete comments (review-parity PR 4)

Review changes drawer with summary, verdict, pending list and document count and cost; single comment vs start a review on every line composer; shift-click ranges, tinted; pending comments shown in place; a submit that resumes after a failure and writes nothing twice (submitReviewDraft); re-anchoring after the head moved; resolve and unresolve (members and the PR author) with collapsed resolved threads; edit and delete own comments.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tored draft, list stranded comments apart

The summary and verdict are saved to the draft as they change, and a summary-only draft is kept. Nothing is offered until the stored draft has loaded, and edits read the latest draft. Pending comments on another head are listed above the diff, not on unrelated lines. A reply to a deleted comment says so, and a review's gap reads 'still landing or deleted'. The thread actions and changed paths are memoised so the diff stops re-rendering with the page.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…it across sign-out

A pending review is kept in this browser (IndexedDB, keyed by network, identity and PR), not on the account: the review panel, a new pending-review banner and the composer now say so, and that other browsers and devices do not see it. A unit test shows a lock and sign-out leave the draft for the same identity only; the live spec's p2 and p3 reload the reviewer's own context and sign out and in again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n-in prompt that never opens

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a comment's own head

The submit writes the draft with attemptedAt, the verdict and the trimmed summary before anything else, so the page offers no edits and the auto-save (which also stands down while a submit runs) never re-saves an editable draft over it. A comment added on a head other than the draft's keeps that head. The drawer resets its summary and verdict whenever the draft or identity changes. A reply to a comment this reader cannot open (private repo) no longer says the parent was deleted. The e2e unlock helper clicks Sign in again when the first click lands before hydration.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
One frozen flag for the auto-save and the panel; the submit freezes the draft in one branch without a non-null assertion; the reset effect clears the summary and verdict when the draft goes, so submit and Discard no longer do it by hand.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f1b0c55b-13b5-4577-9946-ff656a7b8beb

📥 Commits

Reviewing files that changed from the base of the PR and between 4acf675 and b496f38.

📒 Files selected for processing (15)
  • forge-web/components/repo/diff-view.tsx
  • forge-web/components/repo/inline-comments.tsx
  • forge-web/components/repo/pull-content.tsx
  • forge-web/components/repo/review-drawer.tsx
  • forge-web/components/repo/timeline.tsx
  • forge-web/e2e/helpers.ts
  • forge-web/e2e/review-pending.spec.ts
  • forge-web/lib/repo/index.ts
  • forge-web/lib/repo/pulls.test.ts
  • forge-web/lib/repo/review-writes.test.ts
  • forge-web/lib/repo/review-writes.ts
  • forge-web/lib/view/inline-threads.ts
  • forge-web/lib/view/issues-view.ts
  • forge-web/lib/view/pending-review.test.ts
  • forge-web/lib/view/pending-review.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PastaPastaPasta
PastaPastaPasta changed the base branch from feat/web-review-ia to master September 28, 2026 00:26
…lands before hydration

Seen live on forge.dashhq.org: the first click opened nothing, and the import waited for a tile that never showed. unlock and importIdentity share openSignIn.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

@coderabbitai review


🤖 Posted autonomously by Claude on behalf of pasta.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@PastaPastaPasta
PastaPastaPasta merged commit a84a956 into master Sep 28, 2026
6 checks passed
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