fix(mobile): keep Android file icons on the line with wrapped filenames - #11234
fix(mobile): keep Android file icons on the line with wrapped filenames#11234SunkenInTime wants to merge 1 commit into
Conversation
Android renders file and link icons as an inline Image before the label. The regular space between them is a line-break opportunity, so a long filename could wrap while its icon stayed on the previous line. Prefix the label with a non-breaking space on Android so the icon and its label wrap together. The native copy sanitizer strips that spacer alongside the image placeholder so selected text matches what was authored. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bf0907e to
788603c
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped Android rendering and copy-behavior bug fix. The production changes are platform-gated and limited to icon-bearing markdown runs, with focused native tests and no schema, deployment, security, billing, or default-setting impact. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughAndroid icon runs now use non-breaking-space prefixes. Selection copying removes inline image placeholders and injected spacers. Robolectric tests cover whitespace, selection offsets, literal object characters, and text without image spans. ChangesInline image rendering and selection copy
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Android wrapped icon labels and copied text are covered by the corresponding rendering and selection behavior, with no actionable merge risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
On Android, a file or link icon can stay on the previous line when its filename wraps. #11118 fixed the vertical icon drift and explicitly left this wrapping issue out of scope ("An icon can still stay on the previous line when its filename wraps").
Android renders the icon as an inline
Imagebefore the label, and the regular space between them is a line-break opportunity. This prefixes the label with a non-breaking space on Android so the icon and its label wrap together. The native copy sanitizer strips that spacer alongside the image placeholder, including when the selection starts after the icon, so copied text matches what was authored.This is the wrapping half of #11079 (reverted in #11098). The drift half is intentionally not re-added, since #11118 solved it natively. The renderer files are shared between platforms (#11128); the new branch only runs on Android and the iOS text path is untouched.
Why
The NBSP is the smallest change that ties the icon to its label in a single
TextViewrun without changing layout for any other text.Verification
nativeMarkdownText.test.ts: 35 passedMarkdownSelectionCopyTest(4 tests) via:t3tools-mobile-markdown-text:testDebugUnitTest: all passUI Changes
Same seeded message on a Pixel 9 Pro API 36 emulator. The "before" runs the upstream
mainrenderer on a binary that already includes #11118, so drift is out of the picture and only wrapping differs. Four of the ten bullets strand their icon at the end of a line before the change.iOS with this branch's bundle, iPhone 17 simulator. The Android-only branch does not run here and inline icons render as before:
Checklist
Model: Claude Fable 5.1. Harness: Claude Code in T3 Code.
🤖 Generated with Claude Code
Summary by CodeRabbit