Skip to content
Source
Sign inSign up
pingdotgg/t3code

[codex] Add Android mobile support #3579

Mergedjuliusmarmingemerged 48 commits intomain fromrefs/pull/3579/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Summary

  • add Android implementations for the native composer, header controls, and review diff modules
  • introduce Android-specific navigation, headers, file browsing, composer controls, icons, and connection/settings layouts while preserving the iOS toolbar paths
  • make the native Android diff gutter fixed during horizontal scrolling, keep file headers sticky, and show line-range selection feedback
  • move review section controls into an Android header menu and rebuild review comments as a full-screen, keyboard-sticky flow
  • add Android markdown code highlighting, local build configuration, and mobile development documentation

Why

The mobile app inherited iOS-only native modules and navigation assumptions. Android could build only after filling those native module gaps, and several shared screens rendered with incorrect insets, missing icons, inaccessible controls, or desktop/iOS-oriented interaction patterns.

The review diff also scrolled its entire native canvas horizontally, which moved line gutters and file headers with the code. It now owns horizontal code offset internally so persistent chrome stays fixed.

Impact

Android now has a usable end-to-end thread, file, Git review, composer, and connection flow. The iOS implementation keeps using its existing native toolbar and form-sheet behavior through platform-specific branches.

Validation

  • vp check
  • vp run typecheck
  • vp run lint:mobile
  • ./gradlew :t3tools-mobile-review-diff-native:compileDebugKotlin
  • ./gradlew :app:assembleDebug
  • manually exercised light and dark mode on the visible Android emulator
  • installed and launched the debug build on a USB-connected Pixel 7a

Note

Add Android support to the mobile app

  • Adds a native Android terminal renderer via JNI using libghostty-vt with a custom canvas view (TerminalCanvasView.kt) for font metrics, styling, and cursor blinking
  • Introduces AppSymbol.tsx to map SF Symbols and Material icons to Tabler icons on Android, replacing direct expo-symbols usage across the codebase
  • Replaces native stack headers with in-content AndroidScreenHeader on all major screens (home, thread, settings, files, review, connections, new task)
  • Adds AndroidAnchoredMenu for context menus rendered via OverlayPortal to avoid keyboard focus loss, and wires ControlPillMenu to use it on Android
  • Adds Android-specific build infrastructure: Gradle configs for native modules, CMake setup for the terminal JNI library, and Expo config plugins for heap sizing, modern alert/popup dialogs, and predictive back gesture compat
  • Implements Android launcher shortcuts via useAppShortcuts.ts that persist and sync recent threads to launcher quick actions
  • Adds a native Android composer editor module (T3ComposerEditorView.kt) with structured event dispatch, token spans, and selection management
  • Risk: The terminal backend now uses JNI with prebuilt .so libraries for four ABIs; any ABI mismatch or library loading failure will crash the terminal view

Changes since #3579 opened

  • Implemented native text selection system for Android terminal [80cf687]
  • Implemented terminal session lifecycle management with auto-close, respawn, and fallback navigation [80cf687]
  • Integrated bundled MesloLGS NF fonts for Android terminal rendering [80cf687]
  • Added Android-specific in-flow header with terminal menu and actions [80cf687]
  • Changed composer expansion behavior on Android to focus-based model [80cf687]
  • Added inertial fling scrolling to terminal canvas [80cf687]
  • Changed Enter key behavior to send carriage return instead of line feed [80cf687]
📊 Macroscope summarized 80cf687. 10 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.


Note

High Risk Large new native/Android surface (review diff, composer, terminal JNI and prebuilt libs) plus iOS entitlement gating; regressions or load failures would hit core editing, review, and terminal flows.

Overview Adds Android Expo modules for the composer editor, header buttons, and review diff so JS can use the same view contracts as iOS, including a custom canvas diff surface with fixed gutters, sticky file headers, async JSON decoding, and scroll/tap events.

Build and platform config: app.config.ts gains an opt-in iOS Personal Team mode (T3CODE_IOS_PERSONAL_TEAM + bundle ID validation) that drops widgets, push, app groups, and native Sign in with Apple; Clerk’s appleSignIn plugin flag follows that mode. Android picks up predictive back, expo-quick-actions, expo-asset, and several Gradle/UI config plugins. Docs add Personal Team and ios:release (Metro-free Release) flows; Metro blocks the repo .t3 directory from the bundle.

Terminal: Android is documented and vendored with pinned libghostty-vt (headers/libs) for VT parsing/rendering, separate from the existing iOS GhosttyKit fork.

