Skip to content

fix(mobile): reduce thread feed scroll jank - #4874

Merged
gabrielelpidio merged 2 commits into
mainfrom
t3code/fix-ios-thread-scroll-jank
Jul 30, 2026
Merged

fix(mobile): reduce thread feed scroll jank#4874
gabrielelpidio merged 2 commits into
mainfrom
t3code/fix-ios-thread-scroll-jank

Conversation

@gabrielelpidio

@gabrielelpidio gabrielelpidio commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Reduced visible scroll jumps in the mobile thread feed by using fixed heights for predictable rows and measuring content ahead of the viewport.
  • Disabled layout animations while browsing thread history, while preserving smooth animations near the latest messages.
  • Improved short-thread bottom alignment and filtered neutral tool activity rows from work logs.
  • Updated file preview editor integration and simplified Git diff/stat handling.
  • Reverted package versions and aligned the Pierre Diffs patch with the current dependency version.

Why

Scrolling upward through older, unmeasured thread content caused row size corrections to visibly shift the feed. Predictable row sizing, ahead-of-viewport measurement, and conditional layout animation keep history browsing stable without sacrificing smooth updates during active streaming.

UI Changes

No screenshots or video included. The mobile thread feed scroll behavior and file preview editor integration were adjusted.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Changes scroll positioning, list virtualization sizing, and layout animation timing in a complex LegendList setup; regressions would show as scroll jumps or misaligned short-thread layout, not security issues.

Overview
Reduces upward-scroll jank in the mobile thread feed by teaching LegendList predictable heights for chrome rows and by only running layout animations when the user is near the latest messages.

ThreadFeed replaces the always-on LinearTransition with a scroll-gated feedItemLayoutTransition worklet: 180ms slides when within about one screen of the list end, 0ms while reading history so maintainVisibleContentPosition offset fixes don’t fight animated moves. It adds getFixedItemSize for turn folds, work toggles, the working row, and collapsed activity groups (using collapsedWorkLogHeight and scaled typography), drawDistance={500} for offscreen measurement, and alignItemsAtEnd so short threads sit above the composer.

thread-work-log centralizes filtering in visibleWorkLogActivities, exports height helpers shared with the feed, and uses the same filter when rendering.

appearancePreferences adds scaledTypographyLineHeight and routes text-scale line-height variables through it so fixed row heights stay aligned with the user’s base font size.

Reviewed by Cursor Bugbot for commit ca5441e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Reduce scroll jank in thread feed by gating layout animations and pre-measuring row heights

  • Adds a feedItemLayoutTransition worklet in ThreadFeed.tsx that only animates layout changes (180ms) when the scroll position is near the end of the list, running instantly (0ms) elsewhere to avoid mid-scroll jank.
  • Adds a getFixedItemSize callback so LegendList can skip async measurement for known fixed-height rows (turn-fold, work-toggle, working, activity-group when fully collapsed).
  • Sets drawDistance={500} to pre-render more offscreen content and alignItemsAtEnd to bottom-align short lists.
  • Exports collapsedWorkLogHeight, visibleWorkLogActivities, and WORK_GROUP_TOGGLE_HEIGHT from thread-work-log.tsx to support pre-measurement of work-log rows.

Changes since #4874 opened

  • Made thread feed row heights scale dynamically with user's base font size preference [ca5441e]

Macroscope summarized d39ce79.

- Disable layout slides while browsing history
- Add fixed row sizing and bottom alignment for smoother scrolling
@coderabbitai

coderabbitai Bot commented Jul 29, 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 Plus

Run ID: c7c71d53-d1ad-4d80-91c2-a850b74255a3

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

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.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 29, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces conditional layout animations and pre-measurement logic for a complex virtualized list. The self-labeled 'Medium Risk' changes to scroll positioning, animation timing, and list virtualization warrant review to ensure no scroll-related regressions.

You can customize Macroscope's approvability policy. Learn more.

@t3-code t3-code 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.

the fixed-size approach looks good, but these values need to follow the app's configurable text scale before merge. apps/mobile/src/features/threads/ThreadFeed.tsx:131: text-xs has a 17px line height at default, so WORKING_ROW_HEIGHT is already 1px short: 8 + 17 + 16 = 41. at the supported 22pt base size it becomes 47px. please derive this from scaled typography or leave the row measured. apps/mobile/src/features/threads/thread-work-log.tsx:93: text-2xs is 16px only at default. at 22pt its line height is 22px, making this header 24px rather than 18px. please use the current scaled line height or leave these groups measured.

… scale

The working row and work-log header heights baked in default-scale line
heights; at larger base font sizes the fixed sizes went stale (review
feedback on #4874). Predict them with scaledTypographyLineHeight — the
same formula resolveTextScaleVariables injects into Uniwind — so the
predicted and rendered heights cannot drift.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gabrielelpidio

Copy link
Copy Markdown
Contributor Author

Addressed the text-scale feedback in ca5441e: fixed row heights are now derived from scaledTypographyLineHeight — the same formula resolveTextScaleVariables injects into Uniwind — so the working row and work-log header track the configured base font size exactly (including the 17px text-xs line at default and 22pt maximum). The min-height-clamped rows keep their constants, with the clamp invariant documented at each.

@t3-code t3-code 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.

correction: this approval only clears the blocking state i set by mistake. it is not an implementation approval. the font-scale concerns at apps/mobile/src/features/threads/ThreadFeed.tsx:131 and apps/mobile/src/features/threads/thread-work-log.tsx:93 still need addressing.

@gabrielelpidio
gabrielelpidio merged commit 9e3e9bb into main Jul 30, 2026
17 checks passed
@gabrielelpidio
gabrielelpidio deleted the t3code/fix-ios-thread-scroll-jank branch July 30, 2026 01:21
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 30, 2026
## What's Changed
* fix(mobile): reduce thread feed scroll jank by @gabrielelpidio in pingdotgg/t3code#4874
* fix(web): restore sidebar v2 thread actions and terminal icon by @Noojuno in pingdotgg/t3code#4712
* fix(web): settle button now works on hover, not just right-click by @t3dotgg in pingdotgg/t3code#4905
* fix(clients): disable add project while disconnected by @StiensWout in pingdotgg/t3code#4834
* fix(composer): hide default Codex service tier by @maxktz in pingdotgg/t3code#4784

## New Contributors
* @gabrielelpidio made their first contribution in pingdotgg/t3code#4874

**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260729.951...v0.0.32-nightly.20260730.953

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260730.953
tarik02 added a commit to tarik02-org/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
patroza pushed a commit to patroza/t3code that referenced this pull request Jul 30, 2026
patroza added a commit to patroza/t3code that referenced this pull request Jul 30, 2026
* Revert "fix(mobile): keep conversation feed visible (#232)"

This reverts commit bb01fe8.

* Revert "fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)"

This reverts commit 9e3e9bb.

---------

Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
mwolson added a commit to mwolson/t3code that referenced this pull request Jul 31, 2026
Refresh against the approved codex-turn-mapping tip. CTM's LegendList 3.3.3
patch threads contentInsetStartAdjustment through the list's own scroll math,
and pingdotgg#4867/pingdotgg#4874 carry the gated feed-item layout transition, so this merge
keeps CTM's versions of both. The keyboard-side wiring is not upstream: the
3.3.3 patch never passes contentInsetStartCompensation into
KeyboardChatScrollView, whose clamp floor defaults to 0, so the pingdotgg#4036 wiring
is re-ported onto the 3.3.3 patch. The pingdotgg#4036-unique short-content underflow
correction, Markdown rendering, and thread-detail changes are retained.
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.

2 participants