Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
External image Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: f313d0a
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a97e808c-5bf0-4072-b12c-257d8d6e2108
External image Commits
-
Reviewing files that changed from the base of the PR and between d8296d3ccdfeab5b74202a3ea4a73c629bf710d6 and 15d50b79c42b399a9fe08a471ec7efbf60b456e6.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- Trigger review
Walkthrough
-
Android word-diff highlight bounds now use measured text widths across token runs and the active style. The row drawing path passes the same tokens and style to code and highlight drawing. A geometry test checks alignment for different fonts and prefix types.
Changes: Android word-diff highlight alignment
Layer / File(s) Summary Measure highlight bounds using code styling
apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/ReviewDiffCanvasDrawing.ktCode-row width measurement now measures requested character intervals across token runs with their font styles. Word-diff bounds use measured widths for the text before and within each range on each visual line. Pass row styling and test alignment
apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt,apps/mobile/modules/t3-review-diff/tests/android/src/test/kotlin/expo/modules/t3reviewdiff/ReviewDiffGeometryTest.ktdrawLineRowpasses the row’s tokens and style to code and word-diff drawing. The geometry test checks highlight bounds against drawn text for two font styles and ASCII, CJK, and emoji prefixes.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge,jakeleventhal
Merge Risk: External image Minimal · previous review 43642
-
Android word-diff highlights now follow the measured text widths used to draw the code, which fixes the reported misplacement. Any residual difference from kerning or ligatures is expected to be sub-pixel. No actionable merge-blocking risk remains.
Pre-merge checks: Passed 4
-
Check name Status Explanation Title check Passed The title "fix(mobile): Android diff word highlights sit on the changed characters" matches the main change. The diff makes Android word-diff highlight boxes measure with the same runs, fonts, and lin… Linked Issues check Passed Issue #27146requires Android word-diff highlights to sit over the changed characters when the monospace family is proportional. The reviewed diff showsdrawWordDiffRangesno longer uses `textPaint.…Out of Scope Changes check Passed The reviewed diff touches two source files and one regression test. ReviewDiffCanvasDrawing.ktchanges width measurement for word-diff highlights andmeasureRowWidth, which both serve the#27146p…Description check Passed The description is thorough and covers the required template sections. Problem: it explains that Android word-highlight boxes are placed using character count times the width of "M", while code is dra… Full details: Title check
-
Explanation
The title "fix(mobile): Android diff word highlights sit on the changed characters" matches the main change. The diff makes Android word-diff highlight boxes measure with the same runs, fonts, and line starts that drawCode uses, so they cover the changed text. It follows the conventional commit format and names the platform and the affected feature.
Full details: Linked Issues check
-
Explanation
Issue
#27146requires Android word-diff highlights to sit over the changed characters when the monospace family is proportional. The reviewed diff showsdrawWordDiffRangesno longer usestextPaint.measureText("M")times character count. It now calls the newcodeWidthhelper for the prefix before the range and for the range itself.codeWidthwalks the same token runs asdrawCode, configures the same code paint per run, and measures sub-spans withmeasureText(run.content, start, end).T3ReviewDiffView.drawLineRownow passes the sametokensandstyleto both highlight and code drawing, so highlight placement uses the same inputs as the drawn text.measureRowWidthalso usescodeWidth. The change is limited to visible added or deleted rows with word ranges, and wrapped rows return early through the existingnativeLayoutcheck. The regression testReviewDiffGeometryTest.unwrappedWordDiffHighlightsCoverTheTextDrawCodeDrawscovers the reported case. The author reports it fails on main and passes on this branch. I did not run the tests. This assessment relies on the diff and the reported results.
Full details: Out of Scope Changes check
-
Explanation
The reviewed diff touches two source files and one regression test.
ReviewDiffCanvasDrawing.ktchanges width measurement for word-diff highlights andmeasureRowWidth, which both serve the#27146placement bug.T3ReviewDiffView.ktonly reorders the row token lookup and passes the existing tokens and style todrawWordDiffRanges, which the fix requires. The test file adds the regression check for the same behavior. No unrelated behavior change appears in the reviewed hunks. ThecodeWidthrefactor shares code between highlight placement and row width measurement, so it is part of the same fix.
Full details: Description check
-
Explanation
The description is thorough and covers the required template sections. Problem: it explains that Android word-highlight boxes are placed using character count times the width of "M", while code is drawn with measured run widths, so they drift with CJK or emoji text and with a proportional monospace font. Change: drawWordDiffRanges now measures with the same runs, fonts, and line starts as drawCode through a shared codeWidth helper, and the caller passes tokens and style. Scope: it is a bug fix linked to issue
#27146, with a note on why no separate issue is needed beyond that link. Verification: it gives the focused Gradle test command, the failing and passing output, full module test runs, and before/after device screenshots for Android and iOS. It also lists what was not checked, namely iOS on the branch's older base. The template asks for the model and harness used; the description says it was generated with Claude Opus 5.5 in T3 Code Nightly, so that is covered. The description is long and includes many details in a collapsible section, but the required information is present.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts