Skip to content

bug: scroll position lost when navigating between parent and child sessions in web app #42806

Closed as not planned

Description

@aryaminus

Description

When navigating between parent and child sessions in the web app, the scroll position is always lost. This affects two scenarios:

  1. "Back to main session" click: When viewing a subagent/child session and clicking "Back to main session" in the composer area, the parent session scrolls to the bottom instead of restoring the position the user was at before they clicked into the child session.

  2. Breadcrumb parent title click: Clicking the parent session title in the timeline header breadcrumb has the same behavior — it scrolls to the bottom of the parent session.

Both navigation paths use navigate() to route to the parent session URL, and the newly mounted session always calls autoScroll.resume() which forces a scroll to the bottom.

Steps to reproduce

  1. Open a session with a long conversation (multiple messages)
  2. Scroll to a specific message mid-way through the conversation
  3. Click a subagent task card to navigate into a child session
  4. In the child session, click "Back to main session" (or the parent breadcrumb title)
  5. Observe: the parent session scrolls to the bottom instead of returning to the position you were at

Root cause

The timelineCache in message-timeline.tsx saves measurements and tool open state per session key, but does not save the scroll offset. When the session remounts, there is no saved position to restore, and the shouldAnchorBottom() logic kicks in, scrolling to the end.

Additionally, window.history.scrollRestoration is explicitly set to "manual" in use-session-hash-scroll.ts, so the browser's native scroll restoration is disabled.

Platform

Web app (http://localhost:4444)

OpenCode version

dev (current HEAD)

Activity

  1. github-actions commented on Oct 16, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions