Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): fix stale iOS header actions, covered composer, and swallowed pastes #6607

Closedx1xhlol(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/6607/headopened View on GitHub

What Changed

  • ThreadRouteScreen now passes optionsVersion to NativeStackScreenOptions, keyed on the split/compact/center header item arrays, so the native header reapplies its options whenever the underlying items change.
  • The thread composer's KeyboardStickyView is now also enabled while the owned native editor reports focus (ownedInputFocused), instead of relying solely on the JS keyboard-visibility event.
  • The native iOS composer editor (T3ComposerEditorView.paste) now falls back to the system paste when pasteboard item providers claim images but fail to load any, instead of silently swallowing the paste.

Why

Three iOS reliability bugs with the same symptom class ("the app stops responding to me"):

  1. Right-top thread buttons go dead after actions. The stack header wrapper stabilizes option functions by identity and only calls navigation.setOptions when the options signature changes. ThreadRouteScreen builds its unstable_headerRightItems / unstable_headerCenterItems from state (git state, terminal sessions, pane layout, callbacks) but never passed optionsVersion, so the native header kept the first-applied item factories: stale disabled flags, stale menu items, and stale onPress callbacks. Tapping a button then either did nothing or ran an outdated action. Keying optionsVersion on the item arrays forces a reapply when they actually change.

  2. Keyboard covers the input bar. The sticky composer was enabled only when useKeyboardState().isVisible was true. If the keyboard-show event is missed or delayed (first responder restored on app relaunch, busy JS thread during streaming), the composer stayed anchored to the screen bottom underneath the open keyboard. Focus on the owned editor is a stronger local signal that the composer must track the keyboard, so it now enables the sticky view too.

  3. Paste stops working after switching apps (#5313). paste(_:) returned early whenever any pasteboard item provider said it could load a UIImage. After app switches, providers can claim image content and then fail to deliver it, so neither the image path nor super.paste ran and the paste was lost. Image loading now reports whether anything was persisted and falls back to the system paste when it wasn't.

UI Changes

No visual changes; these are interaction/reliability fixes. No simulator screenshots available for this change set — verification below is static.

Verification

  • tsc --noEmit in apps/mobile passes
  • Targeted lint (vp lint --report-unused-disable-directives) on both touched TSX files passes
  • node scripts/mobile-native-static-check.ts passes (SwiftLint/ktlint/detekt not installed in this environment, so skipped)
  • The Swift change is source-reviewed but not compiled here (no Xcode available); the drag-and-drop call site keeps its previous behavior via the optional completion parameter

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (no visual changes; no simulator available)
  • I included a video for animation/interaction changes (not applicable)

Note

Medium Risk Touches native iOS paste handling and keyboard/composer positioning logic; no auth or data paths, but regressions would affect core thread UX on iOS.

Overview Three interaction reliability fixes on mobile iOS where the app appeared to stop responding.

Native stack header — ThreadRouteScreen now passes optionsVersion keyed on the split/compact/center/right header item arrays so NativeStackScreenOptions re-applies when git state, terminal menus, pane layout, or callbacks change. Without it, stabilized header factories kept the first-applied disabled flags, menu contents, and onPress handlers.

Floating composer — KeyboardStickyView in ThreadDetailScreen enables when the owned native editor reports focus (focusBridgeActive), not only when JS isKeyboardVisible is true. A confirmed keyboard hide clears the bridge so a dismissed IME cannot leave a stale translation.

Composer paste — In ComposerTextView.paste, async image loading from pasteboard providers now reports success; if providers claim images but none load (stale cross-app pasteboard), it falls back to super.paste instead of returning early with no text.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit fb8da5e276cd68e2a9c9afa096f0c1f211eab082. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix stale iOS header actions, covered composer, and swallowed pastes on mobile

  • Fixes paste in ComposerTextView so that when clipboard item providers claim image support but fail to load, it falls back to super.paste(sender) instead of silently dropping the paste.
  • Fixes the floating composer in ThreadDetailScreen sticking to the keyboard when JS keyboard show events are missed, by tracking focus via a focusBridgeActive state alongside keyboard visibility.
  • Fixes frozen native header actions in ThreadRouteContent by passing an optionsVersion prop derived from header item sources, so the native header re-applies when items change.
Macroscope summarized fb8da5e.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

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

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: d75fcd0f-c303-4a12-9fe5-3462fa97b0e3

      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

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

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

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1e72da8a05d92a370efbcd3affbc2efe2b7be2d8. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. Approvability

      Verdict: Approved 74d69c7

      Straightforward bug fix addressing three iOS edge cases: stale header state (missing dependency array), composer positioning when keyboard events are missed (focus bridge fallback), and paste failures (system paste fallback). Limited scope with clear intent and defensive changes.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

      Current main routes stable native header factories through the latest callbacks, so the stale-header part no longer fits the current implementation. This PR also bundles separate keyboard-event bridging and pasteboard fallback changes. Those cases need current device reproductions and smaller patches before review, so we are keeping the reproduction and test ideas as references.

      If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

Sign in to join this conversation.