Skip to content

Fix iOS thread scroll jumps by keeping timeline rows mounted - #5028

Merged
ymichael merged 1 commit into
mainfrom
bb/ios-thread-scroll-abruptly-jumps-thr_aedn9u3q8i
Oct 6, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ios-thread-scroll-abruptly-jumps-thr_aedn9u3q8i

Conversation

@ymichael

@ymichael ymichael commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Scrolling through long threads on iPhone and iPad could move the text being read and snap again when scrolling settled. Timeline virtualization replaces estimated row heights with measured heights as rows mount above the viewport. Its scroll-position corrections interfere with iOS WebKit momentum scrolling, so deferring those corrections leaves visible jumps.

What changed

Disable timeline virtualization on iOS/iPadOS WebKit and keep every loaded row mounted. Desktop and Android retain virtualization. Extract the existing iOS detection into a shared helper also used by the keyboard-dismissal viewport workaround, including detection of iPads using desktop-style browsing, and document the platform behavior in the CLI app-settings reference.

This trades increased memory and rendering work on long loaded iOS timelines for stable scrolling. There are no server/daemon wire or public API changes.

How you verified

  • pnpm exec turbo run test --filter=@bb/app -- ios-webkit.test.ts ThreadTimelineRows.windowing.test.tsx useMobileVisualViewportHeight.test.tsx — 26 tests passed across three files. Includes an iPhone regression case asserting all 59 rows remain mounted without virtual spacers, plus browser-detection and keyboard-viewport coverage.
  • pnpm exec turbo run typecheck --filter=@bb/app — passed from Turbo cache.
  • git diff --check origin/main...HEAD — passed.
  • Device-level iOS momentum scrolling has not been manually verified in this PR preparation.

AGENT GENERATED

Since timeline windowing became the default (#4218, 0.44.0) and started at
20 items on phones (#4540, 0.45.0), scrolling up through a thread on iOS
moves the text being read. Rows mounted above the viewport during a flick
are measured at a different height than their estimate. The virtualizer
corrects that with a scrollTop write, but iOS WebKit stops momentum on
such writes, so TanStack defers the correction until scrolling ends. The
rows below move immediately, and the deferred correction then snaps the
view again when the scroll settles.

Turn windowing off on iOS/iPadOS WebKit, which restores the pre-0.44
fully mounted timeline there. Desktop browsers and Android keep
windowing. The iOS detection moves to a shared helper used by the
keyboard viewport workaround as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit cf09497 into main Oct 6, 2026
41 checks passed
@ymichael
ymichael deleted the bb/ios-thread-scroll-abruptly-jumps-thr_aedn9u3q8i branch October 6, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant