Skip to content

fix(mobile): Stabilize thread feed layout and Markdown rendering#4036

Open
juliusmarminge wants to merge 7 commits into
pingdotgg:mainfrom
juliusmarminge:codex/pr3910-thread-feed-layout
Open

fix(mobile): Stabilize thread feed layout and Markdown rendering#4036
juliusmarminge wants to merge 7 commits into
pingdotgg:mainfrom
juliusmarminge:codex/pr3910-thread-feed-layout

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jul 16, 2026

Copy link
Copy Markdown
Member

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 check and 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

  • Fixes thread feed scroll position when content is shorter than the viewport by anchoring content under translucent headers and scrolling to end when content grows to fill the viewport.
  • Adds a fillWidth prop to SelectableMarkdownText so assistant markdown messages stretch to fill the full row width.
  • Refactors T3MarkdownTextShadowNode to derive content via buildContent and gate state updates with equality checks, preventing redundant re-renders.
  • Patches @legendapp/list to improve end-scroll maintenance, initial scroll readiness, and keyboard-aware inset handling near translucent headers.
  • Adds measured composer overlay height tracking in ThreadDetailScreen to produce a stable resting inset above the composer.
  • Behavioral Change: maintainScrollAtEnd is disabled while content underflows the viewport; scroll position is instead managed by a requestAnimationFrame loop.

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/list patch.

Native markdown (T3MarkdownText) stops caching measure-time attributed string in mutable members. buildContent() rebuilds from children on each measure/layout; layout() calls updateStateIfNeeded with equality on paragraph/attachment ranges so Yoga clones that skip measure no longer publish stale or empty text.

SelectableMarkdownText gains optional fillWidth (stretch in shrink-to-fit bubbles); thread assistant messages enable it.

Thread detail / feed: Measured floating composer height drives contentInsetEndEstimate and a 24px gap via useKeyboardChatComposerInset’s new heightAdjustment. ThreadFeed detects content shorter than the viewport, scrolls to the header inset, pauses maintainScrollAtEnd while 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, corrected maintainScrollAtEnd threshold (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.

juliusmarminge and others added 2 commits July 16, 2026 10:54
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 36ba8fe6-3ea7-4c69-8650-ab141859c740

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jul 16, 2026
Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx Outdated
@juliusmarminge juliusmarminge marked this pull request as ready for review July 16, 2026 09:25
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Comment thread apps/mobile/src/features/threads/ThreadFeed.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

juliusmarminge and others added 2 commits July 16, 2026 11:36
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Co-authored-by: codex <codex@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

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.

Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Co-authored-by: codex <codex@users.noreply.github.com>
Comment thread apps/mobile/src/features/threads/ThreadDetailScreen.tsx Outdated
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant