Skip to content

Let trackpad scrolls over an inline preview leave the bottom of a thread - #6832

Merged
ymichael merged 1 commit into
mainfrom
bb/triage-and-resolve-issue-6740-thr_zpkuxfj9dy
Nov 2, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/triage-and-resolve-issue-6740-thr_zpkuxfj9dy

Conversation

@ymichael

@ymichael ymichael commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The timeline's scroll keeper tells the reader's scrolls apart from layout shifts by listening for wheel, touch, pointer and key input on the timeline. An iframe in the timeline (inline-vis, docs embeds, PDF previews) receives its own wheel events, so when the browser chains a scroll from the frame to the timeline, the timeline scrolls with no input it can see. While attached to the bottom, handleScroll treated that as an unexplained displacement and wrote the scroll back to the end, so small trackpad scrolls over the last preview could not leave the bottom. Investigation: https://get-bb.github.io/reports/issues/6740.html

What changed

apps/app/src/components/ui/scroll-position-keeper.ts: followsUnexplainedScroll() also follows a scroll without visible input while an iframe in the timeline matches :hover, like it already does while the window find bar is open. Hover is read when the scroll arrives instead of being tracked from pointer events, so a frame that is removed or re-rendered under a resting pointer leaves no stale state. The rest of #6434's rule is unchanged: with no hovered frame, an attached view still snaps back.

This takes the issue's "more general option" rather than its proposed postMessage wheel bridge in inline-vis, so it covers every embedded frame (inline-vis, docs embeds, PDF previews) and needs no cooperation from the frame. It does not cover touch scrolling over a frame, browser find on the web, or VoiceOver, which #6434 already listed as pulled back at the bottom.

How you verified

  • New keeper tests: an unexplained scroll while a frame is hovered is followed (fails without the fix); a hovered frame that leaves the timeline does not keep following scrolls. All keeper tests pass (pnpm exec turbo run test --filter=@bb/app -- src/components/ui/scroll-position-keeper.test.ts src/components/ui/scroll-position-keeper.model.test.ts).
  • Headless Chrome on the report's source harness, programmatic 300px scroll with no input: pointer over text snaps back; pointer over the iframe follows; pointer moved back to text snaps back again.
  • pnpm exec turbo run typecheck lint --filter=@bb/app: no errors.
  • Real app (pnpm start:worktree, Claude Code thread whose last message is a 1600px inline-vis), headless Chrome, 30 wheel steps of deltaY: -8 with the pointer over the iframe from the bottom: before 1514 → 1514 (stuck), after 1514 → 1274.
  • Source harness from the investigation report (real keeper + inline-vis frameDocument): before 1800 → 1800, after 1800 → 1560, matching scrolling over host text.

Not verified: touch scrolling over an iframe on iOS/Android, which may have the same gap since touch events inside the frame also never reach the timeline.

Fixes #6740

AGENT GENERATED

🤖 Generated with Claude Code

…d frame

An iframe in the timeline (inline-vis, docs embeds, PDF previews) receives
its own wheel events, so the timeline sees the chained scroll without any
input. While attached to the bottom the scroll keeper treated that as a
layout shift and snapped back, so small trackpad scrolls over the last
preview could not leave the bottom. Follow unexplained scrolls while an
iframe in the timeline is hovered.

Fixes #6740

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymichael
ymichael force-pushed the bb/triage-and-resolve-issue-6740-thr_zpkuxfj9dy branch from 6711716 to 702d999 Compare November 2, 2026 18:44
@ymichael
ymichael merged commit 8d36b2c into main Nov 2, 2026
31 checks passed
@ymichael
ymichael deleted the bb/triage-and-resolve-issue-6740-thr_zpkuxfj9dy branch November 2, 2026 18:48
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.

Trackpad scroll over inline-vis iframe snaps back when thread is at bottom

1 participant