Skip to content

[codex] Port review diff surface to Android#7

Draft
HorusGoul wants to merge 4 commits into
horus/androidfrom
codex/android-review-diff-surface
Draft

[codex] Port review diff surface to Android#7
HorusGoul wants to merge 4 commits into
horus/androidfrom
codex/android-review-diff-surface

Conversation

@HorusGoul

@HorusGoul HorusGoul commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #4.

Adds an Android implementation of T3ReviewDiffSurface for the mobile review diff native module. The Android view decodes the same row/theme/style/token JSON contract as iOS, renders file headers, hunks, code lines, notices, and comments on a custom canvas, supports token patches/reset keys, collapsed/viewed/selected state, initial row scroll, and emits visible-range/draw debug events for incremental highlighting.

Also registers the module for Expo Android autolinking and makes ReviewSheet tolerate missing native view registration with a raw diff fallback instead of force-unwrapping the native surface.

Local Benchmark

Ran a temporary Vite+ benchmark against the shared review diff pipeline that feeds both native implementations. This is not a device render benchmark; it measures parse, adapter, bridge serialization, and JavaScript highlighter costs in Node.

Dataset sizes:

  • small: 5 files, 490 native rows, 25.0 KiB diff, 142.4 KiB rows JSON
  • medium: 20 files, 4,840 native rows, 254.5 KiB diff, 1,453.6 KiB rows JSON
  • large: 40 files, 19,280 native rows, 1,029.4 KiB diff, 5,847.9 KiB rows JSON

Observed p50 timings:

  • small parse/build/stringify: 0.27 ms / 0.56 ms / 0.16 ms
  • medium parse/build/stringify: 2.48 ms / 6.13 ms / 1.48 ms
  • large parse/build/stringify: 9.20 ms / 26.15 ms / 6.39 ms
  • medium visible highlight for 360 rows: 20.13 ms p50
  • medium full token stream: 529.10 ms p50, intentionally chunked/background work

Takeaway: diff parsing and bridge serialization are not the bottleneck on this synthetic workload. Syntax highlighting dominates; keeping it visible-range driven is important for large diffs. Native iOS-vs-Android draw timing still needs an on-device harness using the emitted draw-metrics / visible-range events.

Validation

  • vp check passes with existing lint warnings
  • vp run typecheck
  • vp run lint:mobile passes; local ktlint and detekt are not installed, so the script skipped those checks as designed
  • vp test
  • vp run --filter @t3tools/mobile typecheck
  • vp run --filter @t3tools/mobile test -- --run nativeReviewDiffSurface.test.ts

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Jun 28, 2026
@HorusGoul HorusGoul added the android:apk-preview Build and publish a self-contained Android preview APK for this PR. label Jun 28, 2026
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

Android APK preview

A self-contained Android preview APK was built for this PR.

  • Artifact: t3code-preview-release-pr-7
  • Size: 80.8 MiB
  • SHA-256: ae3d135eea2f2313508d8176c3a2e301e6a462f2fdcac32341339789ce854899
  • Source: d32d9098e94d
  • Note: GitHub Actions downloads artifacts as zip archives.

Re-add the android:apk-preview label to build a fresh APK.

@github-actions github-actions Bot removed the android:apk-preview Build and publish a self-contained Android preview APK for this PR. label Jun 28, 2026
…d-review-diff-surface

# Conflicts:
#	.github/workflows/mobile-android-apk-preview.yml
@HorusGoul HorusGoul added the android:apk-preview Build and publish a self-contained Android preview APK for this PR. label Jun 28, 2026
@github-actions github-actions Bot removed the android:apk-preview Build and publish a self-contained Android preview APK for this PR. label Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant