Skip to content

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

Closed

Description

@frrad

Summary

When a thread is at the bottom (stuck to the latest message), trackpad scrolling with the pointer over an inline-vis iframe does not scroll the chat. The chat snaps back to the bottom. Scrolling with the pointer over the text next to the iframe works. Only the bottom-most preview is affected, because the snap-back only happens while the timeline is attached to the bottom.

bb 0.48.0, Chrome.

Repro

  1. In a thread, have the agent's last message contain an inline-vis page taller than the viewport, e.g. a couple of <img style="width:100%"> figures.
  2. Scroll to the bottom of the thread.
  3. Put the pointer over the iframe and scroll up with two fingers on a trackpad.

Expected: the chat scrolls up.
Actual: it stays at the bottom.

Reproduced in headless Chrome with mouse.wheel. Starting from the bottom (scrollTop 2687), I sent 30 small steps of deltaY: -8:

Pointer position scrollTop after
over the iframe 2687 (stuck)
over text beside it 2447

A single large step (deltaY: -150, like a mouse wheel notch) sometimes gets through. It jumps past bottomThresholdPx in one go, so trackpads are what's mostly affected.

Cause

The scroll position keeper (scroll-position-keeper-*.js) tells user scrolls apart from layout shifts by listening for wheel, touchstart, pointerdown and keydown on the scroll element. These events call extendInput() and start an input session.

With the pointer over the sandboxed inline-vis iframe, the browser routes the wheel events to the iframe's document. Scroll chaining still scrolls the parent timeline, but the parent never gets a wheel event. So handleScroll() sees a scroll with no input session while position.kind === "bottom". followsUnexplainedScroll() is false, so apply() treats it as unexplained and writes the scroll back to maxScrollTop.

Suggested fix

Forward wheel activity from the iframe to the host. The injected bootstrap script in inline-vis already sets up a postMessage bridge for links and height:

  • In the iframe: addEventListener("wheel", e => parent.postMessage({jsonrpc:"2.0", method:"…/wheel", params:{deltaY:e.deltaY}}, "*"), {passive:true}). Throttle it if needed.
  • In the host (Me frame component): when that message comes from this iframe's contentWindow, dispatch a synthetic new WheelEvent("wheel", {bubbles:true, deltaY}) on the iframe element. Or call the keeper's input-session hook directly.

I tested this by injecting the two halves into the running app. Afterwards, trackpad-style scrolling over the iframe behaved the same as over text (2687 → 2447).

A more general option: have the keeper treat any scroll that happens while the pointer is over an iframe inside the timeline as user input.

Activity

  1. added theissue type on Oct 31, 2026
  2. added
    ui
    inline-vis
    confirmed-repro
    on Oct 31, 2026
  3. bb-slop-cop commented on Oct 31, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Medium. Applied labels: ui, inline-vis, confirmed-repro.
    • Verdict: REPRODUCED, with high root-cause confidence. Reproduction and root-cause report.
    • Evidence: Repeated in two clean checkouts of trusted main using fresh Chromium profiles. Thirty small upward wheel steps leave the iframe case at 1800; host-text and disconnected-keeper controls reach 1560. All 56 existing keeper tests pass. This verifies a real-source browser harness, not a full application or physical trackpad.
    • Root cause: Frame wheel events never reach the parent input listener, so bottom anchoring misclassifies browser-chained scrolling as an unexplained displacement and restores the bottom position.
    • No pull request: A safe repair needs cross-frame input attribution across the sandbox/host trust boundary, outside this rule's simple-fix limits.
  4. added a commit that references this issue on Nov 2, 2026
    702d999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproinline-visui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions