Skip to content

Main panel does not always autoscroll to the latest message #306

Closed

Description

@currentbits

Reported by Willem: the thread main panel sometimes fails to autoscroll to the newest message, so you have to scroll down manually to see the latest agent output.

Likely suspects to check: scroll anchoring when new messages render while the user is scrolled up (should stay put, but maybe misdetects position), image/markdown content loading after the scroll (shifts layout after anchor), and long-message streaming updates not re-triggering the scroll. Reproduce by running a long turn with streamed output and intermittent user scrolling.

Activity

  1. added
    bug
    plan:todo
    on Aug 17, 2026
  2. currentbits commented on Aug 17, 2026

    @currentbits
    OwnerAuthor

    Fixed (uncommitted in the working tree, ready for review).

    Root cause: the autoscroll effect in ThreadView.tsx only runs when React state changes (timeline, isWorking, messages, workLog). Content that grows WITHOUT a state change — images finishing loading, code blocks highlighting, font swaps — increased scrollHeight after the scroll had run, stranding the view above the latest message while stickToBottom stayed true (no scroll event fires for content growth, so nothing re-evaluated it).

    Fix: a ResizeObserver on the scroll container (covers window resize) and on every direct child (covers content growth) re-pins scrollTop to scrollHeight whenever stickToBottom is set (ThreadView.tsx, next to the existing effect). Re-observes on timeline change so new blocks are covered. User scroll-up behavior unchanged: scrolling more than 80px from the bottom still unsticks, so the observer never fights the user.

    Verified: tsc clean, renderer suite 873/873, vite build clean, smoke-booted the built renderer in a hidden Electron window with zero console errors.

  3. added
    plan:done
    and removed
    plan:todo
    on Aug 17, 2026
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

    bugplan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions