GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [codex] Add Android mobile support by juliusmarminge · Pull Request #3579 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 27, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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 for commit 80cf687. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Prosta4okua reacted with thumbs up emoji Prosta4okua reacted with heart emoji Prosta4okua reacted with eyes emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction
  • 👀 1 reaction
@coderabbitai

coderabbitai Bot commented Jun 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Jun 27, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Jun 27, 2026
View reviewed changes
Comment thread apps/mobile/src/app/new/index.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/diffs/nativeReviewDiffSurface.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/components/AppSymbol.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/threads/ThreadComposer.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift
Comment on lines +394 to +399
public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
// A direct gesture takes ownership from any interrupted programmatic jump.
// Resume visible-file events immediately so the inspector follows the finger.
isProgrammaticScrollActive = false
contentView.isVerticalScrollActive = true
}

@macroscopeapp macroscopeapp Bot Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
// A direct gesture takes ownership from any interrupted programmatic jump.
// Resume visible-file events immediately so the inspector follows the finger.
isProgrammaticScrollActive = false
contentView.isVerticalScrollActive = true
}
public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
// A direct gesture takes ownership from any interrupted programmatic jump.
// Resume visible-file events immediately so the inspector follows the finger.
isProgrammaticScrollActive = false
pendingScrollFileId = nil
pendingScrollAnimated = false
contentView.isVerticalScrollActive = true
}
🚀 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/modules/t3-review-diff/ios/T3ReviewDiffView.swift Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/plugins/withIosSceneLifecycle.cjs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/review/ReviewCommentComposerSheet.tsx
Comment on lines -174 to +171
paddingTop: 8,
paddingBottom: target ? 0 : Math.max(insets.bottom, 18),
paddingTop: isAndroid ? insets.top + 8 : 8,
paddingBottom: target ? (isAndroid ? 72 : 0) : Math.max(insets.bottom, 18),

@macroscopeapp macroscopeapp Bot Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juliusmarminge
juliusmarminge force-pushed the android-dev-pr-3514 branch from 927d43b to 212ac28 Compare June 27, 2026 06:46
@juliusmarminge
juliusmarminge changed the base branch from main to t3code/ipad-responsive-mobile-layout June 27, 2026 06:46
macroscopeapp[bot]
macroscopeapp Bot reviewed Jun 27, 2026
View reviewed changes
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/threads/ThreadNavigationDrawer.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalCanvasView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/home/HomeScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalCanvasView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...omposer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorModule.kt
view.setSpellCheck(spellCheck)
}

