Skip to content

Thread view strands above the bottom when content grows without a state change #408

Closed

Description

@currentbits

Follow-up to #306 (closed). Autoscroll still misses one class of case.

The pin-to-bottom effect in src/components/ThreadView.tsx runs on [timeline, isWorking, detail?.messages, detail?.workLog]. That covers every scroll triggered by a React state change, but content also grows after render with no state change and no scroll event:

  • images in tool output / attachments / markdown finish loading
  • code blocks get syntax-highlighted
  • webfonts swap in and reflow text

In those cases the container's scrollHeight grows while scrollTop stays put, so the view sits above the bottom even though stickToBottom is still true.

Repro: run a turn whose output ends in an image or a large code block, stay scrolled to the bottom, watch the view detach as the content lays out.

Fix (in progress locally): a ResizeObserver on the body element plus each direct child, re-attached on timeline change, that re-pins to scrollHeight whenever stickToBottom.current is set.

Activity

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

    @currentbits
    OwnerAuthor

    Status check: not fixed. No ResizeObserver (or MutationObserver) exists in src/components/ThreadView.tsx — the pin-to-bottom effect still runs only on [timeline, isWorking, detail?.messages, detail?.workLog], so image load / highlight / webfont reflow still strands the view above the bottom. No test covers it. Keeping open.

  3. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Ready for review on worktree branch coder/fork-we-have-a-lot-of-in-progress-on-the-ad9626 (commit f07b614, thread ad96263c). A ResizeObserver on the scroll body + its direct children (re-attached on timeline change) re-pins to scrollHeight only while stickToBottom is set and the view is actually detached — user scrolls up are not yanked. Tests in test/threadView.test.tsx cover pinned-growth re-pin and scrolled-up no-op; 26/26 pass.

  4. added a commit that references this issue on Aug 18, 2026
  5. added
    plan:done
    and removed
    plan:doing
    on Aug 18, 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