Repository navigation
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0184829. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This XL PR substantially rewires the production mobile diff-rendering pipeline across JavaScript, iOS, and Android, including asynchronous patch ordering, caching, resets, and native release compatibility. An unresolved Medium-severity finding also identifies a concrete path to stale word-diff highlights. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
| function buildCommentRowsResetKey(rows: ReadonlyArray<NativeReviewDiffRow>): string { | ||
| let hash = 5381; | ||
| for (const row of rows) { | ||
| const text = `${row.id}\n${row.content ?? ""}\n`; |
There was a problem hiding this comment.
🟡 Medium review/useNativeReviewCommentWordDiffs.ts:18
buildCommentRowsResetKey returns the same key when rows retain their IDs and text but change kind or change, so a delete/add pair becoming context rows keeps the old native word-diff highlights. computeVisibleNativeReviewWordDiffRanges then returns pairCount === 0, and line 49 leaves the stale patch intact because no reset is triggered. Include kind and change in the reset-key input so native ranges are cleared when pairing semantics change.
| const text = `${row.id}\n${row.content ?? ""}\n`; | |
| const text = `${row.id} | |
| ${row.kind} | |
| ${row.change} | |
| ${row.content ?? ""} | |
| `; |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/src/features/review/useNativeReviewCommentWordDiffs.ts around line 18:
`buildCommentRowsResetKey` returns the same key when rows retain their IDs and text but change `kind` or `change`, so a delete/add pair becoming context rows keeps the old native word-diff highlights. `computeVisibleNativeReviewWordDiffRanges` then returns `pairCount === 0`, and line 49 leaves the stale patch intact because no reset is triggered. Include `kind` and `change` in the reset-key input so native ranges are cleared when pairing semantics change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe PR moves native word-diff computation to visible-range processing. React hooks send row-keyed patches to Android and iOS views, which cache and render the ranges. Visible-range reporting and tests are updated. ChangesNative word-diff highlighting
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Refactor Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ReviewSheet
participant useNativeReviewDiffHighlighting
participant computeVisibleNativeReviewWordDiffRanges
participant NativeReviewDiffView
participant ReviewDiffContentView
ReviewSheet->>useNativeReviewDiffHighlighting: provide visible range and collapsed files
useNativeReviewDiffHighlighting->>computeVisibleNativeReviewWordDiffRanges: compute visible row ranges
computeVisibleNativeReviewWordDiffRanges-->>useNativeReviewDiffHighlighting: return row-keyed ranges
useNativeReviewDiffHighlighting->>NativeReviewDiffView: send wordDiffRangesPatchJson
NativeReviewDiffView->>ReviewDiffContentView: merge word-diff ranges
ReviewDiffContentView-->>NativeReviewDiffView: render cached ranges
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 11.36% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 44 functions across 13 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
…cards Scroll distance was measured against the previous viewport event, so a one-row-at-a-time Android drag never crossed the 20 row threshold and stopped requesting word ranges past the initial overscan. Measure it against the last requested range instead. Review comment cards in the thread feed still sent only rows, so they lost word highlights once the adapter stopped embedding ranges. Compute their ranges with the same deferred path and deliver them as a keyed patch.
0c9015e to
55afb76
Compare

Native release hold
Hold this PR for a compatible native release. It changes the iOS and Android review module.
Mobile prepared word highlights for every changed line before showing a large diff. Prepare source rows first, then compute word ranges for visible replacement pairs. Indexing, skipped rows, and word matching yield during long requests. Keep word work independent of syntax highlighting and send ranges through the existing native setter. Android reports source row indexes after file collapse.
Mark rows complete only after their patch is sent to native. Measure scroll distance from the last requested range so slow scrolls keep requesting ranges, and deliver comment-card word ranges through the same patch path. Retain the last visible range when highlights reset in the same thread and section.
Validation:
Measurements used Node 24.20.0. The original fixture used two warmups and six samples. The larger scan checks used one sample each. They exclude native decode and drawing. No local native build, browser, or device testing. Native release and device verification remain required. Existing line-length and coverage rules stay intact.
Refs #9661.
Created with GPT-6 Astra (preview) in Codex.
Note
Medium Risk
Touches iOS/Android review rendering and async patch ordering; incorrect stale-patch handling could show wrong or missing word highlights, but no auth or data-path changes.
Overview
Defers word-level diff highlighting so large reviews no longer compute every deletion/addition pair up front. Row preparation drops embedded
wordDiffRanges; a newcomputeVisibleNativeReviewWordDiffRangespath indexes pairs once (with yield/cancel budgets), matches only the visible window (plus overscan), respects collapsed files, and caches completed pairs.Streams ranges to native separately from syntax tokens.
useNativeReviewDiffHighlightingruns word work in its own effect, sendswordDiffRangesByRowIdthrough the existing token patch bridge (wordDiffRangesPatchJson/setTokensPatchJson), and marks rows complete only after native dispatch viaonWordDiffRangesPatchSent. Highlight resets clear native word state but keep the last scroll range within the same thread/section (contentResetKeyvstokensResetKey).iOS and Android review modules merge patched ranges into drawing state, fall back to row JSON ranges, and report source row indexes in visible-range debug events so JS range requests stay aligned when files are collapsed. Tests add
react-test-renderercoverage for delayed patches and scroll/reset behavior.Reviewed by Cursor Bugbot for commit 166f5fa. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Compute word diffs asynchronously for visible rows only in mobile review diff
setTokensPatchJsonbridge command, with a delivery acknowledgement callback that excludes already-delivered row IDs from future requestssourceIndexto parsedDiffRowmodels so visible-range debug events report original payload row indexes rather than laid-out indexesprepareFileRowsin nativeReviewDiffAdapter.ts no longer mutates rows with computed word ranges; any out-of-tree caller relying onDiffRowcontaining pre-computed word ranges at construction time will not find them📊 Macroscope summarized 0c9015e. 11 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues
Summary by CodeRabbit
New Features
Bug Fixes