Skip to content

fix(transcript): keep scroll position stable while streaming when scrolled up - #359

Merged
kommander merged 1 commit into
devfrom
fix/streaming-scroll-stable-scrolled-up
Nov 30, 2026
Merged

kommander merged 1 commit into
devfrom
fix/streaming-scroll-stable-scrolled-up

Conversation

@kommander

Copy link
Copy Markdown
Contributor

What

Keep transcript scroll position stable while an agent response streams in when the reader has scrolled up.

Minimal, targeted change in feature/transcript/.../list/TranscriptListScroller.kt:

  • A reader's scroll wins over auto-holds: cancel any in-flight resizeHold on user scroll input (nestedScrollConnection.onPreScroll, NestedScrollSource.UserInput).
  • Never apply requestScrollToItem pinning while state.isScrollInProgress (hold, holdTopRow, holdRowTop, holdToggledRow).
  • In hold, re-check isScrollInProgress after awaiting the frame before re-pinning, and don't count that frame toward settling; don't apply the first synchronous pin while scrolling.

Auto-follow when at the end (isFollowing) is unchanged; only the scrolled-up + streaming case is affected.

Reference: Msg-bit (kr-ashwani/msgbits) web useChatViewScrollAnimation scroll handling reviewed; Android divergence kept (this repo's reversed LazyColumn + hold mechanism), only the not-scrolling/user-input gating was hardened.

Verification

  • :feature:transcript:assembleDebug, :feature:transcript:lintDebug, :feature:transcript:testDebugUnitTest — BUILD SUCCESSFUL.
  • scripts/translations.py all — OK (1 pre-existing unrelated warning).
  • NOT runtime-verified on a device/emulator; manual scroll-during-streaming check still needed.

Note: opencode-android was not actually checked out on the target machine; used a fresh separate clone in ~/worktrees/opencode-android-scroll, no other work touched.

@kommander
kommander merged commit a0dba96 into dev Nov 30, 2026
3 checks passed
@kommander
kommander deleted the fix/streaming-scroll-stable-scrolled-up branch November 30, 2026 02:23
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