fix(mobile): keep ordered lists inside user bubbles - #6154
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: Approved 5807b43 Straightforward mobile UI bug fix adding ordered list detection to existing markdown block sizing logic. Changes are minimal, well-tested, and documented. Risk is cosmetic only (possible wider bubbles for list-like text). You can customize Macroscope's approvability policy. Learn more. |
What Changed
Extended fixed-width Markdown detection to recognize ordered-list markers in user messages.
Ordered lists now use the same definite-width Android bubble layout already used for fenced code blocks and GFM tables.
Why
Android can incorrectly measure list-item flex rows inside shrink-to-content user bubbles, causing ordered-list content to render outside the bubble and overlap subsequent messages.
A small regular-expression heuristic keeps the fix focused and avoids changing the shared list renderer. It trades some precision for simplicity, favoring harmless wider bubbles over false negatives that leave messages unreadable.
Fixes #6109.
UI Changes
Checklist
Note
Low Risk
Narrow mobile layout heuristic and tests only; no auth, data, or shared list renderer changes.
Overview
User messages that look like ordered lists now trigger the same pinned-width bubble layout already used for fenced code and GFM tables on Android.
hasWideMarkdownBlockgains anORDERED_LIST_ITEMregex (up to three spaces, digits,.or), then space/tab or EOL). Indented four-space1.lines stay excluded so nested continuations are not misclassified. The heuristic prefers false positives (slightly wider bubbles) over missing real lists that would overlap other messages.Unit tests cover multi-item lists,
3)style markers, and the indented false-negative case.Reviewed by Cursor Bugbot for commit 65bf3bc. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix ordered lists rendering inside user bubbles on mobile
Extends
hasWideMarkdownBlockin wideMarkdownBlocks.ts to detect ordered list markers (e.g.1. itemor3) item) in addition to fenced code blocks and GFM tables. This causes messages containing ordered lists to use the wide layout path, keeping list formatting intact inside user chat bubbles.Macroscope summarized 65bf3bc.