Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): wrap Android source files when Word break is on #6647

Closedsiure(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/6647/headopened View on GitHub

What Changed

On Android, Word break now uses the JS source renderer instead of the native canvas. Long lines sit in a min-w-0 flex-1 view so they wrap instead of clipping.

Why

Enabling Word break still clipped long source lines at the viewport.

The JS renderer already wraps, but Android always used the native canvas when it was available, and that canvas cannot wrap. Switching to JS was not enough: flex-1 on Text still clips on Android. Wrapping the line in a min-w-0 flex-1 view matches the Appearance preview, which already wrapped correctly.

UI Changes

Before the changes https://github.com/user-attachments/assets/acd9128e-f972-48a8-a773-985119fc44fe

After Screenshot_20260815_000650_T3 Code Preview

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • [ x] I included a video for animation/interaction changes

Note

Low Risk Mobile UI-only changes to source file rendering and scrolling; no auth, data, or API impact.

Overview Word break on Android now routes SourceFileSurface through the JS FlatList renderer instead of the native canvas, because the native surface cannot wrap long lines.

Line layout in HighlightedSourceLine wraps code in a container View (min-w-0 flex-1 when word break is on, fixed minWidth when off) with items-start, so wrapped text no longer clips the way flex-1 on Text did on Android.

The JS path also gains optional pull-to-refresh via RefreshControl when onRefresh is passed, and scroll-to-line retries up to five times using scrollToOffset when scrollToIndex fails (e.g. before layout).

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

Note

Fix Android source file wrapping when Word Break is enabled

  • When codeWordBreak is enabled, SourceFileSurface now always uses the JavaScript-based renderer instead of the native implementation.
  • HighlightedSourceLine wraps line content in a container View with items-start alignment; width is controlled conditionally (min-w-0 flex-1 with word break, fixed minWidth: 320 without).
  • JavaScriptSourceFileSurface adds pull-to-refresh support via an optional onRefresh prop and a RefreshControl.
  • Scroll-to-line reliability is improved: when scrollToIndex fails, the component falls back to scrollToOffset and retries up to 5 times.
Macroscope summarized ac8dae9.
    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: 0e3237df-ff66-48ed-898f-300d425d9e93

      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). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ef704e46f2947471953a71ad45548f17faf19d7d. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces new functionality (pull-to-refresh, scroll retry logic) beyond the stated word-wrap fix, and changes which rendering implementation is used based on the codeWordBreak setting. The author is not a frequent contributor to this file.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Word-break on Android was a flex-row NativeText with minWidth: 320, so wrap never happened. Inner min-w-0 flex-1 plus skipping the native review view when wrap is on is the real fix.

      The same file also adds pull-to-refresh and onScrollToIndexFailed retry. Those are fine, but they are extra. No test. MERGEABLE. I did not open a file on a device.

    6. juliusmarminge closed this

    7. Closing as part of the open-PR backlog sweep (wave 1).

      Reason: Android word-break already uses the JS FlatList renderer Related: main SourceFileSurface

      Reopen if this is still wanted and you’re willing to rebase onto current main.

Sign in to join this conversation.