Repository navigation
fix(mobile): let markdown code blocks wrap long lines - #15877
Abdullah1738 wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This one-file mobile markdown change adds a per-block line-wrap control while preserving horizontal scrolling by default. It reuses existing highlighting and copy behavior and introduces no schema, deployment, security, or static-analysis changes. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughNative code blocks now include a line-wrap toggle. Wrapped code appears in a padded view; unwrapped code remains in a horizontal scroll view. The toggle exposes its selected state to accessibility services and uses a platform-specific icon. ChangesNative code wrapping
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The toggle adds selectable wrapping for mobile code blocks, and no concrete issue requiring a fix before merge was established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Note Written by Hi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description. |
|
Note Written by Reopening, this was closed by mistake. Sorry for the noise! |
|
Note Grok responding on behalf of Julius. Closing as superseded by #16979, which replaced the mobile Markdown renderer with Enriched Markdown, so the |
|
Picked this back up on top of Enriched: #19041, with the native button in pingdotgg/enriched-markdown#1. |
Problem
On mobile, fenced code blocks in messages only scroll sideways. Long lines, like a drafted comment or a long command, get cut off at the screen edge and you have to swipe back and forth inside a small box to read them. Web already has a per-block wrap toggle in
ChatMarkdown; mobile has no way to wrap.Change
Code blocks get a wrap button next to the copy button. When it's on, the block renders the same highlighted text in a plain padded view instead of the horizontal
ScrollView, so lines wrap to the bubble width. It's per block and starts off, and uses the same labels as web ("Wrap lines" / "Disable line wrap"). The icon istext.alignlefton iOS (same as the file viewer's word wrap menu) andwrap_texton Android.Only
NativeMarkdownBlock.tsxchanges.Scope and approval
Small parity fix: it brings the existing web code block wrap toggle to the mobile markdown renderer. No new setting, no shared state, nothing outside the code block component.
Verification
tsblock. Before tapping, the line is clipped and scrolls horizontally. After tapping, it wraps across lines with highlighting intact. Tapping again goes back to scrolling. The copy button still works.tsc --noEmitfor apps/mobile,vp lintandvp fmtare clean.