Repository navigation
feat(mobile): add a line wrap toggle to code blocks - #19041
Abdullah1738 wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This enables a new mobile code-block wrap control backed by substantial vendored iOS and Android native changes, including layout and measurement behavior. The hidden implementation is broader than the small app diff, so human review is warranted. You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by Thanks for rebuilding the wrap toggle for Enriched. This adds a reading control rather than repairing broken scrolling, and I recognize Julius previously invited this resubmission. Right now we are only taking focused bug fixes from outside contributors, using the limited review capacity described in Read this first. Please preserve the mobile readability proposal in an Ideas discussion and request reconsideration if maintainers choose to prioritize it. |
Problem
On mobile, fenced code blocks in messages only scroll sideways, so long lines get cut off at the screen edge and you have to swipe inside a small box to read them. #15877 added a per-block wrap button for this, but it was closed when #16979 replaced the mobile Markdown renderer with Enriched Markdown. Julius's close note: "A code-block wrap toggle would need to be rebuilt on top of Enriched; feel free to open a new PR against the new renderer if you want to pick it back up." (#15877 (comment))
Change
This rebuilds it on Enriched. Code block headers are native in Enriched, so the button lives in the fork: pingdotgg/enriched-markdown#1 adds an opt-in
enableCodeBlockWrapToggleprop that puts a wrap button next to Copy in each code block header. This PR bumps the vendored archive to 1.2.0-t3.12 (built from that branch, commit 0dc84de7) and turns the prop on inapps/mobile/src/native/EnrichedMarkdownText.tsx.The behaviour matches #15877. It's per block and starts off, with the same labels as web ("Wrap lines" / "Disable line wrap"),
text.alignlefton iOS andwrap_texton Android. Wrapped blocks lay out at the bubble width, and the choice survives streaming updates of the same message. Code blocks inside blockquotes keep scrolling.Scope and approval
This is a parity fix that brings back the mobile wrap toggle from #15877 on the new renderer. Julius invited a new PR for it in the closing comment linked above. It mirrors web's existing per-block wrap toggle in
ChatMarkdown. Surfaces: mobile only (web already has the toggle, desktop wraps web). No contracts, providers, server, or settings changes. The dependency followsapps/mobile/deps/README.md, and it needs pingdotgg/enriched-markdown#1 merged first (the archive here is built from that branch).Verification
tsc-rs --noEmitin apps/mobile,vp fmt --check apps/mobile/src,vp lint --report-unused-disable-directives apps/mobile/src,vp run knip:check,git diff --check: clean.T3Code.app, upstream branding) with the new archive succeed.tsblock and a shortshblock. The long line is clipped and scrolls sideways first, wraps at the bubble width after tapping the button, and scrolls again after a second tap. Copy still copies the original single line in both states, and the short block looks the same as before. On Android the button reads "Wrap lines" / "Disable line wrap" to accessibility services.Built with Claude Opus 5.5 in T3 Code (OpenCode harness). Reviewed with GPT-6 Astra.