fix(mobile): Stabilize thread feed layout and Markdown rendering#4036
fix(mobile): Stabilize thread feed layout and Markdown rendering#4036juliusmarminge wants to merge 7 commits into
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
|
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Needs human review This bug fix touches native iOS C++ layout code and includes substantial patches to the @legendapp/list third-party library affecting scroll behavior calculations. While the author is the primary maintainer of these files, native code changes and third-party patches to rendering infrastructure warrant human review. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit 8b0ce3c. Configure here.
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>

Extracted from #3910.
Fixes native selectable Markdown width and stale-content behavior, keeps screenshots interactive, and stabilizes floating-composer spacing, short-content positioning, and hydration layout in the thread feed. Includes the required LegendList patch and regenerated lockfile.
Validation inherited from #3910:
vp checkand mobile native lint passed before the split. The full typecheck is currently blocked in this workspace by unavailable mobile dependencies (expo-blur,expo-quick-actions, and@tabler/icons-react-native).Note
Stabilize thread feed scroll layout and fix Markdown rendering in iOS
fillWidthprop toSelectableMarkdownTextso assistant markdown messages stretch to fill the full row width.T3MarkdownTextShadowNodeto derive content viabuildContentand gate state updates with equality checks, preventing redundant re-renders.@legendapp/listto improve end-scroll maintenance, initial scroll readiness, and keyboard-aware inset handling near translucent headers.ThreadDetailScreento produce a stable resting inset above the composer.maintainScrollAtEndis disabled while content underflows the viewport; scroll position is instead managed by arequestAnimationFrameloop.Macroscope summarized 775d0b1.
Note
Medium Risk
Large behavioral changes in patched list scrolling and native shadow-node state publishing affect core chat UX on iOS; no auth or data-path changes, but regressions in scroll position or markdown rendering would be user-visible.
Overview
Fixes thread feed resting scroll, short-content positioning, and native selectable markdown width/stale text, with a refreshed
@legendapp/listpatch.Native markdown (
T3MarkdownText) stops caching measure-time attributed string in mutable members.buildContent()rebuilds from children on each measure/layout;layout()callsupdateStateIfNeededwith equality on paragraph/attachment ranges so Yoga clones that skip measure no longer publish stale or empty text.SelectableMarkdownTextgains optionalfillWidth(stretch in shrink-to-fit bubbles); thread assistant messages enable it.Thread detail / feed: Measured floating composer height drives
contentInsetEndEstimateand a 24px gap viauseKeyboardChatComposerInset’s newheightAdjustment.ThreadFeeddetects content shorter than the viewport, scrolls to the header inset, pausesmaintainScrollAtEndwhile underflowing, keeps the list mounted during loading hydration with a spinner overlay, and tightens list remount rules when the first message arrives.LegendList patch adds
contentInsetStartAdjustment, safe-area compensation for anchored end blank space, inset-end settle/reveal holds, correctedmaintainScrollAtEndthreshold (raw scroll end vs inset-adjusted end), and related clamp/initial-scroll fixes for transparent-header iOS layouts. Lockfile patch hash updated.Reviewed by Cursor Bugbot for commit 775d0b1. Bugbot is set up for automated code reviews on this repo. Configure here.