You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(mobile): iOS math that fails to parse wraps instead of cutting off - #44813
With Render math on, an inline formula that fails to parse is shown as its raw $…$ source. On both iOS and Android that source was drawn as one unbreakable piece, so a long formula ran past the edge of the message and its end was cut off. The fallback source is now inserted as ordinary text, so it wraps with the paragraph and stays fully readable.
iOS (enriched-markdown fork): ENRMMathInlineRenderer appends the attachment's new fallbackSource as text when RaTeX fails, instead of the ENRMMathInlineAttachment. The fallback still reports the LaTeX error and keeps its mathLatex accessibility label.
Android (enriched-markdown fork): MathInlineRenderer appends the fallback as text in the inline math colour, with a span that keeps TalkBack's math label, instead of the MathInlineSpan replacement span. It still reports the LaTeX error.
apps/mobile/deps: the tarball is rebuilt from the fork (b83a400e), with the lockfile and workspace entries updated.
Commit: origin/main 772f8d4. Server started fresh in a worktree with T3CODE_DEV_SEED=0 vp run dev:server --host 0.0.0.0; Metro with vp run dev:client. Dev client installed with vp run mobile:install ios (cached build) on a pooled iOS 27.2 'iPhone 18 Pro' simulator, paired with the test-t3-mobile pair-client script, and a scratch git project added with t3 project add. In the app: Settings → Appearance → Render math turned on. New thread in that project with Claude Haiku 5.5, prompt: 'Reply with exactly the following line and nothing else, copied verbatim, no code block: Pick the state $\hat{s} = \arg\max_{s \in M_t:,\dead(s)=0} b_t(s)$, then plan from it.' Observed: the assistant reply shows 'Pick the state', then the fallback $\hat{s} = \arg\max_{s \in M_t:\,\dead(s)=0} b_t(s) on its own line, cut off at the right screen edge (the trailing )$ is missing), then ', then plan from it.' on the next line. The user's own message bubble with the same formula is cut off the same way after \dead(s). Turning Render math off and reopening the thread: both messages wrap normally and show the whole ...b_t(s)$. A parseable formula wider than the column was not tested.
Evidence
On fresh isolated servers for each commit, seed the same synthetic user message, install each checkout's native dev client, pair, enable Render math, and expand the user message. iOS uses the original reported formula containing \dead(s). Android extends that same invalid formula with + b_{t-1}(s) + b_{t-2}(s) + b_{t-3}(s) so its fallback exceeds the column. Each platform uses identical input, viewport, font and theme on both commits.
Android: pooled Pixel 9 / API 36, DM Sans 16 pt, light theme. iOS: pooled iPhone 18 Pro / iOS 27.2, System 16 pt, light theme. Base visibly clips the source and hides its closing $; head wraps the complete source. Render math remained enabled on head. Captures were inspected and their content regions were identical across two screenshots taken more than 500ms apart. Status/header areas containing the private host label were cropped equally on both sides.
These captures prove expanded user-message fallback rendering. Assistant-message rendering and wide parseable formulas were not verified.
Not shown:
Assistant-message fallback rendering was not captured; the evaluated formula was in the expanded user message, which also exhibited the reported defect.
A parseable formula wider than the column was not tested.
vp run mobile:install android --prepare then --session on a pooled Pixel 9 (API 36): client built and installed; the issue's formula wraps and ends with b_t(s)$; $\pi r^2$ renders as math
iOS on an iPhone 18 Pro (iOS 27.2): main cut the fallback off after \dead(s); the branch wraps it and shows the whole source; $\pi r^2$ renders as math
vp run check:changed: format, knip, typecheck (44 packages) and test all passed
Not in this change
Fork commits 1419a1f5 (iOS) and b83a400e (Android) must be pushed to pingdotgg/enriched-markdown fork/t3-mobile before merge (patch linked in summary); the brief allowed pushing only to origin.
On macOS (not used by T3), renderForMacOS draws nothing for an unparseable inline formula; it has no fallback at all.
A parseable inline formula wider than the column is still one unbreakable attachment/span on both platforms; the issue did not test it, and fixing it would change how math looks.
On iOS, HTML copy of a message gives the fallback as plain text instead of a styled span, because the text no longer contains an attachment.
Who did the work
Written by Claude Opus 5.5, in Claude Code
Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Ported the same four native source changes onto the current 1.2.0-t3.20 fork and rebuilt the archive from f770272a. Comparing the old and rebuilt t3.20 archives shows only those four source files and the provenance record changed. vp run check:changed origin/main passed.
With Render math enabled, a synthetic Replay reply containing invalid math wrapped through the closing dollar sign and the following prose on both native development builds of 602d802c. Android exposed the math accessibility label in the device tree.
With Render math on, an inline formula RaTeX cannot parse fell back to its
$…$ source inside a single text attachment, which text layout cannot break,
so a source wider than the column was clipped at the screen edge. The
enriched-markdown fork now inserts that fallback as text, so it wraps with
the paragraph.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g off
Android drew the $…$ fallback of an inline formula RaTeX cannot parse
in one ReplacementSpan, which cannot wrap, so a long source ran past the
edge like it did on iOS. The enriched-markdown fork now inserts that
fallback as text on Android too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-actionsBot
added
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
size:S
10-29 changed lines (additions + deletions).
📱 Native Change
Changes the native fingerprint; merging blocks production OTAs until a new store build ships.
labels
Nov 28, 2026
pingdotgg/t3code#44780 — The issue concerns parse-failure fallback behavior for inline math. The supplied context indicates that the updated package changes this fallback to wrapping text, but does not implement the issue’s request to mark only the unknown command in place.
Suggested reviewers:2sincejuly, yash-singh1
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
[#44778] The issue requires that an inline formula that fails to parse wraps or scrolls on iOS when it is wider than the column. The PR description says the fix is in the vendored fork, not in this re…
Provide evidence that the tarball referenced in apps/mobile/package.json (react-native-enriched-markdown-1.2.0-t3.20-f770272a.tgz) contains the described fork changes. Acceptable evidence: the fork commit that produced f770272a, with the di…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title "fix(mobile): iOS math that fails to parse wraps instead of cutting off" describes the main change: the raw-source fallback for unparseable inline math on iOS now wraps as ordinary text inst…
Out of Scope Changes check
The reviewed changes since the previous head are limited to apps/mobile/package.json (react-native-enriched-markdown reference) and pnpm-workspace.yaml (allowBuilds entry for the same archive). Both c…
Description check
The description follows the repository template closely. It has a clear problem statement tied to the issue (Fixes #44778), a change section that explains the iOS and Android fixes, a …
Full details: Title check
Explanation
The title "fix(mobile): iOS math that fails to parse wraps instead of cutting off" describes the main change: the raw-source fallback for unparseable inline math on iOS now wraps as ordinary text instead of being clipped. The raw summary covers only the dependency pin bump to the new fork tarball, which is the vehicle for the change, so the title is related but describes the underlying fix rather than the manifest edit. The title is specific and conventional. The title omits Android, which the PR also changes, but that is an acceptable omission.
Full details: Out of Scope Changes check
Explanation
The reviewed changes since the previous head are limited to apps/mobile/package.json (react-native-enriched-markdown reference) and pnpm-workspace.yaml (allowBuilds entry for the same archive). Both change the vendored dependency that carries the issue fix, so they are in scope. pnpm-lock.yaml is excluded from review by ignored_files, so its lockfile changes are not assessed. The PR description also states that the fork rebuild and workspace entries are part of this change. No unrelated source change appears in the reviewed scope. The macOS fallback gap and the HTML copy change are documented in the PR description. They are consequences of the same fix, not unrelated work.
Full details: Description check
Explanation
The description follows the repository template closely. It has a clear problem statement tied to the issue (Fixes #44778), a change section that explains the iOS and Android fixes, a scope note linking the issue, and a detailed verification section with reproduction steps, before/after evidence, and test results. It also names the model and harness, as the template asks. Some items are out of scope for the template, such as store batch notes and the fork push requirement. Those do not make the description incomplete. The author also lists what was not verified (assistant-message fallback and wide parseable formulas), which is an accurate statement of the test gaps.
Full details: Linked Issues check
Explanation
[#44778] The issue requires that an inline formula that fails to parse wraps or scrolls on iOS when it is wider than the column. The PR description says the fix is in the vendored fork, not in this repository's source. iOS: ENRMMathInlineRenderer appends fallbackSource as text. Android: MathInlineRenderer appends fallback text in the math colour. The reviewed changes since the previous head only update apps/mobile/package.json (dependency reference from the f4d92161 tarball to the f770272a tarball) and pnpm-workspace.yaml (allowBuilds entry for the t3.20-f770272a archive). The native source changes are inside a binary tarball under apps/mobile/deps and cannot be read in this review. The PR description names fork commit b83a400e and fork commits 1419a1f5 (iOS) and b83a400e (Android). It also says these commits are not yet pushed to pingdotgg/enriched-markdown. The archive name f770272a does not match the commit named in the description, so the link between the referenced tarball and the described fork changes is unconfirmed. Device captures on iOS and Android in the description show the fallback wrapping for an expanded user message. These captures support the behavior, but they do not show which tarball produced them. Requirements not verified: the iOS and Android fallback-as-text behavior in the referenced tarball, and the wrap of wide parseable formulas, which the issue mentions but the PR does not test.
Resolution
Provide evidence that the tarball referenced in apps/mobile/package.json (react-native-enriched-markdown-1.2.0-t3.20-f770272a.tgz) contains the described fork changes. Acceptable evidence: the fork commit that produced f770272a, with the diffs of ENRMMathInlineRenderer.m and MathInlineRenderer showing the fallback is inserted as text, or the tarball contents for those two files. Also confirm that the fork commits are pushed to the referenced fork so the build is reproducible. The reviewer should also confirm the description's b83a400e reference matches f770272a.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 187a457 and 602d802.
Files ignored due to path filters: 1
pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 2
apps/mobile/package.json
pnpm-workspace.yaml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
This change passed review and its checks are green, so it is ready to merge.
It is held for now because it changes the native app: merging it would block over-the-air updates until a new store build ships. It is labelled staged-for-store and will be merged when the next store release is prepared. Nothing is needed from you until then.
Macroscope's review found this PR approvable — Invalid inline math now wraps as readable source text on mobile instead of clipping, while retaining accessibility labels and error reporting. The dependency update is confined to this rendering behavior and does not change product defaults or data handling.
You can add or adjust custom eligibility rules. Learn more.
Thanks for this. Main already has the change, as of fda9e00.
Thanks for the careful fix in #44813. The change is already on main as fda9e005ca, which carries the updated mobile markdown tarball and the matching package metadata.
The merged commit contains the same iOS and Android fallback-wrapping behavior described here, so there is no remaining work for this pull request to add.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
📱 Native ChangeChanges the native fingerprint; merging blocks production OTAs until a new store build ships.size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
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.
With Render math on, an inline formula that fails to parse is shown as its raw
$…$source. On both iOS and Android that source was drawn as one unbreakable piece, so a long formula ran past the edge of the message and its end was cut off. The fallback source is now inserted as ordinary text, so it wraps with the paragraph and stays fully readable.ENRMMathInlineRendererappends the attachment's newfallbackSourceas text when RaTeX fails, instead of theENRMMathInlineAttachment. The fallback still reports the LaTeX error and keeps itsmathLatexaccessibility label.MathInlineRendererappends the fallback as text in the inline math colour, with a span that keeps TalkBack's math label, instead of theMathInlineSpanreplacement span. It still reports the LaTeX error.apps/mobile/deps: the tarball is rebuilt from the fork (b83a400e), with the lockfile and workspace entries updated.Fixes #44778
Reproduction on main
Commit: origin/main 772f8d4. Server started fresh in a worktree with$\hat{s} = \arg\max_{s \in M_t:,\dead(s)=0} b_t(s)$ , then plan from it.' Observed: the assistant reply shows 'Pick the state', then the fallback
T3CODE_DEV_SEED=0 vp run dev:server --host 0.0.0.0; Metro withvp run dev:client. Dev client installed withvp run mobile:install ios(cached build) on a pooled iOS 27.2 'iPhone 18 Pro' simulator, paired with the test-t3-mobile pair-client script, and a scratch git project added witht3 project add. In the app: Settings → Appearance → Render math turned on. New thread in that project with Claude Haiku 5.5, prompt: 'Reply with exactly the following line and nothing else, copied verbatim, no code block: Pick the state$\hat{s} = \arg\max_{s \in M_t:\,\dead(s)=0} b_t(s)on its own line, cut off at the right screen edge (the trailing)$is missing), then ', then plan from it.' on the next line. The user's own message bubble with the same formula is cut off the same way after\dead(s). Turning Render math off and reopening the thread: both messages wrap normally and show the whole...b_t(s)$. A parseable formula wider than the column was not tested.Evidence
On fresh isolated servers for each commit, seed the same synthetic user message, install each checkout's native dev client, pair, enable Render math, and expand the user message. iOS uses the original reported formula containing
\dead(s). Android extends that same invalid formula with+ b_{t-1}(s) + b_{t-2}(s) + b_{t-3}(s)so its fallback exceeds the column. Each platform uses identical input, viewport, font and theme on both commits.Android: pooled Pixel 9 / API 36, DM Sans 16 pt, light theme. iOS: pooled iPhone 18 Pro / iOS 27.2, System 16 pt, light theme. Base visibly clips the source and hides its closing
$; head wraps the complete source. Render math remained enabled on head. Captures were inspected and their content regions were identical across two screenshots taken more than 500ms apart. Status/header areas containing the private host label were cropped equally on both sides.10df37a983
187a457c27
10df37a983
187a457c27
Seed driver and reproduction instructions
These captures prove expanded user-message fallback rendering. Assistant-message rendering and wide parseable formulas were not verified.
Not shown:
Tests
187a457c27: all 36 checks passed (8 required)vp run mobile:install android --preparethen--sessionon a pooled Pixel 9 (API 36): client built and installed; the issue's formula wraps and ends withb_t(s)$;$\pi r^2$renders as math\dead(s); the branch wraps it and shows the whole source;$\pi r^2$renders as mathvp run check:changed: format, knip, typecheck (44 packages) and test all passedNot in this change
span, because the text no longer contains an attachment.Who did the work
Run by the t3code factory in T3 Code.
Store batch verification
Ported the same four native source changes onto the current
1.2.0-t3.20fork and rebuilt the archive fromf770272a. Comparing the old and rebuilt t3.20 archives shows only those four source files and the provenance record changed.vp run check:changed origin/mainpassed.With Render math enabled, a synthetic Replay reply containing invalid math wrapped through the closing dollar sign and the following prose on both native development builds of
602d802c. Android exposed the math accessibility label in the device tree.