Problem#
Mobile threads could jump when opening work details, returning from sleep, or swiping after the bottom arrow. Cold expansion was worse because hidden rows still used estimated heights. Disclosure animations could overlap text as rows mounted or disappeared, and the work-log spacing was loose.
Fix#
Keep Reanimated's size style attached and retarget active animations when measurements replace estimates, so native scroll bounds stay current.
Reconcile live-follow after disclosures using refreshed end geometry, preserving the reading position on resume.
Remove FadeOut from virtualized outer feed rows. Newly mounted or remounted rows fade in after the existing 180 ms layout transition, including a returning final answer. Remove the old entering-ID bookkeeping; retain layout transitions and clipped command-detail fades.
Tighten spacing below Worked-for rows, after commentary, and around tool-group toggles. Update the matching fixed-height constants without shrinking touch targets.
Key the feed with the existing environment-scoped selectedThreadKey, so disclosure callbacks cannot survive an environment switch.
Rotate a stable chevron for Worked-for rows, tool groups, and command details over the existing 180 ms disclosure transition. Preserve icon dimensions, tap targets, and expanded accessibility state; use Reanimated's system reduced-motion setting.
No new test harness. Changes are mobile-only; web/desktop behavior, providers, and wire contracts are unchanged.
Chevron motion#
Before eb9067349; after ad27b1b01. The synthetic clips are cropped to the disclosure controls, run at normal speed, and have no audio.
The latest simulator pass opened and closed all three controls. Fold, group, and command-row anchors stayed fixed, and frame-by-frame review confirmed intermediate rotation angles.
Disclosure and spacing comparison#
Before fa0926df; after eb9067349. Synthetic iOS Simulator footage, normal speed, silent, with the header cropped. No customer conversation is published.
| Before | After |
|---|
 |  |
Fold and command-group anchors stayed fixed through repeated toggles. Frame-by-frame review covered incoming work rows, moving commentary, and the final answer remounting on collapse. Earlier turns were checked separately.
Prior scroll-fix evidence#
The earlier cold-expansion comparison is 479f910 → fa0926df, not the spacing comparison above. First expansion previously moved the anchor 179 points; afterward it stayed at y=250.33 through first expansion, collapse, and second expansion.
Before image · After image · Before first expansion · After first/second expansion · Command output across background/resume.
Original scroll-bounds reproduction: before opening details, after opening details, and bottom arrow followed by swipes.
Verification#
- 59 tests passed across four existing files: the previous 55 follow/presentation/layout tests plus four known-environment tests.
- Mobile TypeScript, targeted lint/format checks, and
git diff --check passed.
- iOS Simulator: first/second and latest/earlier disclosures, interleaved user messages, command details, bottom arrow/swipes, background/resume, and short-thread alignment. Prior scroll-fix verification also covered thread reopening.
- New standalone Release installed as T3 Code Dev on the iPhone 16 Pro. All three source files byte-match the build input; OTA updates are disabled. Installation and launch both succeeded; physical-device scrolling remains for manual testing.
Android was not exercised. Native list sizing and disclosure anchoring remain the main regression risks.
Implemented and verified with the Codex harness in T3 Code.
Note
Medium Risk
Touches patched LegendList scroll/MVCP and Reanimated list sizing—core thread scrolling on iOS—with hardcoded row height constants that must stay in sync with layout classes.
Overview
Improves mobile thread feed behavior when expanding turns, work groups, and tool rows: scroll position, live-follow, and list animations stay aligned instead of jumping or re-pinning the user to the bottom.
Live-follow adds a disclosure-settled path in resolveThreadFeedLiveFollow and runs it after disclosure layout settles so follow only re-arms when the list is actually at the end and the user is not in an active scroll session.
Disclosure UI introduces shared ThreadDisclosureChevron (animated rotation), tightens vertical margins and fixed-height constants (TURN_FOLD_HEIGHT, WORK_GROUP_TOGGLE_HEIGHT), and changes feed row animations: delayed FadeIn while disclosureToggleSettling replaces per-row entering-ID tracking and removes outer-row FadeOut on removal.
ThreadDetailScreen keys ThreadFeed with environment-scoped selectedThreadKey instead of bare thread id so disclosure/state does not leak across environment switches.
@legendapp/list patch (lockfile hash updated) extends scroll/inset handling: contentInsetStartAdjustment, getIsAtEnd when size changes without scroll events, ReanimatedSizeView for animated content height, MVCP/maintain-scroll guards during size animations and user drag/momentum, and related anchored-end-space and initial-scroll fixes used by the thread list.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ad27b1b014171bca5fdff27856e591e0221db836. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
Fix thread scroll bounds after disclosure animations in LegendList and ThreadFeed#
- Patches
@legendapp/list to compute isAtEnd accurately during size-only layouts, defer maintainScrollAtEnd during user scroll sessions, and keep animated content-size changes aligned with logical size changes.
- Adds a
disclosure-settled event to resolveThreadFeedLiveFollow so the follow latch re-arms only when the list is actually at the end and no user scroll session is active.
- Simplifies
ThreadFeed disclosure animations to fade-in only (no exit animation), and reconciles end-follow after two animation frames in settleDisclosureAfterLayout.
- Introduces
ThreadDisclosureChevron with Reanimated rotation, replacing static SymbolView icons in ThreadWorkLog and ThreadFeed; tightens vertical spacing on fold and toggle rows.
- Changes
ThreadDetailScreen's ThreadFeed remount key from selectedThread.id to selectedThreadKey.
- Risk: the
@legendapp/list patch touches core scroll-finishing and isAtEnd logic in patches/@legendapp__list@3.3.5.patch; regressions would affect all LegendList consumers, not just thread feeds.
Macroscope summarized ad27b1b.
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
0947c30· PR result:ad27b1b· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.