Events(

@macroscopeapp macroscopeapp Bot Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt
backgroundColorValue,
cursorColorValue,
paletteColors,
)

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Jun 27, 2026
View reviewed changes
Comment thread apps/mobile/modules/t3-terminal/README.md
```

The script downloads Zig 0.15.2 when needed, checks out the pinned upstream Ghostty revision, and
rebuilds all four Android ABIs with 16 KB page-size support.

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...omposer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorModule.kt
Prop("editable") { view: T3ComposerEditorView, editable: Boolean ->
view.setEditable(editable)
}
Prop("scrollEnabled") { view: T3ComposerEditorView, scrollEnabled: Boolean ->

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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'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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/src/features/threads/ThreadRouteScreen.tsx Outdated
</>
)}

<GitActionProgressOverlay progress={gitActionProgress} onDismiss={dismissGitActionResult} />

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/review/ReviewSheet.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/threads/ThreadNavigationSidebar.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/app/connections/new.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge mentioned this pull request Jun 27, 2026
[codex] Fix mobile device builds and Android UI #3575
Closed
2 of 4 tasks
@juliusmarminge
juliusmarminge marked this pull request as ready for review June 27, 2026 14:30
cursor[bot]
cursor Bot reviewed Jun 27, 2026
View reviewed changes

ghost left a comment •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/app.config.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
canvasView.setVerticalOffset(0)
canvasView.setHorizontalOffset(0)
applyPendingInitialScroll()
}

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
  • apps/mobile/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt#L138-L150
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 276b453. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
if (fileId == lastVisibleFileId) return
lastVisibleFileId = fileId
onVisibleFileChange(mapOf("fileId" to fileId))
}

ghost Jun 27, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 276b453. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

ghost commented Jun 27, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HorusGoul HorusGoul mentioned this pull request Jun 28, 2026
fix(mobile): align Android terminal for 16KB pages #3595
Merged
4 tasks done
@bmdavis419 bmdavis419 mentioned this pull request Jul 2, 2026
fix(mobile): push gating and personal-team hardening for Android PR #3643
Merged
@juliusmarminge
juliusmarminge force-pushed the t3code/ipad-responsive-mobile-layout branch from 770c781 to 9f54b06 Compare July 3, 2026 04:19
Base automatically changed from t3code/ipad-responsive-mobile-layout to main July 3, 2026 05:42
@juliusmarminge
juliusmarminge force-pushed the android-dev-pr-3514 branch 2 times, most recently from 1053338 to 2ae9365 Compare July 3, 2026 06:13
cursor[bot]
cursor Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
}
} catch (_: Exception) {
}
}

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 2ae9365. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
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
}

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 2ae9365. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt
if (imageUris.isNotEmpty()) {
pasteImagesListener?.invoke(imageUris)
return true
}

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 2ae9365. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffModule.kt
"onToggleViewedFile",
"onPressLine",
"onToggleComment",
)

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 2ae9365. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/layout/workspace-sidebar-toolbar.tsx
const { layout, panes, togglePrimarySidebar } = useAdaptiveWorkspaceLayout();

if (!layout.usesSplitView) {
if (Platform.OS === "android" || !layout.usesSplitView) {

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
if (Platform.OS === "android" || !layout.usesSplitView) {
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/"More" 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/modules/t3-terminal/android/src/main/cpp/t3_terminal_jni.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...bile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalCanvasView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 3, 2026
View reviewed changes

ghost left a comment •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt

fun horizontalOffset(): Int = horizontalOffset

fun maxHorizontalOffset(): Int = max(0, contentWidthPx - width)

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for commit 2b34778. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cursor

ghost commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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 (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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread apps/mobile/src/features/archive/ArchivedThreadsScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/home/HomeHeader.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/home/HomeScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread apps/mobile/src/features/threads/ThreadComposer.tsx

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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"`.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/src/features/threads/ThreadRouteScreen.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/Stack.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-composer-editor/android/src/main/java/expo/modules/t3composereditor/T3ComposerEditorView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt
Comment on lines +81 to +85
fun setContentResetKey(value: String) {
if (contentResetKey == value) return
contentResetKey = value
tokensDecodeGeneration += 1
canvasView.tokensByRowId = emptyMap()

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...e/modules/t3-review-diff/android/src/main/java/expo/modules/t3reviewdiff/T3ReviewDiffView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt
container.addView(
inputView,
LinearLayout.LayoutParams(1, 1),
inputView.addTextChangedListener(

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread apps/mobile/src/features/connection/ConnectionsNewRouteScreen.tsx
Comment on lines +149 to +148
{Platform.OS === "android" ? (
<AndroidScreenHeader
title={showScanner ? "Scan QR Code" : "Add Environment"}
onBack={() => navigation.goBack()}

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 3, 2026
View reviewed changes
Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/T3TerminalView.kt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/modules/t3-terminal/android/src/main/java/expo/modules/t3terminal/TerminalFrame.kt
Comment on lines +44 to +45
val foreground = buffer.int
val background = buffer.int
val cursorColor = buffer.int
val cellCount = cols * rows

ghost Jul 3, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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().

Suggested change
val cellCount = cols * rows
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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cursor[bot]
cursor Bot reviewed Jul 9, 2026
View reviewed changes
Comment thread apps/mobile/src/features/shortcuts/useAppShortcuts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/shortcuts/useAppShortcuts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/shortcuts/useAppShortcuts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/shortcuts/appShortcuts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/mobile/src/features/shortcuts/appShortcuts.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 9, 2026
View reviewed changes
Comment thread apps/mobile/src/Stack.tsx
// Presents the T3 Connect onboarding sheet after an in-session sign-in.
useConnectOnboardingNavigation();
// Launcher app shortcuts: routes shortcut taps and tracks opened threads.
useAppShortcuts(props.state);

ghost Jul 9, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High src/Stack.tsx:269

useAppShortcuts can crash the root layout on a malformed thread deep link. If a shortcut, notification, or external link resolves to the Thread route with invalid environmentId or threadId params, EnvironmentId.make() / ThreadId.make() inside the hook throw during render, bringing down the entire navigation tree instead of ignoring the bad link. The same constructors are wrapped in try/catch elsewhere (e.g. AdaptiveWorkspaceLayout), so guard the route-param parsing inside useAppShortcuts the same way.

Also found in 1 other location(s)

apps/mobile/src/features/shortcuts/appShortcuts.ts:32

shortcutHref only checks whether action.params?.href starts with /, so any persisted shortcut carrying an arbitrary in-app path like /settings or an obsolete route is treated as valid. useShortcutNavigation then passes that value straight to linkTo, which makes the app navigate on stale/foreign shortcuts even though this helper's contract says those must be rejected.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/src/Stack.tsx around line 269:

`useAppShortcuts` can crash the root layout on a malformed thread deep link. If a shortcut, notification, or external link resolves to the `Thread` route with invalid `environmentId` or `threadId` params, `EnvironmentId.make()` / `ThreadId.make()` inside the hook throw during render, bringing down the entire navigation tree instead of ignoring the bad link. The same constructors are wrapped in `try/catch` elsewhere (e.g. `AdaptiveWorkspaceLayout`), so guard the route-param parsing inside `useAppShortcuts` the same way.

Also found in 1 other location(s):
- apps/mobile/src/features/shortcuts/appShortcuts.ts:32 -- `shortcutHref` only checks whether `action.params?.href` starts with `/`, so any persisted shortcut carrying an arbitrary in-app path like `/settings` or an obsolete route is treated as valid. `useShortcutNavigation` then passes that value straight to `linkTo`, which makes the app navigate on stale/foreign shortcuts even though this helper's contract says those must be rejected.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Shivam Sharma and others added 2 commits July 10, 2026 08:13
Shivam Sharma Claude Fable 5
fix(mobile): harden launcher shortcut routing and persistence
3422d9b
Addresses the review-bot findings on the shortcuts module:

- activeThreadRef (moved to the pure module) no longer trusts route
  params: trims, type-guards, and catches the branded id constructors'
  schema throws, returning null for malformed input. It runs during
  render of the root stack layout, so a crafted deep link like
  t3code-dev://threads/%20/x previously threw and took down the whole
  navigation tree.
- A failed recents load no longer erases history: the empty in-memory
  fallback still syncs the launcher, but storage writes are gated until
  a successful load or a real thread open. Saves are also chained so an
  older write cannot land after (and overwrite) a newer one.
- shortcutHref allowlists exactly /new and /threads/<seg>/<seg> instead
  of accepting any path-shaped string from launcher-persisted actions.
- Launcher ids reuse the URI-encoded href, so distinct env/thread pairs
  can no longer collide on a plain '-' join.

Co-Authored-By: Claude Fable 5 <[email protected]>
Shivam Sharma Claude Fable 5
fix(mobile): step anchored-menu back through submenus
57e6060
Hardware/gesture back inside a drilled-in submenu now pops one level
(matching the tappable parent-title header) instead of dismissing the
whole menu; a further back at the top level still closes it.

Co-Authored-By: Claude Fable 5 <[email protected]>
@PixPMusic PixPMusic mentioned this pull request Jul 10, 2026
feat(mobile): support orchestration V2 on Android #3870
Closed
Alex Julius Marminge
Julius Marminge codex
feat(mobile): Android terminal improvements — input, selection, sessi…
80cf687
…ons, Nerd Font (#3775)

Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: codex <[email protected]>
cursor[bot]
cursor Bot reviewed Jul 12, 2026
View reviewed changes

ghost left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 80cf687. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx
if (result._tag === "Failure" && reopenedStaleTerminalKeyRef.current === terminalKey) {
reopenedStaleTerminalKeyRef.current = null;
}
});

ghost Jul 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate terminal open on launch

Medium Severity

The new useEffect designed to re-open stale or exited terminals can issue an openTerminal RPC concurrently with an existing pending terminal launch for the same session, leading to redundant openTerminal requests.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 80cf687. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/mobile/src/features/terminal/ThreadTerminalRouteScreen.tsx
const sessionEnded = terminal.status === "exited" || terminal.status === "closed";
if (!sessionEnded || runningTerminalKeyRef.current !== terminalKey) {
return;
}

ghost Jul 12, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exit missed after attach detach

Medium Severity

When terminalAttachInput becomes null (for example during a brief disconnect), the exit handler clears runningTerminalKeyRef but still requires that ref to match before treating exit/closed as a session the user ended on this screen. If the shell exits while attach is detached, reattach can show an exited session without navigating away, and the stale-reopen effect may spawn a new shell instead of mirroring the web drawer exit flow.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 80cf687. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@juliusmarminge
juliusmarminge merged commit c1ec191 into main Jul 12, 2026
@juliusmarminge
juliusmarminge deleted the android-dev-pr-3514 branch July 12, 2026 10:03
mrpunyetaz-cloud
mrpunyetaz-cloud reviewed Jul 12, 2026
View reviewed changes

ghost left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to solve this before merged

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DanielGGordon DanielGGordon mentioned this pull request Jul 12, 2026
Pull select upstream fixes (worktree branch-sync, alert layout, marketing) + divergence log DanielGGordon/t3code#23
Merged
@QuinRiva QuinRiva mentioned this pull request Jul 13, 2026
Upstream cadence pull v0.0.29-nightly.20260712.791 (3 commits) QuinRiva/loom#80
Merged
@wizzoapp wizzoapp Bot mentioned this pull request Jul 13, 2026
chore: sync upstream pingdotgg/t3code agriffiths-bots/t3code#179
Merged
This was referenced Jul 28, 2026
prepare stable release 2026.7.2800+tarik02 tarik02-org/t3code#56
Merged
prepare stable release 2026.7.2900+tarik02 tarik02-org/t3code#84
Merged
@sideeffffect sideeffffect mentioned this pull request Aug 7, 2026
fix(mobile): add long-press unarchive menu to archived thread rows #5640
Closed
This was referenced Sep 20, 2026
[Bug]: Android: terminal input triggers password-manager autofill (Bitwarden) and shows incognito keyboard icon #12755
Closed
[Bug][Mobile] Android code block copy button is missing its icon #13376
Closed
@danddanddand danddanddand mentioned this pull request Oct 18, 2026
fix(mobile): allow copying iOS terminal output #15478
Closed
@only21mil only21mil mentioned this pull request Oct 25, 2026
fix(mobile): hardware Enter keeps the Android terminal focused #24928
Merged
@juliusmarminge juliusmarminge mentioned this pull request Nov 16, 2026
fix(mobile): Android terminal opens the default keyboard, not a password one #37450
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@shivamhwp shivamhwp shivamhwp left review comments
@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments
+1 more reviewer
@mrpunyetaz-cloud mrpunyetaz-cloud mrpunyetaz-cloud left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@juliusmarminge @eyeveil @maria-rcks @PixPMusic @shivamhwp @mrpunyetaz-cloud @HorusGoul @bmdavis419
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.