Expanding a pull request diff exposes context outside the host's hunks. Comments anchored there can cause GitHub to reject the entire submitted review. The resolver now refuses those context positions using the same hunk-membership check already used to place review threads. Explicit selections also retain their side and coordinate, preventing the original partial patch from falling back to a same-numbered line on the opposite side. Valid context, added, and deleted anchors retain their coordinates.
Continued @agomesp's #12583, preserved the author's commits, and merged main. The merge conflict only concerned a redundant function comment removed on main. Part of #12549.
Verification on headless Linux:
vp test run apps/web/src/reviewCommentContext.test.ts: 5 before takeover → 5 after, all pass. The single hydrated-patch regression now covers gaps before/between/after hunks on both sides, shifted context mapping, and valid added/deleted lines.
- Removing the guard produces 1 failure / 4 passes; restoring it produces 5 passes.
- The partial-patch fallback regression also fails before the explicit-side fix. Three focused suites (
reviewCommentContext, pullRequestDiff.logic, and diffRendering) pass: 42 tests total.
- Web typecheck and targeted lint/format pass.
- This uses the actual diff hydration/resolution path. Live review submission is unverified. Chromium was initially missing and was installed later; the isolated app starts, but its PR lookup reports that it cannot reach GitHub. This specific flow has not been driven with host PR data, and there are no current browser captures.
The restriction applies across hosts, consistent with existing thread placement. Existing saved drafts outside hunks are not migrated and must be moved or removed. The gutter may remain visible on expanded rows even when no valid anchor can be created.
Not merge-ready until the client flow and host submission are verified.
Not verified: live GitHub/GitLab review submission, macOS, Windows, iOS, Android, Electron desktop. Web and desktop share this resolver; the native mobile diff viewer is separate. No server, contract, provider adapter, or connection-mode change.
Tests: GPT-6-Astra. Implementation: GPT-6.1-Sol. Adversarial review: Claude Opus 5.5 and GPT-6-Sol. Harness: Codex/T3 Code.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
a0144b2b-2875-49ac-9a06-18eb39ea446d📥 Commits
Reviewing files that changed from the base of the PR and between dfbb11bdd7c3f1a5575cb55d3e3abb12be025727 and b64c6fee29697a161f3b3be3d6e71dfa72f6a618.
📒 Files selected for processing (2)
apps/web/src/reviewCommentContext.test.tsapps/web/src/reviewCommentContext.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
The resolver now returns no review position for context lines outside the file diff. Tests cover separated diff hunks, out-of-hunk selections, and in-hunk position resolution.
Changes: Diff Position Validation
apps/web/src/reviewCommentContext.tsresolveDiffReviewPositionchecks whether the selected new-side line is inside the file diff and documents when it returnsnull.apps/web/src/reviewCommentContext.test.tsPriority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
chrisdeemingPre-merge checks:
4 · 
1
Full details: Description check
Explanation
The description explains the problem, implementation, scope, verification results, and known limitations. It includes issue and pull request references and detailed focused test results. The required headings are not used, and explicit maintainer approval evidence is not provided, but the content is mostly complete for this focused fix.
✨ Finishing Touches
🧪 Generate unit tests (beta)