Minor UI tweak: lighter translucent card tokens in global.css.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 80cf68740598b1a1a6a92cb7041427c1eaec7e81. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 5bdae982-b2e5-48c1-b3e9-a997ea8c830a

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `android-dev-pr-3514`

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/927d43bfe5b1a7e8138d973d92ae115494e36147/apps/mobile/src/features/threads/ThreadFeed.tsx#L1254

      In split layout, viewportWidth starts at 0 and is only corrected after onLayout fires. This makes userBubbleMaxWidth and reviewCommentBubbleWidth start at 0, and since those values are passed only through the renderItem closure — not included in extraData (listAppearanceData) — LegendList does not repaint the already-visible rows when the widths are corrected. The initial rows stay rendered with width 0, collapsing user bubbles and review comments until some unrelated list update triggers a repaint. Consider adding userBubbleMaxWidth and reviewCommentBubbleWidth to listAppearanceData so visible rows re-render when the viewport width is resolved.

      ✅ Resolved in 10533388f19f4142fcbe027014a711bb538200fb

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium components/AppSymbol.tsx:125

      On Android, when props.name is a platform map (e.g. { ios: "...", android: "..." }), SymbolView reads props.name.ios instead of props.name.android. It then looks up the iOS SF Symbol name in the Android icon mapping, misses, and renders props.fallback ?? null instead of the intended icon.

      No longer relevant as of a17bf3d8e290380db42de666137cb43d2a73ba81

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🔴 Critical

      https://github.com/pingdotgg/t3code/blob/927d43bfe5b1a7e8138d973d92ae115494e36147/apps/mobile/src/features/threads/ThreadRouteScreen.tsx#L571

      useMemo for androidHeaderActions at line 587 is called after the early returns at lines 571–577. When selectedThread is null on the first render, the component returns before reaching useMemo, so React records fewer hooks. Once selectedThread loads, the next render reaches useMemo, changing the hook order and triggering the React error: "Rendered more hooks than during the previous render." Move androidHeaderActions (and any other hooks) above the early returns so the hook order is stable across all renders.

      No longer relevant as of 2b347788b3e78c748fb18d0fb6b400369d5494fd

      @@ -338,3 +645,20 @@
      645+ isAndroid
      646+ ? { headerShown: false }
      647+ : {
      648+ headerTransparent: true,
      649+ headerShadowVisible: false,
      650+ headerTintColor: headerIcon,
      651+ headerStyle: {
      652+ backgroundColor: "transparent",
      653+ },
      654+ headerTitle: renderHeaderTitle,
      655+ }
      656+ }
      338657 />
      339658
      340- {showSectionToolbar ? (
      659+ {isAndroid ? (
      660+ <AndroidScreenHeader
      661+ title="Review changes"
      662+ subtitle={androidHeaderSubtitle || "Select a diff"}
      663+ onBack={() => router.back()}
      664+ trailing={
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium review/ReviewSheet.tsx:664

      The isAndroid branch renders AndroidScreenHeader with only the diff-selection menu in trailing, while the Stack.Toolbar block that exposes togglePrimarySidebar and toggleAuxiliaryPane is gated behind !isAndroid. On wide Android layouts where layout.usesSplitView or panes.supportsAuxiliaryPane is true, users have no way to toggle the thread sidebar or the changed-files inspector. Consider adding AndroidHeaderIconButton controls for those toggles in the trailing section, mirroring the iOS Stack.Toolbar.Button entries.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/review/ReviewSheet.tsx around line 664:
      
      The `isAndroid` branch renders `AndroidScreenHeader` with only the diff-selection menu in `trailing`, while the `Stack.Toolbar` block that exposes `togglePrimarySidebar` and `toggleAuxiliaryPane` is gated behind `!isAndroid`. On wide Android layouts where `layout.usesSplitView` or `panes.supportsAuxiliaryPane` is true, users have no way to toggle the thread sidebar or the changed-files inspector. Consider adding `AndroidHeaderIconButton` controls for those toggles in the `trailing` section, mirroring the iOS `Stack.Toolbar.Button` entries.
      @@ -379,3 +391,9 @@
      379391 updateViewportFrame()
      380392 }
      381393
      394+ public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
      395+ // A direct gesture takes ownership from any interrupted programmatic jump.
      396+ // Resume visible-file events immediately so the inspector follows the finger.
      397+ isProgrammaticScrollActive = false
      398+ contentView.isVerticalScrollActive = true
      399+ }
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium ios/T3ReviewDiffView.swift:394

      scrollViewWillBeginDragging clears isProgrammaticScrollActive but leaves pendingScrollFileId and pendingScrollAnimated set. If scrollToFile was queued before the target header existed (e.g. rows still decoding), a later setRowsJson calls applyPendingScrollIfNeeded() and jumps to the old target, overriding the user's manual scroll. Clear the pending scroll request when the user takes control.

      Suggested change
      399+ public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
      400+ // A direct gesture takes ownership from any interrupted programmatic jump.
      401+ // Resume visible-file events immediately so the inspector follows the finger.
      402+ isProgrammaticScrollActive = false
      403+ pendingScrollFileId = nil
      404+ pendingScrollAnimated = false
      405+ contentView.isVerticalScrollActive = true
      406+ }
      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift around lines 394-399:
      
      `scrollViewWillBeginDragging` clears `isProgrammaticScrollActive` but leaves `pendingScrollFileId` and `pendingScrollAnimated` set. If `scrollToFile` was queued before the target header existed (e.g. rows still decoding), a later `setRowsJson` calls `applyPendingScrollIfNeeded()` and jumps to the old target, overriding the user's manual scroll. Clear the pending scroll request when the user takes control.
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/927d43bfe5b1a7e8138d973d92ae115494e36147/apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift#L384

      scrollToFile stores the target file id in pendingScrollFileId and calls applyPendingScrollIfNeeded(), but that helper returns early when bounds.height == 0. layoutSubviews never retries the pending scroll after layout completes, so a scrollToFile call made before the view's first layout silently does nothing — pendingScrollFileId stays set but is never consumed. Consider calling applyPendingScrollIfNeeded() from layoutSubviews so the deferred scroll fires once bounds are available.

      ✅ Resolved in 10533388f19f4142fcbe027014a711bb538200fb

      @@ -143,6 +151,21 @@
      151+ const handleSubmit = useCallback(() => {
      152+ if (!target || !environmentId || !threadId || commentText.trim().length === 0) {
      153+ return;
      154+ }
      155+
      156+ appendReviewCommentToDraft({
      157+ environmentId,
      158+ threadId,
      159+ text: formatReviewCommentContext(target, commentText),
      160+ attachments,
      161+ });
      162+ setAttachments([]);
      163+ dismissComposer();
      164+ }, [attachments, commentText, dismissComposer, environmentId, target, threadId]);
      165+
      143166 return (
      144167 <View style={{ flex: 1 }}>
      145168 <KeyboardAvoidingView automaticOffset behavior="padding" style={{ flex: 1 }}>
      146169 <View
      147170 style={{
      148171 flex: 1,
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium review/ReviewCommentComposerSheet.tsx:174

      The hard-coded 72 px paddingBottom on Android assumes the KeyboardStickyView footer is always 72 px tall, but the footer height is actually 44 (button) + 8 (pt-2) + Math.max(insets.bottom, 10). On devices where insets.bottom exceeds ~20 (e.g. iPhones with a home indicator, where it can be ~34), the footer is taller than 72 px and overlaps the bottom of the comment input and attachment strip, hiding them from view and making them untappable. The padding should be computed from the actual footer height instead of hard-coded.

      -            paddingBottom: target ? (isAndroid ? 72 : 0) : Math.max(insets.bottom, 18),
      +            paddingBottom: target ? (isAndroid ? Math.max(insets.bottom, 10) + 52 : 0) : Math.max(insets.bottom, 18),
      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/review/ReviewCommentComposerSheet.tsx around line 174:
      
      The hard-coded `72` px `paddingBottom` on Android assumes the `KeyboardStickyView` footer is always 72 px tall, but the footer height is actually `44` (button) + `8` (`pt-2`) + `Math.max(insets.bottom, 10)`. On devices where `insets.bottom` exceeds ~20 (e.g. iPhones with a home indicator, where it can be ~34), the footer is taller than 72 px and overlaps the bottom of the comment input and attachment strip, hiding them from view and making them untappable. The padding should be computed from the actual footer height instead of hard-coded.
    4. @@ -0,0 +28,21 @@
      28+ }
      29+ Prop("contentInsetVertical") { view: T3ComposerEditorView, contentInsetVertical: Double ->
      30+ view.setContentInsetVertical(contentInsetVertical.toInt())
      31+ }
      32+ Prop("editable") { view: T3ComposerEditorView, editable: Boolean ->
      33+ view.setEditable(editable)
      34+ }
      35+ Prop("scrollEnabled") { view: T3ComposerEditorView, scrollEnabled: Boolean ->
      36+ view.setScrollEnabled(scrollEnabled)
      37+ }
      38+ Prop("autoFocus") { view: T3ComposerEditorView, autoFocus: Boolean ->
      39+ view.setAutoFocus(autoFocus)
      40+ }
      41+ Prop("autoCorrect") { view: T3ComposerEditorView, autoCorrect: Boolean ->
      42+ view.setAutoCorrect(autoCorrect)
      43+ }
      44+ Prop("spellCheck") { view: T3ComposerEditorView, spellCheck: Boolean ->
      45+ view.setSpellCheck(spellCheck)
      46+ }
      47+
      48+ Events(
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3composereditor/T3ComposerEditorModule.kt:48

      The Events(...) declaration omits onComposerSubmit, and T3ComposerEditorView defines no corresponding EventDispatcher or hardware-keyboard handler. As a result, the onSubmit prop exposed by ComposerEditorProps is never invoked on Android — hardware-keyboard submit that works on iOS silently does nothing here. Consider adding "onComposerSubmit" to the Events list, wiring up an onComposerSubmit dispatcher in the view, and detecting the submit key combination (e.g., Enter without Shift) to fire it.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorModule.kt around line 48:
      
      The `Events(...)` declaration omits `onComposerSubmit`, and `T3ComposerEditorView` defines no corresponding `EventDispatcher` or hardware-keyboard handler. As a result, the `onSubmit` prop exposed by `ComposerEditorProps` is never invoked on Android — hardware-keyboard submit that works on iOS silently does nothing here. Consider adding `"onComposerSubmit"` to the `Events` list, wiring up an `onComposerSubmit` dispatcher in the view, and detecting the submit key combination (e.g., Enter without Shift) to fire it.
      @@ -159 +232,21 @@
      232+ terminalCanvas.cellHeightPx.toInt(),
      233+ )
      234+ }
      235+ emitResponse(response)
      236+ onResize(mapOf("cols" to cols, "rows" to rows))
      237+ feedPendingBuffer()
      238+ renderSnapshot()
      239+ }
      240+
      241+ private fun createTerminal() {
      242+ if (terminalHandle != 0L || cols <= 0 || rows <= 0 || isCleanedUp) return
      243+ terminalHandle = GhosttyBridge.nativeCreate(
      244+ cols,
      245+ rows,
      246+ terminalCanvas.cellWidthPx.toInt(),
      247+ terminalCanvas.cellHeightPx.toInt(),
      248+ foregroundColorValue,
      249+ backgroundColorValue,
      250+ cursorColorValue,
      251+ paletteColors,
      159252 )
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3terminal/T3TerminalView.kt:252

      createTerminal() assigns the result of GhosttyBridge.nativeCreate() directly to terminalHandle without checking for a 0 return value, which indicates native session creation failed. When this happens, terminalHandle stays 0L and emitResize() proceeds to fire onResize and call feedPendingBuffer()/renderSnapshot() as if the terminal were live, so the JS layer never learns creation failed and the view stays blank. Consider checking the return value and emitting an error event when it is 0.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt around line 252:
      
      `createTerminal()` assigns the result of `GhosttyBridge.nativeCreate()` directly to `terminalHandle` without checking for a `0` return value, which indicates native session creation failed. When this happens, `terminalHandle` stays `0L` and `emitResize()` proceeds to fire `onResize` and call `feedPendingBuffer()`/`renderSnapshot()` as if the terminal were live, so the JS layer never learns creation failed and the view stays blank. Consider checking the return value and emitting an error event when it is `0`.
    5. @@ -36,3 +36,15 @@
      3636 The script builds Ghostty with Zig 0.15.2, strips the iOS archives, and replaces only the
      3737 `ios-arm64` and `ios-arm64-simulator` slices. Xcode's Metal toolchain must be installed; if `metal`
      3838 fails, run `xcodebuild -downloadComponent MetalToolchain`.
      39+
      40+## Rebuilding libghostty-vt for Android
      41+
      42+The checked-in Android shared libraries and headers are pinned to the revision recorded in
      43+`Vendor/libghostty-vt/VERSION`. Set `ANDROID_NDK_HOME` and run:
      44+
      45+```bash
      46+apps/mobile/modules/t3-terminal/scripts/build-libghostty-android.sh
      47+```
      48+
      49+The script downloads Zig 0.15.2 when needed, checks out the pinned upstream Ghostty revision, and
      50+rebuilds all four Android ABIs with 16 KB page-size support.
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3-terminal/README.md:50

      The new README section states the script rebuilds "all four Android ABIs with 16 KB page-size support," but build-libghostty-android.sh never passes -Wl,-z,max-page-size=16384 and -Wl,-z,common-page-size=16384 to the linker. A developer following these instructions will rebuild and vendor .so files that are not 16 KB-page compatible while the docs claim otherwise. Add the required linker flags to the script so the rebuilt libraries match the documented behavior.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-terminal/README.md around line 50:
      
      The new README section states the script rebuilds "all four Android ABIs with 16 KB page-size support," but `build-libghostty-android.sh` never passes `-Wl,-z,max-page-size=16384` and `-Wl,-z,common-page-size=16384` to the linker. A developer following these instructions will rebuild and vendor `.so` files that are not 16 KB-page compatible while the docs claim otherwise. Add the required linker flags to the script so the rebuilt libraries match the documented behavior.
      @@ -0,0 +15,21 @@
      15+ view.setThemeJson(themeJson)
      16+ }
      17+ Prop("placeholder") { view: T3ComposerEditorView, placeholder: String ->
      18+ view.setPlaceholder(placeholder)
      19+ }
      20+ Prop("fontFamily") { view: T3ComposerEditorView, fontFamily: String ->
      21+ view.setFontFamily(fontFamily)
      22+ }
      23+ Prop("fontSize") { view: T3ComposerEditorView, fontSize: Double ->
      24+ view.setFontSize(fontSize.toFloat())
      25+ }
      26+ Prop("lineHeight") { view: T3ComposerEditorView, lineHeight: Double ->
      27+ view.setLineHeight(lineHeight.toFloat())
      28+ }
      29+ Prop("contentInsetVertical") { view: T3ComposerEditorView, contentInsetVertical: Double ->
      30+ view.setContentInsetVertical(contentInsetVertical.toInt())
      31+ }
      32+ Prop("editable") { view: T3ComposerEditorView, editable: Boolean ->
      33+ view.setEditable(editable)
      34+ }
      35+ Prop("scrollEnabled") { view: T3ComposerEditorView, scrollEnabled: Boolean ->
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3composereditor/T3ComposerEditorModule.kt:35

      The scrollEnabled prop does not actually disable scrolling. setScrollEnabled only toggles editor.isVerticalScrollBarEnabled, which controls whether the scrollbar is drawn — not whether the view scrolls. When scrollEnabled={false} is passed from JS, the editor remains scrollable and only the scrollbar disappears, so the prop silently does not work. Consider disabling touch interception or overriding onTouchEvent to actually prevent scrolling when scrollEnabled is false.

      Also found in 1 other location(s)

      apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt:199

      setScrollEnabled() at line 199 only assigns editor.isVerticalScrollBarEnabled. Android&#39;s setVerticalScrollBarEnabled() controls whether the scrollbar is drawn, not whether an EditText can actually scroll. When callers pass scrollEnabled=false, long composer contents can still be vertically scrolled; only the scrollbar disappears, so the exposed prop does not work on Android.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorModule.kt around line 35:
      
      The `scrollEnabled` prop does not actually disable scrolling. `setScrollEnabled` only toggles `editor.isVerticalScrollBarEnabled`, which controls whether the scrollbar is drawn — not whether the view scrolls. When `scrollEnabled={false}` is passed from JS, the editor remains scrollable and only the scrollbar disappears, so the prop silently does not work. Consider disabling touch interception or overriding `onTouchEvent` to actually prevent scrolling when `scrollEnabled` is false.
      
      Also found in 1 other location(s):
      - apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt:199 -- `setScrollEnabled()` at line `199` only assigns `editor.isVerticalScrollBarEnabled`. Android's `setVerticalScrollBarEnabled()` controls whether the scrollbar is drawn, not whether an `EditText` can actually scroll. When callers pass `scrollEnabled=false`, long composer contents can still be vertically scrolled; only the scrollbar disappears, so the exposed prop does not work on Android.
      
      @@ -626,19 +722,4 @@
      626- ? handleOpenFilesInspector
      627- : undefined
      628- }
      629- onOpenGitInspector={fileInspector.supported ? handleOpenGitInspector : undefined}
      630- currentBranch={selectedThread.branch}
      631- gitStatus={gitStatus.data}
      632- gitOperationLabel={gitState.gitOperationLabel}
      633- canOpenTerminal={Boolean(selectedThreadProject?.workspaceRoot)}
      634- canOpenFiles={Boolean(selectedThreadProject?.workspaceRoot)}
      635- projectScripts={selectedThreadProject?.scripts ?? []}
      636- terminalSessions={terminalMenuSessions}
      637- onOpenTerminal={handleOpenTerminal}
      638- onOpenNewTerminal={handleOpenNewTerminal}
      639- onRunProjectScript={handleRunProjectScript}
      640- onPull={gitActions.onPullSelectedThreadBranch}
      641- onRunAction={gitActions.onRunSelectedThreadGitAction}
      642- />
      722+ </>
      723+ )}
      643724
      644725 <GitActionProgressOverlay progress={gitActionProgress} onDismiss={dismissGitActionResult} />
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium threads/ThreadRouteScreen.tsx:725

      GitActionProgressOverlay positions itself at insets.top + 48, which was calibrated for the native iOS header. On Android, the new AndroidScreenHeader is Math.max(insets.top, 12) + 58 tall, so the overlay renders ~10px inside the header and overlaps the title and action buttons while a git action is running or after it completes. Consider passing a platform-aware top offset to GitActionProgressOverlay so it clears the Android header.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/threads/ThreadRouteScreen.tsx around line 725:
      
      `GitActionProgressOverlay` positions itself at `insets.top + 48`, which was calibrated for the native iOS header. On Android, the new `AndroidScreenHeader` is `Math.max(insets.top, 12) + 58` tall, so the overlay renders ~10px inside the header and overlaps the title and action buttons while a git action is running or after it completes. Consider passing a platform-aware top offset to `GitActionProgressOverlay` so it clears the Android header.
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium review/ReviewSheet.tsx:490

      handleVisibleFileChange unconditionally calls setVisibleFile with the native event's fileId, overwriting whatever the user just selected. On Android, the native diff view never emits null for the top-of-diff position, so after the user taps the "All files" row and the diff scrolls to the top, the next visibility event reports the first file's id and the navigator selection jumps back to that file. This makes "All files" impossible to keep selected on Android. Consider tracking the last user-initiated selection and skipping the visibility update when the user chose "All files" (fileId === null) and the incoming event carries a non-null fileId.

      No longer relevant as of 2b347788b3e78c748fb18d0fb6b400369d5494fd

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium threads/ThreadNavigationSidebar.tsx:243

      The filter menu subactions set MenuAction.state to "on"/"off" to indicate the active environment, sort order, and grouping, but @react-native-menu/menu only supports state on iOS 14+. On Android, none of these selections show a checked/active indicator, so users cannot tell which option is currently selected. Consider baking the checkmark into the title (e.g. prefixing with ✓ ) so the active state is visible cross-platform.

      No longer relevant as of 2b347788b3e78c748fb18d0fb6b400369d5494fd

    6. Cursor Bugbot has reviewed your changes using high effort and found 6 potential issues.

      Autofix Details

      Bugbot Autofix prepared fixes for all 6 issues found in the latest run.

      • ✅ Fixed: iOS associated domains removed
        • Restored the associatedDomains array with applinks and webcredentials entries for clerk.t3.codes, which was inadvertently dropped when relyingParty was removed from the variant config.
      • ✅ Fixed: Composer scroll flag ignored
        • Added a scrollEnabled property to SelectionAwareEditText with a scrollTo override that blocks scrolling when disabled, so setScrollEnabled now controls actual scroll behavior, not just the scroll bar.
      • ✅ Fixed: Collapsed files skew highlight indices
        • Added a visibleToOriginalIndex mapping array built during rebuildVisibleRows, and the onVisibleRowsChanged callback now translates filtered indices back to original row indices before emitting the visible-range event.
      • ✅ Fixed: Stale rows after content reset
        • setContentResetKey now increments rowsDecodeGeneration and clears rows, visibleRows, visibleToOriginalIndex, and canvasView.rows so in-flight decodes from the previous section are rejected and stale content is immediately cleared.
      • ✅ Fixed: Top scroll never clears file
        • emitVisibleFile now checks if verticalOffset is at zero and emits onVisibleFileChange with a null fileId in that case, matching the iOS behavior that selects the "All files" navigator destination.
      • ✅ Fixed: Collapsed comments stay tall
        • Added collapsedCommentIds to DiffCanvasView and updated rowHeight to return 44dp for collapsed comments (matching iOS's 44pt) instead of the full expanded height.

      Create PR

      Or push these changes by commenting:

      @cursor push a991bbde89
      Preview (pingdotgg/t3code@a991bbde89)
      diff --git a/apps/mobile/app.config.ts b/apps/mobile/app.config.ts
      --- a/apps/mobile/app.config.ts
      +++ b/apps/mobile/app.config.ts
      @@ -107,6 +107,7 @@
           icon: variant.iosIcon,
           supportsTablet: true,
           bundleIdentifier: iosBundleIdentifier,
      +    associatedDomains: ["applinks:clerk.t3.codes", "webcredentials:clerk.t3.codes"],
           infoPlist: {
             NSAppTransportSecurity: {
               NSAllowsArbitraryLoads: true,
      
      diff --git a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      --- a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      +++ b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      @@ -197,6 +197,7 @@
       
         fun setScrollEnabled(scrollEnabled: Boolean) {
           editor.isVerticalScrollBarEnabled = scrollEnabled
      +    editor.scrollEnabled = scrollEnabled
         }
       
         fun setAutoFocus(autoFocus: Boolean) {
      @@ -424,7 +425,12 @@
       private class SelectionAwareEditText(context: Context) : EditText(context) {
         var selectionListener: ((Int, Int) -> Unit)? = null
         var pasteImagesListener: ((List<String>) -> Unit)? = null
      +  var scrollEnabled = true
       
      +  override fun scrollTo(x: Int, y: Int) {
      +    if (scrollEnabled) super.scrollTo(x, y)
      +  }
      +
         override fun onSelectionChanged(selStart: Int, selEnd: Int) {
           super.onSelectionChanged(selStart, selEnd)
           selectionListener?.invoke(selStart, selEnd)
      
      diff --git a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      --- a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      +++ b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      @@ -32,6 +32,7 @@
         private val onToggleComment by EventDispatcher()
         private var rows: List<DiffRow> = emptyList()
         private var visibleRows: List<DiffRow> = emptyList()
      +  private var visibleToOriginalIndex: IntArray = intArrayOf()
         private var collapsedFileIds: Set<String> = emptySet()
         private var viewedFileIds: Set<String> = emptySet()
         private var selectedRowIds: Set<String> = emptySet()
      @@ -56,11 +57,13 @@
         init {
           canvasView.onRowTap = { row, gesture -> handleRowTap(row, gesture) }
           canvasView.onVisibleRowsChanged = { first, last ->
      +      val originalFirst = if (first in visibleToOriginalIndex.indices) visibleToOriginalIndex[first] else first
      +      val originalLast = if (last in visibleToOriginalIndex.indices) visibleToOriginalIndex[last] else last
             onDebug(
               mapOf(
                 "message" to "visible-range",
      -          "firstRowIndex" to first,
      -          "lastRowIndex" to last,
      +          "firstRowIndex" to originalFirst,
      +          "lastRowIndex" to originalLast,
               ),
             )
             emitVisibleFile(first)
      @@ -81,7 +84,12 @@
         fun setContentResetKey(value: String) {
           if (contentResetKey == value) return
           contentResetKey = value
      +    rowsDecodeGeneration += 1
           tokensDecodeGeneration += 1
      +    rows = emptyList()
      +    visibleRows = emptyList()
      +    visibleToOriginalIndex = intArrayOf()
      +    canvasView.rows = emptyList()
           canvasView.tokensByRowId = emptyMap()
           lastVisibleFileId = null
           pendingInitialScroll = true
      @@ -314,21 +322,27 @@
       
         private fun rebuildVisibleRows() {
           val filtered = ArrayList<DiffRow>(rows.size)
      +    val indexMapping = ArrayList<Int>(rows.size)
           var currentFileCollapsed = false
      -    rows.forEach { row ->
      +    rows.forEachIndexed { originalIndex, row ->
             if (row.kind == "file") {
               currentFileCollapsed = collapsedFileIds.contains(row.resolvedFileId)
               filtered.add(row)
      +        indexMapping.add(originalIndex)
             } else if (!currentFileCollapsed) {
               if (row.kind != "comment" || !collapsedCommentIds.contains(row.id)) {
                 filtered.add(row)
      +          indexMapping.add(originalIndex)
               } else {
                 filtered.add(row.copy(commentText = "Comment collapsed"))
      +          indexMapping.add(originalIndex)
               }
             }
           }
           visibleRows = filtered
      +    visibleToOriginalIndex = indexMapping.toIntArray()
           canvasView.rows = filtered
      +    canvasView.collapsedCommentIds = collapsedCommentIds
           canvasView.viewedFileIds = viewedFileIds
           canvasView.selectedRowIds = selectedRowIds
           applyPendingInitialScroll()
      @@ -360,6 +374,13 @@
       
         private fun emitVisibleFile(firstVisibleIndex: Int) {
           if (visibleRows.isEmpty()) return
      +    if (canvasView.verticalOffset() <= 0) {
      +      if (lastVisibleFileId != null) {
      +        lastVisibleFileId = null
      +        onVisibleFileChange(mapOf("fileId" to null))
      +      }
      +      return
      +    }
           val start = firstVisibleIndex.coerceIn(0, visibleRows.lastIndex)
           val fileId = (start downTo 0)
             .asSequence()
      @@ -590,6 +611,11 @@
             field = value
             invalidate()
           }
      +  var collapsedCommentIds: Set<String> = emptySet()
      +    set(value) {
      +      field = value
      +      rebuildOffsets()
      +    }
         var theme: DiffTheme = DiffTheme.fallback("light")
           set(value) {
             field = value
      @@ -691,7 +717,11 @@
       
         private fun rowHeight(row: DiffRow): Int = when (row.kind) {
           "file" -> style.fileHeaderHeightPx.toInt()
      -    "comment" -> max((style.rowHeightPx * 3.2f).toInt(), (56 * density).toInt())
      +    "comment" -> if (collapsedCommentIds.contains(row.id)) {
      +      (44 * density).toInt()
      +    } else {
      +      max((style.rowHeightPx * 3.2f).toInt(), (56 * density).toInt())
      +    }
           else -> style.rowHeightPx.toInt()
         }.coerceAtLeast(1)
      You can send follow-ups to the cloud agent here.
      @@ -0,0 +71,21 @@
      71+ LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT),
      72+ )
      73+ }
      74+
      75+ fun setTokensResetKey(value: String) {
      76+ if (tokensResetKey == value) return
      77+ tokensResetKey = value
      78+ canvasView.tokensByRowId = emptyMap()
      79+ }
      80+
      81+ fun setContentResetKey(value: String) {
      82+ if (contentResetKey == value) return
      83+ contentResetKey = value
      84+ tokensDecodeGeneration += 1
      85+ canvasView.tokensByRowId = emptyMap()
      86+ lastVisibleFileId = null
      87+ pendingInitialScroll = true
      88+ canvasView.setVerticalOffset(0)
      89+ canvasView.setHorizontalOffset(0)
      90+ applyPendingInitialScroll()
      91+ }

      Stale rows after content reset

      Medium Severity

      When contentResetKey changes, the view clears tokens and scroll but does not bump rowsDecodeGeneration or clear rows. An in-flight setRowsJson decode from the previous review section can still post after the reset and repopulate the canvas with the old diff.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 276b453063d451091149ed5c236cea9b347f8432. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +352,21 @@
      352+ "change" to row.change,
      353+ )
      354+ row.oldLineNumber?.let { payload["oldLineNumber"] = it }
      355+ row.newLineNumber?.let { payload["newLineNumber"] = it }
      356+ onPressLine(payload)
      357+ }
      358+ }
      359+ }
      360+
      361+ private fun emitVisibleFile(firstVisibleIndex: Int) {
      362+ if (visibleRows.isEmpty()) return
      363+ val start = firstVisibleIndex.coerceIn(0, visibleRows.lastIndex)
      364+ val fileId = (start downTo 0)
      365+ .asSequence()
      366+ .map { visibleRows[it].resolvedFileId }
      367+ .firstOrNull { it.isNotEmpty() }
      368+ ?: return
      369+ if (fileId == lastVisibleFileId) return
      370+ lastVisibleFileId = fileId
      371+ onVisibleFileChange(mapOf("fileId" to fileId))
      372+ }

      Top scroll never clears file

      Medium Severity

      Android never emits onVisibleFileChange with a null fileId when the diff is scrolled to the top. The navigator keeps highlighting the first file instead of the shared “all files” destination that iOS reports at offset zero.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 276b453063d451091149ed5c236cea9b347f8432. Configure [here](https://www.cursor.com/dashboard/bugbot).
    7. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      29 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    8. @@ -0,0 +161,21 @@
      161+ }
      162+ }
      163+ }
      164+
      165+ fun setTokensPatchJson(value: String) {
      166+ payloadDecodeExecutor.execute {
      167+ try {
      168+ val payload = JSONObject(value)
      169+ val resetKey = payload.optString("resetKey")
      170+ val decodedTokens = parseTokensObject(
      171+ payload.optJSONObject("tokensByRowId") ?: JSONObject(),
      172+ )
      173+ post {
      174+ if (resetKey.isNotEmpty() && resetKey != tokensResetKey) return@post
      175+ if (decodedTokens.isNotEmpty()) {
      176+ canvasView.tokensByRowId = canvasView.tokensByRowId + decodedTokens
      177+ }
      178+ }
      179+ } catch (_: Exception) {
      180+ }
      181+ }
      cursor[bot](GitHub profile, opens in a new tab)commented

      Stale token patches after reset

      High Severity

      The setTokensPatchJson function asynchronously applies token patches. It only checks tokensResetKey for relevance, missing a crucial check against contentResetKey. This can cause token patches from a previous diff to be applied to the current view, resulting in incorrect highlighting.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2ae93656ce226bc792f2dfffe8ca08580eadca3c. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +825,21 @@
      825+
      826+ val tokens = tokensByRowId[row.id]
      827+ drawScrollableCode(canvas, top, bottom) { codeX ->
      828+ if (tokens.isNullOrEmpty()) {
      829+ textPaint.textSize = style.codeFontSizePx
      830+ textPaint.color = when (row.change) {
      831+ "add" -> theme.addText
      832+ "delete" -> theme.deleteText
      833+ else -> theme.text
      834+ }
      835+ canvas.drawText(row.content, codeX, centeredBaseline(top, bottom, textPaint), textPaint)
      836+ } else {
      837+ var x = codeX
      838+ tokens.forEach { token ->
      839+ textPaint.textSize = style.codeFontSizePx
      840+ textPaint.color = token.color ?: theme.text
      841+ textPaint.typeface = when {
      842+ token.fontStyle and 1 != 0 -> Typeface.create(Typeface.MONOSPACE, Typeface.ITALIC)
      843+ token.fontStyle and 2 != 0 -> Typeface.create(Typeface.MONOSPACE, Typeface.BOLD)
      844+ else -> Typeface.MONOSPACE
      845+ }

      Bold italic tokens render wrong

      Low Severity

      The when statement for textPaint.typeface in drawLineRow applies fontStyle bits sequentially, causing tokens with both italic and bold flags to render only as italic. This results in bold styling being lost and diverges from the intended combined styling.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2ae93656ce226bc792f2dfffe8ca08580eadca3c. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +430,21 @@
      430+ selectionListener?.invoke(selStart, selEnd)
      431+ }
      432+
      433+ override fun onTextContextMenuItem(id: Int): Boolean {
      434+ if (id == android.R.id.paste || id == android.R.id.pasteAsPlainText) {
      435+ val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
      436+ val clip = clipboard?.primaryClip
      437+ val imageUris = buildList {
      438+ if (clip != null) {
      439+ for (index in 0 until clip.itemCount) {
      440+ clip.getItemAt(index).uri?.let { uri ->
      441+ val mimeType = context.contentResolver.getType(uri)
      442+ if (mimeType?.startsWith("image/") == true) add(uri.toString())
      443+ }
      444+ }
      445+ }
      446+ }
      447+ if (imageUris.isNotEmpty()) {
      448+ pasteImagesListener?.invoke(imageUris)
      449+ return true
      450+ }

      Paste skips text when images present

      Medium Severity

      On paste, if any clipboard item exposes an image URI, Android invokes onComposerPasteImages and returns true without calling super.onTextContextMenuItem. Plain-text paste from the same or another clip item never runs, so mixed or text-first paste silently fails.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2ae93656ce226bc792f2dfffe8ca08580eadca3c. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -0,0 +35,21 @@
      35+ Prop("styleJson") { view: T3ReviewDiffView, styleJson: String ->
      36+ view.setStyleJson(styleJson)
      37+ }
      38+ Prop("rowHeight") { view: T3ReviewDiffView, rowHeight: Double ->
      39+ view.setRowHeight(rowHeight.toFloat())
      40+ }
      41+ Prop("contentWidth") { view: T3ReviewDiffView, contentWidth: Double ->
      42+ view.setContentWidth(contentWidth.toFloat())
      43+ }
      44+ Prop("initialRowIndex") { view: T3ReviewDiffView, initialRowIndex: Double ->
      45+ view.setInitialRowIndex(initialRowIndex)
      46+ }
      47+
      48+ Events(
      49+ "onDebug",
      50+ "onVisibleFileChange",
      51+ "onToggleFile",
      52+ "onToggleViewedFile",
      53+ "onPressLine",
      54+ "onToggleComment",
      55+ )

      Review diff pull refresh missing

      Medium Severity

      The Android T3ReviewDiffSurface module does not define the refreshing prop or onPullToRefresh event that exist on iOS. SourceFileSurface passes both when refresh is enabled, so pull-to-refresh on the native source file view does nothing on Android.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2ae93656ce226bc792f2dfffe8ca08580eadca3c. Configure [here](https://www.cursor.com/dashboard/bugbot).
    9. @@ -11,4 +12,4 @@
      1112 ) {
      1213 const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();
      1314
      14- if (!layout.usesSplitView) {
      15+ if (Platform.OS === "android" || !layout.usesSplitView) {
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium layout/workspace-sidebar-toolbar.tsx:15

      WorkspaceSidebarToolbar returns null on Android regardless of layout.usesSplitView, so split-view Android routes lose the sidebar toggle and New task/Return to chat buttons. The Android exclusion should be removed unless Android genuinely lacks split-view support.

      Suggested change
      15- if (Platform.OS === "android" || !layout.usesSplitView) {
      15+ if (!layout.usesSplitView) {
      Also found in 1 other location(s)

      apps/mobile/src/features/review/ReviewSheet.tsx:663

      On Android the new !isAndroid guard at ReviewSheet line 663 removes the entire right-side toolbar, which is the only place ThreadGitMenu is rendered. The replacement AndroidScreenHeader only shows the section selector, so opening review on Android no longer exposes the commit/push/&#34;More&#34; git actions that this screen previously provided. Users must leave review to perform those actions, which is a regression in core review functionality.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/layout/workspace-sidebar-toolbar.tsx around line 15:
      
      `WorkspaceSidebarToolbar` returns `null` on Android regardless of `layout.usesSplitView`, so split-view Android routes lose the sidebar toggle and `New task`/`Return to chat` buttons. The Android exclusion should be removed unless Android genuinely lacks split-view support.
      
      Also found in 1 other location(s):
      - apps/mobile/src/features/review/ReviewSheet.tsx:663 -- On Android the new `!isAndroid` guard at `ReviewSheet` line 663 removes the entire right-side toolbar, which is the only place `ThreadGitMenu` is rendered. The replacement `AndroidScreenHeader` only shows the section selector, so opening review on Android no longer exposes the commit/push/"More" git actions that this screen previously provided. Users must leave review to perform those actions, which is a regression in core review functionality.
      
    10. Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

      There are 11 total unresolved issues (including 8 from previous reviews).

      Autofix Details

      Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

      • ✅ Fixed: Shared horizontal scroll across files
        • Replaced the single horizontalOffset field with a per-file HashMap<String, Int> so each file maintains its own horizontal scroll position, matching iOS's horizontalOffsetsByFileId behavior.
      • ✅ Fixed: Paste sends unreadable content URIs
        • Added copyToLocalFile() that copies content:// clipboard images into app cache (t3-composer-paste/*.png) and emits file:// URIs that convertPastedImagesToAttachments can read, matching the iOS writeTemporaryImage pattern.
      • ✅ Fixed: Word diff highlights missing Android
        • Added wordDiffRanges field to DiffRow, parsing from row JSON, and implemented drawWordDiffRanges() to render intra-line add/delete highlights matching iOS's behavior.

      Create PR

      Or push these changes by commenting:

      @cursor push 5664a9a0e6
      Preview (pingdotgg/t3code@5664a9a0e6)
      diff --git a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      --- a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      +++ b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      @@ -7,6 +7,7 @@
       import android.graphics.Paint
       import android.graphics.RectF
       import android.graphics.Typeface
      +import android.net.Uri
       import android.text.Editable
       import android.text.InputType
       import android.text.Spanned
      @@ -20,6 +21,8 @@
       import expo.modules.kotlin.viewevent.EventDispatcher
       import expo.modules.kotlin.views.ExpoView
       import org.json.JSONObject
      +import java.io.File
      +import java.util.UUID
       import kotlin.math.max
       
       class T3ComposerEditorView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
      @@ -434,21 +437,39 @@
           if (id == android.R.id.paste || id == android.R.id.pasteAsPlainText) {
             val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager
             val clip = clipboard?.primaryClip
      -      val imageUris = buildList {
      +      val fileUris = buildList {
               if (clip != null) {
                 for (index in 0 until clip.itemCount) {
                   clip.getItemAt(index).uri?.let { uri ->
                     val mimeType = context.contentResolver.getType(uri)
      -              if (mimeType?.startsWith("image/") == true) add(uri.toString())
      +              if (mimeType?.startsWith("image/") == true) {
      +                copyToLocalFile(uri)?.let { add(it) }
      +              }
                   }
                 }
               }
             }
      -      if (imageUris.isNotEmpty()) {
      -        pasteImagesListener?.invoke(imageUris)
      +      if (fileUris.isNotEmpty()) {
      +        pasteImagesListener?.invoke(fileUris)
               return true
             }
           }
           return super.onTextContextMenuItem(id)
         }
      +
      +  private fun copyToLocalFile(contentUri: Uri): String? {
      +    return try {
      +      val pasteDir = File(context.cacheDir, "t3-composer-paste")
      +      pasteDir.mkdirs()
      +      val destFile = File(pasteDir, "${UUID.randomUUID()}.png")
      +      context.contentResolver.openInputStream(contentUri)?.use { input ->
      +        destFile.outputStream().use { output ->
      +          input.copyTo(output)
      +        }
      +      }
      +      Uri.fromFile(destFile).toString()
      +    } catch (_: Exception) {
      +      null
      +    }
      +  }
       }
      
      diff --git a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      --- a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      +++ b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      @@ -86,7 +86,7 @@
           lastVisibleFileId = null
           pendingInitialScroll = true
           canvasView.setVerticalOffset(0)
      -    canvasView.setHorizontalOffset(0)
      +    canvasView.resetHorizontalOffsets()
           applyPendingInitialScroll()
         }
       
      @@ -416,6 +416,7 @@
         val change: String,
         val oldLineNumber: Int?,
         val newLineNumber: Int?,
      +  val wordDiffRanges: List<DiffWordDiffRange>?,
         val commentText: String,
         val commentRangeLabel: String,
         val commentSectionTitle: String,
      @@ -423,6 +424,11 @@
         val resolvedFileId: String get() = fileId.ifEmpty { id }
       }
       
      +private data class DiffWordDiffRange(
      +  val start: Int,
      +  val end: Int,
      +)
      +
       private data class DiffToken(
         val content: String,
         val color: Int?,
      @@ -567,12 +573,13 @@
         )
         private var rowOffsets = intArrayOf(0)
         private var verticalOffset = 0
      -  private var horizontalOffset = 0
      +  private var horizontalOffsetsByFileId = HashMap<String, Int>()
         private var lastVisibleRange: Pair<Int, Int>? = null
       
         var rows: List<DiffRow> = emptyList()
           set(value) {
             field = value
      +      horizontalOffsetsByFileId.clear()
             rebuildOffsets()
           }
         var tokensByRowId: Map<String, List<DiffToken>> = emptyMap()
      @@ -603,7 +610,7 @@
         var contentWidthPx: Int = (1200 * density).toInt()
           set(value) {
             field = max(value, suggestedMinimumWidth)
      -      setHorizontalOffset(horizontalOffset)
      +      clampHorizontalOffsets()
             invalidate()
           }
         var onRowTap: ((DiffRow, String) -> Unit)? = null
      @@ -619,7 +626,7 @@
         override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) {
           super.onSizeChanged(width, height, oldWidth, oldHeight)
           setVerticalOffset(verticalOffset)
      -    setHorizontalOffset(horizontalOffset)
      +    clampHorizontalOffsets()
         }
       
         override fun onDraw(canvas: Canvas) {
      @@ -665,20 +672,58 @@
         fun maxVerticalOffset(): Int = max(0, (rowOffsets.lastOrNull() ?: 0) - height)
       
         fun setHorizontalOffset(value: Int) {
      +    val fileId = fileIdAtVerticalCenter() ?: return
           val nextOffset = value.coerceIn(0, maxHorizontalOffset())
      -    if (horizontalOffset == nextOffset) return
      -    horizontalOffset = nextOffset
      +    val current = horizontalOffsetsByFileId[fileId] ?: 0
      +    if (current == nextOffset) return
      +    horizontalOffsetsByFileId[fileId] = nextOffset
           invalidate()
         }
       
         fun scrollByHorizontal(delta: Int) {
      -    setHorizontalOffset(horizontalOffset + delta)
      +    val fileId = fileIdAtVerticalCenter() ?: return
      +    val current = horizontalOffsetsByFileId[fileId] ?: 0
      +    setHorizontalOffsetForFile(fileId, current + delta)
         }
       
      -  fun horizontalOffset(): Int = horizontalOffset
      +  fun horizontalOffset(): Int {
      +    val fileId = fileIdAtVerticalCenter() ?: return 0
      +    return horizontalOffsetsByFileId[fileId] ?: 0
      +  }
       
         fun maxHorizontalOffset(): Int = max(0, contentWidthPx - width)
       
      +  fun resetHorizontalOffsets() {
      +    horizontalOffsetsByFileId.clear()
      +  }
      +
      +  private fun setHorizontalOffsetForFile(fileId: String, value: Int) {
      +    val nextOffset = value.coerceIn(0, maxHorizontalOffset())
      +    val current = horizontalOffsetsByFileId[fileId] ?: 0
      +    if (current == nextOffset) return
      +    horizontalOffsetsByFileId[fileId] = nextOffset
      +    invalidate()
      +  }
      +
      +  private fun clampHorizontalOffsets() {
      +    val maxOffset = maxHorizontalOffset()
      +    val iterator = horizontalOffsetsByFileId.entries.iterator()
      +    while (iterator.hasNext()) {
      +      val entry = iterator.next()
      +      entry.setValue(entry.value.coerceIn(0, maxOffset))
      +    }
      +  }
      +
      +  private fun fileIdAtVerticalCenter(): String? {
      +    if (rows.isEmpty()) return null
      +    val centerY = verticalOffset + height / 2
      +    val index = rowIndexAt(centerY).coerceIn(0, rows.lastIndex)
      +    return (index downTo 0)
      +      .asSequence()
      +      .map { rows[it].resolvedFileId }
      +      .firstOrNull { it.isNotEmpty() }
      +  }
      +
         private fun rebuildOffsets() {
           rowOffsets = IntArray(rows.size + 1)
           rows.forEachIndexed { index, row ->
      @@ -760,7 +805,7 @@
           fill(canvas, theme.hunkBackground, 0f, top.toFloat(), width.toFloat(), bottom.toFloat())
           textPaint.color = theme.hunkText
           textPaint.textSize = style.codeFontSizePx
      -    drawScrollableCode(canvas, top, bottom) { codeX ->
      +    drawScrollableCode(canvas, top, bottom, row.resolvedFileId) { codeX ->
             canvas.drawText(
               row.text.ifEmpty { row.content },
               codeX,
      @@ -773,7 +818,7 @@
         private fun drawNoticeRow(canvas: Canvas, row: DiffRow, top: Int, bottom: Int) {
           textPaint.color = theme.mutedText
           textPaint.textSize = style.codeFontSizePx
      -    drawScrollableCode(canvas, top, bottom) { codeX ->
      +    drawScrollableCode(canvas, top, bottom, row.resolvedFileId) { codeX ->
             canvas.drawText(row.text, codeX, centeredBaseline(top, bottom, textPaint), textPaint)
           }
         }
      @@ -782,7 +827,7 @@
           fill(canvas, theme.headerBackground, style.gutterWidthPx, top.toFloat(), width.toFloat(), bottom.toFloat())
           boldTextPaint.color = theme.text
           boldTextPaint.textSize = 12f * density
      -    drawScrollableCode(canvas, top, bottom) { codeX ->
      +    drawScrollableCode(canvas, top, bottom, row.resolvedFileId) { codeX ->
             canvas.drawText(
               row.commentSectionTitle.ifEmpty { row.commentRangeLabel.ifEmpty { "Comment" } },
               codeX,
      @@ -824,7 +869,8 @@
           }
       
           val tokens = tokensByRowId[row.id]
      -    drawScrollableCode(canvas, top, bottom) { codeX ->
      +    drawScrollableCode(canvas, top, bottom, row.resolvedFileId) { codeX ->
      +      drawWordDiffRanges(canvas, row, codeX, top, bottom)
             if (tokens.isNullOrEmpty()) {
               textPaint.textSize = style.codeFontSizePx
               textPaint.color = when (row.change) {
      @@ -859,16 +905,40 @@
           canvas.drawText(newNumber, style.changeBarWidthPx + style.gutterWidthPx / 2f, baseline, textPaint)
         }
       
      +  private fun drawWordDiffRanges(canvas: Canvas, row: DiffRow, codeX: Float, top: Int, bottom: Int) {
      +    val ranges = row.wordDiffRanges
      +    if (ranges.isNullOrEmpty()) return
      +    val change = row.change
      +    if (change != "add" && change != "delete") return
      +
      +    val fillColor = if (change == "add") withAlpha(theme.addBar, 71) else withAlpha(theme.deleteBar, 71)
      +    textPaint.textSize = style.codeFontSizePx
      +    val charWidth = textPaint.measureText("m")
      +    val highlightHeight = max(4f * density, min((bottom - top).toFloat() - 4f * density, textPaint.fontMetrics.let { -it.ascent + it.descent }))
      +    val highlightY = (top + bottom) / 2f - highlightHeight / 2f
      +    val cornerRadius = 3f * density
      +
      +    for (range in ranges) {
      +      if (range.end <= range.start) continue
      +      val startX = codeX + range.start * charWidth
      +      val rangeWidth = max(2f * density, (range.end - range.start) * charWidth)
      +      backgroundPaint.color = fillColor
      +      canvas.drawRoundRect(startX, highlightY, startX + rangeWidth, highlightY + highlightHeight, cornerRadius, cornerRadius, backgroundPaint)
      +    }
      +  }
      +
         private fun drawScrollableCode(
           canvas: Canvas,
           top: Int,
           bottom: Int,
      +    fileId: String,
           draw: (Float) -> Unit,
         ) {
           val gutterEnd = style.changeBarWidthPx + style.gutterWidthPx
      +    val offset = horizontalOffsetsByFileId[fileId] ?: 0
           canvas.save()
           canvas.clipRect(gutterEnd, top.toFloat(), width.toFloat(), bottom.toFloat())
      -    draw(gutterEnd + style.codePaddingPx - horizontalOffset)
      +    draw(gutterEnd + style.codePaddingPx - offset)
           canvas.restore()
         }
       
      @@ -895,10 +965,12 @@
         private fun drawHorizontalScrollIndicator(canvas: Canvas) {
           val maxOffset = maxHorizontalOffset()
           if (maxOffset <= 0 || width <= 0) return
      +    val currentOffset = horizontalOffset()
      +    if (currentOffset <= 0) return
           val trackWidth = width.toFloat()
           val thumbWidth = max(24f * density, trackWidth * trackWidth / contentWidthPx)
           val thumbTravel = trackWidth - thumbWidth
      -    val left = thumbTravel * horizontalOffset / maxOffset
      +    val left = thumbTravel * currentOffset / maxOffset
           fill(
             canvas,
             withAlpha(theme.mutedText, 110),
      @@ -962,6 +1034,15 @@
             change = row.optString("change", "context"),
             oldLineNumber = row.optNullableInt("oldLineNumber"),
             newLineNumber = row.optNullableInt("newLineNumber"),
      +      wordDiffRanges = row.optJSONArray("wordDiffRanges")?.let { rangesArray ->
      +        List(rangesArray.length()) { rangeIndex ->
      +          val rangeObj = rangesArray.getJSONObject(rangeIndex)
      +          DiffWordDiffRange(
      +            start = rangeObj.optInt("start"),
      +            end = rangeObj.optInt("end"),
      +          )
      +        }
      +      },
             commentText = row.optString("commentText"),
             commentRangeLabel = row.optString("commentRangeLabel"),
             commentSectionTitle = row.optString("commentSectionTitle"),
      You can send follow-ups to the cloud agent here.
      @@ -0,0 +660,21 @@
      660+ setVerticalOffset(verticalOffset + delta)
      661+ }
      662+
      663+ fun verticalOffset(): Int = verticalOffset
      664+
      665+ fun maxVerticalOffset(): Int = max(0, (rowOffsets.lastOrNull() ?: 0) - height)
      666+
      667+ fun setHorizontalOffset(value: Int) {
      668+ val nextOffset = value.coerceIn(0, maxHorizontalOffset())
      669+ if (horizontalOffset == nextOffset) return
      670+ horizontalOffset = nextOffset
      671+ invalidate()
      672+ }
      673+
      674+ fun scrollByHorizontal(delta: Int) {
      675+ setHorizontalOffset(horizontalOffset + delta)
      676+ }
      677+
      678+ fun horizontalOffset(): Int = horizontalOffset
      679+
      680+ fun maxHorizontalOffset(): Int = max(0, contentWidthPx - width)

      Shared horizontal scroll across files

      Medium Severity

      The T3ReviewDiffView on Android uses a single horizontal scroll offset for the entire diff. This differs from iOS's per-file tracking and can cause files to display with incorrect horizontal alignment if another file was previously scrolled.

      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2b347788b3e78c748fb18d0fb6b400369d5494fd. Configure [here](https://www.cursor.com/dashboard/bugbot).
    11. Bugbot Autofix prepared fixes for all 4 issues found in the latest run.

      • ✅ Fixed: Stale token patches after reset
        • Added contentResetKey capture before async decode and guard check on the main thread, matching the iOS implementation that prevents stale patches from being applied after a view reset.
      • ✅ Fixed: Bold italic tokens render wrong
        • Added a combined check for fontStyle bits 1+2 (value 3) mapping to Typeface.BOLD_ITALIC before the individual italic and bold checks in the when statement.
      • ✅ Fixed: Review diff pull refresh missing
        • Added SwipeRefreshLayout wrapping the canvas view, registered the refreshing prop and onPullToRefresh event in the module, and modified touch interception to allow pull-down gestures at the top to reach the refresh layout.
      • ✅ Fixed: Paste skips text when images present
        • Added a check to skip clipboard items that have non-empty text content when scanning for image URIs, so mixed text+image clips fall through to the default text paste behavior.

      Create PR

      Or push these changes by commenting:

      @cursor push 969f425c0b
      Preview (pingdotgg/t3code@969f425c0b)
      diff --git a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      --- a/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      +++ b/apps/mobile/modules/t3-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
      @@ -437,7 +437,9 @@
             val imageUris = buildList {
               if (clip != null) {
                 for (index in 0 until clip.itemCount) {
      -            clip.getItemAt(index).uri?.let { uri ->
      +            val item = clip.getItemAt(index)
      +            if (!item.text.isNullOrEmpty()) continue
      +            item.uri?.let { uri ->
                     val mimeType = context.contentResolver.getType(uri)
                     if (mimeType?.startsWith("image/") == true) add(uri.toString())
                   }
      
      diff --git a/apps/mobile/modules/t3-review-diff/android/build.gradle b/apps/mobile/modules/t3-review-diff/android/build.gradle
      --- a/apps/mobile/modules/t3-review-diff/android/build.gradle
      +++ b/apps/mobile/modules/t3-review-diff/android/build.gradle
      @@ -16,4 +16,5 @@
       
       dependencies {
         implementation project(':expo-modules-core')
      +  implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
       }
      
      diff --git a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffModule.kt b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffModule.kt
      --- a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffModule.kt
      +++ b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffModule.kt
      @@ -44,6 +44,9 @@
             Prop("initialRowIndex") { view: T3ReviewDiffView, initialRowIndex: Double ->
               view.setInitialRowIndex(initialRowIndex)
             }
      +      Prop("refreshing") { view: T3ReviewDiffView, refreshing: Boolean ->
      +        view.setRefreshing(refreshing)
      +      }
       
             Events(
               "onDebug",
      @@ -52,6 +55,7 @@
               "onToggleViewedFile",
               "onPressLine",
               "onToggleComment",
      +        "onPullToRefresh",
             )
       
             AsyncFunction("scrollToFile") { view: T3ReviewDiffView, fileId: String, animated: Boolean ->
      
      diff --git a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      --- a/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      +++ b/apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
      @@ -12,6 +12,7 @@
       import android.view.ViewGroup
       import android.view.ViewConfiguration
       import android.widget.OverScroller
      +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
       import expo.modules.kotlin.AppContext
       import expo.modules.kotlin.viewevent.EventDispatcher
       import expo.modules.kotlin.views.ExpoView
      @@ -24,12 +25,16 @@
       
       class T3ReviewDiffView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
         private val canvasView = DiffCanvasView(context)
      +  private val swipeRefreshLayout = object : SwipeRefreshLayout(context) {
      +    override fun canChildScrollUp(): Boolean = canvasView.verticalOffset() > 0
      +  }
         private val onDebug by EventDispatcher()
         private val onVisibleFileChange by EventDispatcher()
         private val onToggleFile by EventDispatcher()
         private val onToggleViewedFile by EventDispatcher()
         private val onPressLine by EventDispatcher()
         private val onToggleComment by EventDispatcher()
      +  private val onPullToRefresh by EventDispatcher()
         private var rows: List<DiffRow> = emptyList()
         private var visibleRows: List<DiffRow> = emptyList()
         private var collapsedFileIds: Set<String> = emptySet()
      @@ -66,12 +71,21 @@
             emitVisibleFile(first)
           }
       
      -    addView(
      +    swipeRefreshLayout.addView(
             canvasView,
             LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT),
           )
      +    swipeRefreshLayout.setOnRefreshListener { onPullToRefresh(emptyMap()) }
      +    addView(
      +      swipeRefreshLayout,
      +      LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT),
      +    )
         }
       
      +  fun setRefreshing(value: Boolean) {
      +    swipeRefreshLayout.isRefreshing = value
      +  }
      +
         fun setTokensResetKey(value: String) {
           if (tokensResetKey == value) return
           tokensResetKey = value
      @@ -163,6 +177,7 @@
         }
       
         fun setTokensPatchJson(value: String) {
      +    val capturedContentResetKey = contentResetKey
           payloadDecodeExecutor.execute {
             try {
               val payload = JSONObject(value)
      @@ -171,6 +186,7 @@
                 payload.optJSONObject("tokensByRowId") ?: JSONObject(),
               )
               post {
      +          if (capturedContentResetKey != contentResetKey) return@post
                 if (resetKey.isNotEmpty() && resetKey != tokensResetKey) return@post
                 if (decodedTokens.isNotEmpty()) {
                   canvasView.tokensByRowId = canvasView.tokensByRowId + decodedTokens
      @@ -211,7 +227,14 @@
                 val deltaX = event.x - lastTouchX
                 val deltaY = event.y - lastTouchY
                 if (max(abs(deltaX), abs(deltaY)) > touchSlop) {
      -            dragAxis = if (abs(deltaY) >= abs(deltaX)) DragAxis.VERTICAL else DragAxis.HORIZONTAL
      +            if (abs(deltaY) >= abs(deltaX)) {
      +              if (deltaY > 0 && canvasView.verticalOffset() == 0) {
      +                return false
      +              }
      +              dragAxis = DragAxis.VERTICAL
      +            } else {
      +              dragAxis = DragAxis.HORIZONTAL
      +            }
                 }
               }
               return dragAxis != null
      @@ -839,6 +862,7 @@
                 textPaint.textSize = style.codeFontSizePx
                 textPaint.color = token.color ?: theme.text
                 textPaint.typeface = when {
      +            token.fontStyle and 3 == 3 -> Typeface.create(Typeface.MONOSPACE, Typeface.BOLD_ITALIC)
                   token.fontStyle and 1 != 0 -> Typeface.create(Typeface.MONOSPACE, Typeface.ITALIC)
                   token.fontStyle and 2 != 0 -> Typeface.create(Typeface.MONOSPACE, Typeface.BOLD)
                   else -> Typeface.MONOSPACE
      You can send follow-ups to the cloud agent here.
    12. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium archive/ArchivedThreadsScreen.tsx:307

      ArchivedThreadRow wraps rows in ThreadSwipeable but never passes resetKey, so when LegendList recycles a cell that was left open or mid-drag onto a different thread, the swipe state leaks and the new thread appears already swiped with the wrong actions exposed. Pass a unique key like `${thread.environmentId}:${thread.id}` to resetKey so ThreadSwipeable snaps back to closed on reuse.

      No longer relevant as of ed1e47fdda661f140c175367daf5f197ff324c8a

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium files/ThreadFilesRouteScreen.tsx:524

      handleSelectFile in ThreadFileScreen always calls navigation.navigate("ThreadFile", ...), pushing a new route onto the stack for every file selected from the inspector. ThreadFilesTreeScreen uses resolveFileSelectionNavigationAction() to decide between replace and navigate based on fileInspector.supported, but ThreadFileScreen omits this check. On wide layouts with a persistent file inspector, each selection grows the back stack, so Back walks through every previously opened file instead of returning to chat in one step. Consider applying the same resolveFileSelectionNavigationAction logic here.

      No longer relevant as of 9af886774f9073485e10532944f4e2196740dc44

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium home/HomeHeader.tsx:317

      IosHomeHeader calls useHardwareKeyboardCommand("focusSearch", focusSearch), but on the iOS path headerSearchBarOptions is explicitly undefined, so no component is ever attached to searchBarRef. As a result, searchBarRef.current stays null, focusSearch() is a no-op, and pressing the hardware focusSearch shortcut does nothing on iOS — the Home search field never receives focus. Consider wiring the search field ref to the native iOS toolbar item (or only registering the command on the platform where the ref is actually connected).

      No longer relevant as of 9af886774f9073485e10532944f4e2196740dc44

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High home/HomeScreen.tsx:347

      On iOS, when !hasAnyThreads is true, HomeScreen returns the empty-state branch (lines 325–350) without rendering any WorkspaceConnectionStatus. The connectionStatus variable is set only for Platform.OS !== "ios", and the iOS status row is only included in listHeader, which is never used in the early-return path. As a result, iOS users in the offline/connecting/error empty state lose the status indicator and its onOpenEnvironments action. Consider rendering an inline WorkspaceConnectionStatus (the sidebar variant) in the empty-state branch when shouldShowConnectionStatus is true on iOS, mirroring the threaded-list path.

      No longer relevant as of e6c123e96c2cf7df3654605727e628b891fdfc75

    13. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium threads/ThreadComposer.tsx:208

      ComposerConnectionStatusPill renders as a pressable that calls props.onPress for every status kind, including the new "syncing" state. In ThreadComposer, onPress is wired to onReconnectEnvironment, so tapping the pill during normal message loading/syncing triggers retryEnvironment and interrupts the in-progress sync instead of acting as a passive progress indicator. Consider rendering the pill as a non-interactive View (or disabling the Pressable) when status.kind === "syncing".

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/threads/ThreadComposer.tsx around line 208:
      
      `ComposerConnectionStatusPill` renders as a pressable that calls `props.onPress` for every status kind, including the new `"syncing"` state. In `ThreadComposer`, `onPress` is wired to `onReconnectEnvironment`, so tapping the pill during normal message loading/syncing triggers `retryEnvironment` and interrupts the in-progress sync instead of acting as a passive progress indicator. Consider rendering the pill as a non-interactive `View` (or disabling the `Pressable`) when `status.kind === "syncing"`.
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High threads/ThreadRouteScreen.tsx:165

      ThreadRouteScreen gates ThreadUnavailableScreen only on connection hydration (workspaceState.isLoadingConnections or connecting/reconnecting) but not on the thread-detail query status. When the route's thread hasn't yet appeared in the shell snapshot, useThreadSelection() returns selectedThread === null during its initial load, so the guard selectedThread !== null && selectedThreadKey === routeThreadKey fails and execution falls through to ThreadUnavailableScreen even though the thread exists and is still loading. Include the thread-detail fetch status in stillHydrating (or check it before rendering the unavailable state) so the screen shows OpeningThreadLoadingScreen until the thread detail query resolves.

      No longer relevant as of 319117c2d9367903c18a779180c81b4ec62b81fb

      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High src/Stack.tsx:127

      When SettingsEnvironmentNew is opened as the initial route of the nested SettingsSheetStack via navigation.navigate("SettingsSheet", { screen: "SettingsEnvironmentNew" }), ConnectionsNewRouteScreen cannot go back, so it calls navigation.dispatch(StackActions.replace("Home")) after a successful pairing. But Home is not a route in SettingsSheetStack, so React Navigation ignores the unhandled replace action and the screen stays visible — the sheet never dismisses. Consider navigating back up to the parent stack (e.g. via the parent navigator) or including a route the nested stack can actually resolve.

      Also found in 2 other location(s)

      apps/mobile/src/features/threads/git/GitConfirmSheet.tsx:58

      Using navigation.dispatch(StackActions.replace(&#34;Thread&#34;, { environmentId, threadId })) here does not dismiss the GitConfirm sheet back to the existing thread screen; React Navigation&#39;s replace only swaps the current top route. From a stack like [Thread, GitConfirm] this produces [Thread, Thread], so after confirming an action the app leaves a duplicate Thread entry on the stack. On Android, pressing Back now returns to the same thread again instead of the previous screen, and repeated confirmations keep growing duplicate thread routes.

      apps/mobile/src/features/projects/AddProjectScreen.tsx:277

      EmptyEnvironmentState now dispatches StackActions.replace(&#34;ConnectionsNew&#34;) from inside the nested NewTaskSheet stack. replace targets the route identified by the dispatching screen&#39;s source key, and this child-stack route key doesn&#39;t exist in the parent/root stack where ConnectionsNew is registered. As a result, the action is not handled, so tapping Add environment from the add-project flow leaves the user stuck instead of opening the connections screen.

      No longer relevant as of 9af886774f9073485e10532944f4e2196740dc44

    14. @@ -0,0 +65,21 @@
      65+ )
      66+ emitVisibleFile(first)
      67+ }
      68+
      69+ addView(
      70+ canvasView,
      71+ LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT),
      72+ )
      73+ }
      74+
      75+ fun setTokensResetKey(value: String) {
      76+ if (tokensResetKey == value) return
      77+ tokensResetKey = value
      78+ canvasView.tokensByRowId = emptyMap()
      79+ }
      80+
      81+ fun setContentResetKey(value: String) {
      82+ if (contentResetKey == value) return
      83+ contentResetKey = value
      84+ tokensDecodeGeneration += 1
      85+ canvasView.tokensByRowId = emptyMap()
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3reviewdiff/T3ReviewDiffView.kt:81

      setContentResetKey clears tokens and scroll position but never clears rows, visibleRows, or canvasView.rows. Since new rowsJson is decoded asynchronously on a background thread, the previous file's rows remain rendered and tappable until the new rows finish decoding and are posted back. Users can see and interact with the wrong file's lines and comments after navigating to a different file. Consider clearing the rows in setContentResetKey so the view is blanked immediately while the new payload is in flight.

        fun setContentResetKey(value: String) {
          if (contentResetKey == value) return
          contentResetKey = value
      -    tokensDecodeGeneration += 1
      -    canvasView.tokensByRowId = emptyMap()
      +    rowsDecodeGeneration += 1
      +    rows = emptyList()
      +    visibleRows = emptyList()
      +    canvasView.rows = emptyList()
      +    canvasView.tokensByRowId = emptyMap()
          lastVisibleFileId = null
      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt around lines 81-85:
      
      `setContentResetKey` clears tokens and scroll position but never clears `rows`, `visibleRows`, or `canvasView.rows`. Since new `rowsJson` is decoded asynchronously on a background thread, the previous file's rows remain rendered and tappable until the new rows finish decoding and are posted back. Users can see and interact with the wrong file's lines and comments after navigating to a different file. Consider clearing the rows in `setContentResetKey` so the view is blanked immediately while the new payload is in flight.
      @@ -152,20 +200 @@
      152- scrollView.setOnClickListener { requestKeyboardFocus() }
      153- container.setOnClickListener { requestKeyboardFocus() }
      154- isClickable = true
      155- setOnClickListener { requestKeyboardFocus() }
      156-
      157- scrollView.addView(
      158- textView,
      159- LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT),
      160- )
      161- container.addView(
      162- scrollView,
      163- LinearLayout.LayoutParams(
      164- ViewGroup.LayoutParams.MATCH_PARENT,
      165- 0,
      166- 1f,
      167- ),
      168- )
      169- container.addView(
      170- inputView,
      171- LinearLayout.LayoutParams(1, 1),
      200+ inputView.addTextChangedListener(
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High t3terminal/T3TerminalView.kt:200

      TextWatcher.onTextChanged only forwards the inserted substring (s.subSequence(start, end)) and then clears the EditText in afterTextChanged. For replacement edits where before > 0 and count > 0—such as IME autocorrect replacing teh with the—Android reports only the replacement text, so this code emits the without first emitting a backspace to delete the previously sent teh. The terminal receives duplicated or mangled input instead of the final committed string.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt around line 200:
      
      `TextWatcher.onTextChanged` only forwards the inserted substring (`s.subSequence(start, end)`) and then clears the `EditText` in `afterTextChanged`. For replacement edits where `before > 0` and `count > 0`—such as IME autocorrect replacing `teh` with `the`—Android reports only the replacement text, so this code emits `the` without first emitting a backspace to delete the previously sent `teh`. The terminal receives duplicated or mangled input instead of the final committed string.
    15. @@ -139,16 +140,9 @@
      139140 options={{
      141+ // Android renders its own in-screen header below instead of the native bar.
      142+ ...(Platform.OS === "android" ? { headerShown: false } : null),
      140143 title: showScanner ? "Scan QR Code" : "Add Environment",
      141144 }}
      142145 />
      143- <NativeHeaderToolbar placement="right">
      144- <NativeHeaderToolbar.Button
      145- icon={showScanner ? "xmark" : "qrcode.viewfinder"}
      146- onPress={() => {
      147- if (showScanner) {
      148- closeScanner();
      149- } else {
      150- void openScanner();
      151- }
      152- }}
      153- separateBackground
      154- tintColor={headerIconColor}
      146+ {Platform.OS === "android" ? (
      147+ <AndroidScreenHeader
      148+ title={showScanner ? "Scan QR Code" : "Add Environment"}
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High connection/ConnectionsNewRouteScreen.tsx:149

      The Android back button in AndroidScreenHeader calls navigation.goBack() unconditionally, but goBack() is a no-op when this screen is the initial route (e.g. opened directly via the connections/new deep link) because there is no screen to go back to. The handleSubmit path at line 127 already guards against this with a canGoBack() fallback that dispatches StackActions.replace("Home"). The Android back button lacks that same fallback, leaving the user stranded. Consider applying the same canGoBack() / replace("Home") fallback to the onBack handler.

      -          onBack={() => navigation.goBack()}
      +          onBack={() => {
      +            if (navigation.canGoBack()) {
      +              navigation.goBack();
      +            } else {
      +              navigation.dispatch(StackActions.replace("Home"));
      +            }
      +          }}
      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx around line 149:
      
      The Android back button in `AndroidScreenHeader` calls `navigation.goBack()` unconditionally, but `goBack()` is a no-op when this screen is the initial route (e.g. opened directly via the `connections/new` deep link) because there is no screen to go back to. The `handleSubmit` path at line 127 already guards against this with a `canGoBack()` fallback that dispatches `StackActions.replace("Home")`. The Android back button lacks that same fallback, leaving the user stranded. Consider applying the same `canGoBack()` / `replace("Home")` fallback to the `onBack` handler.
    16. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium t3terminal/TerminalFrame.kt:44

      TerminalFrame.decode computes cellCount = cols * rows from two unsigned 16-bit values with no overflow or bound check. Malformed snapshot data (e.g. 65535 x 65535) makes the multiplication wrap to a negative Int, so IntArray(cellCount) throws IllegalArgumentException instead of returning null. A bad native snapshot therefore crashes the Android view path via renderSnapshot().

            val cellCount = cols.toLong() * rows.toLong()
            if (cellCount <= 0 || cellCount > 200_000L) return null
            val cellCountInt = cellCount.toInt()
      Also found in 1 other location(s)

      apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt:305

      renderSnapshot() drops invalid/empty snapshots silently. The JNI nativeSnapshot() implementation returns an empty ByteArray when ghostty_render_state_update or ghostty_render_state_colors_get fails, and TerminalFrame.decode(...) then returns null. Because this method only updates the canvas inside ?.let(...), the old TerminalFrame stays on screen after a failed snapshot, so scroll/resize/theme/input operations can leave stale terminal contents rendered with no indication that the snapshot refresh failed.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalFrame.kt around line 44:
      
      `TerminalFrame.decode` computes `cellCount = cols * rows` from two unsigned 16-bit values with no overflow or bound check. Malformed snapshot data (e.g. `65535 x 65535`) makes the multiplication wrap to a negative `Int`, so `IntArray(cellCount)` throws `IllegalArgumentException` instead of returning `null`. A bad native snapshot therefore crashes the Android view path via `renderSnapshot()`.
      
      Also found in 1 other location(s):
      - apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt:305 -- `renderSnapshot()` drops invalid/empty snapshots silently. The JNI `nativeSnapshot()` implementation returns an empty `ByteArray` when `ghostty_render_state_update` or `ghostty_render_state_colors_get` fails, and `TerminalFrame.decode(...)` then returns `null`. Because this method only updates the canvas inside `?.let(...)`, the old `TerminalFrame` stays on screen after a failed snapshot, so scroll/resize/theme/input operations can leave stale terminal contents rendered with no indication that the snapshot refresh failed.
      
    17. Hey, I've been impatient and working on my own implementation of t3 mobile for Android (fork: https://github.com/nnNyx/t3code). I know you don't take contributions, but since some of this is already drafted I'm still leaving a puny comment here in case ANY of this is useful to you. Everything below was tested through ADB on a Pixel 7 running GrapheneOS, which is my daily phone.

      Small heads-up first: I ported this PR's review-diff Android module into the fork (attribution kept in the file headers) and it works fine on that same hardware.

      Stuff I encountered along the way:

      • Android release builds are broken on main outside EAS (nnNyx/t3code@bad31116). @react-native/gradle-plugin pins foojay-resolver-convention 0.5.0, which classloads JvmVendorSpec.IBM_SEMERU, removed in Gradle 9. It only fires when toolchain auto-provisioning actually runs, which is why EAS images with the exact JDK preinstalled never see it. Forcing 1.0.0 fixes it. On top of that, the repo's react-native-screens patch adds the iOS-26 header props to the shared codegen spec with no Android impls, so :react-native-screens:compileReleaseKotlin fails on the generated manager interface. No-op Kotlin stubs in the same patch fix it.

      • Cold-start deep links make Android back-swipe quit the app (nnNyx/t3code@e3d72f58). navigationPathConfig is built in Stack.tsx but never passed to the container, so appLinking only ships prefixes. Any deep-link entry synthesizes a single-screen stack and back finishes the activity. Wiring the config with initialRouteName: "Home" fixes the cause. #3687's "Home button for routes without history" looks like a workaround for this same symptom.

      • userInterfaceStyle: "automatic" never works on Android. expo-system-ui is missing from apps/mobile deps (prebuild even warns about it), so the app can't follow system dark mode.

      • Markdown tables render as white cards in dark mode (nnNyx/t3code@59916b95). nitro-markdown's table container falls back to theme.colors.surface, merged default #ffffff, and no consumer overrides it (image placeholders have the same bug). Patching trap that cost me three build cycles: the package's exports map resolves to the prebuilt lib/module/, so patching src/ does nothing. Patch the built output.

      Also sitting in the fork if any of it helps this PR's remaining scope: unstable_headerToolbarItems/RightItems are iOS-only so toolbar consumers silently render nothing on Android (I map them to real views + @react-native-menu trees, different approach from your AndroidScreenHeader), a custom Material 3 menu (PopupMenu is unstyleable from JS), the ~240dp iOS large-title inset dead zone on the Android home list, Material You dynamic color, and composer dictation. MIT, lift anything, no attribution needed.

      If it's preferable, I can also file any of these as separate issues.

    18. BeforeAfter
    19. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      There are 12 total unresolved issues (including 11 from previous reviews).

      Autofix Details

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: CRLF trim leaves carriage return
        • Changed the trailing-newline trim regex from /\n$/ to /\r?\n$/ so CRLF-terminated code block content no longer keeps a stray carriage return in copied, highlighted, or rendered text.

      Create PR

      Or push these changes by commenting:

      @cursor push 3618361cdc
      Preview (pingdotgg/t3code@3618361cdc)
      diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx
      --- a/apps/mobile/src/features/threads/ThreadFeed.tsx
      +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx
      @@ -277,7 +277,7 @@
         readonly textColor: string;
         readonly theme: ReviewDiffTheme;
       }) {
      -  const content = props.content.replace(/\n$/, "");
      +  const content = props.content.replace(/\r?\n$/, "");
         const languageLabel = props.language?.trim() || "text";
         const highlighted = useMarkdownCodeHighlight({
           code: content,
      You can send follow-ups to the cloud agent here.
    20. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      There are 13 total unresolved issues (including 12 from previous reviews).

      Autofix Details

      Bugbot Autofix prepared a fix for the issue found in the latest run.

      • ✅ Fixed: New task collapsed toolbar mismatch
        • Added a collapsed Android toolbar branch in NewTaskDraftScreen that mirrors ThreadComposer's three-control row (attachment, model, configuration) without the scroller, keeping the full pill scroller only when expanded.

      Create PR

      Or push these changes by commenting:

      @cursor push 8324c7bbb1
      Preview (pingdotgg/t3code@8324c7bbb1)
      diff --git a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
      --- a/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
      +++ b/apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
      @@ -626,15 +626,57 @@
                     ) : null}
                   </ComposerSurface>
       
      -            <ComposerToolbarRow paddingBottom={8} paddingHorizontal={0} paddingTop={8}>
      -              <ComposerToolbarScroller
      -                fadeOpaque={isDarkMode ? "rgba(0,0,0,0.95)" : "rgba(255,255,255,0.95)"}
      -                fadeTransparent={isDarkMode ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)"}
      -              >
      -                {toolbarPills}
      -              </ComposerToolbarScroller>
      -              {isExpanded ? startButton : null}
      -            </ComposerToolbarRow>
      +            {!isExpanded ? (
      +              // Collapsed Android toolbar mirrors ThreadComposer: exactly three
      +              // controls, no scroller, with the two selector pills flexing to
      +              // fill the row.
      +              <ComposerToolbarRow paddingBottom={8} paddingHorizontal={0} paddingTop={8}>
      +                <ComposerToolbarButton
      +                  accessibilityLabel="Add attachment"
      +                  icon="plus"
      +                  onPress={() => void handlePickImages()}
      +                  showChevron={false}
      +                />
      +                <ControlPillMenu
      +                  style={{ flex: 1, minWidth: 0 }}
      +                  actions={modelMenuActions}
      +                  onPressAction={({ nativeEvent }) => handleModelMenuAction(nativeEvent.event)}
      +                >
      +                  <ComposerToolbarTrigger
      +                    accessibilityLabel="Model"
      +                    iconNode={
      +                      <ProviderIcon provider={flow.selectedModelOption?.providerDriver} size={16} />
      +                    }
      +                    label={flow.selectedModelOption?.label ?? "Model"}
      +                    style={{ maxWidth: "100%", width: "100%" }}
      +                  />
      +                </ControlPillMenu>
      +                <ControlPillMenu
      +                  // The reasoning/config label runs longer than most model names,
      +                  // so it gets a larger share of the row.
      +                  style={{ flex: 1.4, minWidth: 0 }}
      +                  actions={optionsMenuActions}
      +                  onPressAction={({ nativeEvent }) => handleOptionsMenuAction(nativeEvent.event)}
      +                >
      +                  <ComposerToolbarTrigger
      +                    accessibilityLabel="Configuration"
      +                    icon="slider.horizontal.3"
      +                    label={configurationLabel}
      +                    style={{ maxWidth: "100%", width: "100%" }}
      +                  />
      +                </ControlPillMenu>
      +              </ComposerToolbarRow>
      +            ) : (
      +              <ComposerToolbarRow paddingBottom={8} paddingHorizontal={0} paddingTop={8}>
      +                <ComposerToolbarScroller
      +                  fadeOpaque={isDarkMode ? "rgba(0,0,0,0.95)" : "rgba(255,255,255,0.95)"}
      +                  fadeTransparent={isDarkMode ? "rgba(0,0,0,0)" : "rgba(255,255,255,0)"}
      +                >
      +                  {toolbarPills}
      +                </ComposerToolbarScroller>
      +                {startButton}
      +              </ComposerToolbarRow>
      +            )}
                 </View>
               </KeyboardAvoidingView>
             </View>
      You can send follow-ups to the cloud agent here.

Sign in to join this conversation.