Repository navigation
Description
Description
Switching to another session tab and then back drops the timeline to the bottom of the conversation instead of returning to the scroll position I left, so reading position in long sessions is lost every time I switch tabs.
This has been reported repeatedly (#42213, #45212, #35377, #44152, #42806) and closed as completed or not planned, but it still reproduces on desktop 1.18.34 and there is no per-session scroll restoration in the current dev source, so this is a report of the behaviour still being live rather than a new request.
Steps to reproduce
- Open a session with a long conversation (long enough that the timeline scrolls).
- Scroll up to an earlier position — leave the viewport in the middle of the output, not at the bottom.
- Click a different session tab in the titlebar tab strip.
- Click back to the original tab.
Happens every time, in any session with a scrollable timeline. It also happens when the session is idle and finished streaming.
Expected behaviour
The timeline returns to the scroll position left when the tab was last active. Scrolling to the bottom before switching away should still return to the bottom (following the newest content).
Current behaviour
The timeline jumps to the bottom of the conversation. The user has to scroll back up to find the position they were reading.
Environment
- UI: OpenCode Desktop 1.18.34 (macOS 27.0.0, arm64), installed from the direct download
- OS: macOS 27.0.0 (arm64)
- Reproduced on latest release 1.18.35, and the behaviour is present in the
devsource
Notes from reading the source
- Session tabs are router routes (
/server/:serverKey/session/:idinpackages/app/src/shell/routes/routes.tsx), so only the active session's DOM is mounted and the previous timeline — including itsscrollTop— is torn down on switch. - The timeline's follow state starts as
pinned: trueper session (packages/app/src/session/timeline/interaction.ts), which follows the newest content, so a remounted timeline lands at the bottom. - The persisted window stores (
packages/app/src/shell/tabs/tabs.tsx:tabs,tabs.info,tabs.panes,tabs.closed) hold titles, panes and recently-closed tabs, but no scroll offset or pin state.
A fix would presumably persist a scroll anchor (message id / offset) and the pin state per session in the window-scoped tabs store, and restore it when the session's timeline mounts, plus keep inactive session timelines mounted if that is cheaper than restoring offsets.
Related
- [Desktop] Tab switch resets scroll position — returns to bottom instead of where you left off #42213 — same symptom on 1.18.5, closed as completed
- In the OpenCode macOS app, switching away from a tab and then back to it automatically scrolls the page to the bottom; please do not move my reading position. #45212 — same symptom on 1.18.22/1.18.25, closed as not planned
- Chat visually disappears (scrollTop resets to 0 after tab switch) #35377 — chat disappears because
scrollTopresets to 0 after a tab switch, closed as not planned - Scope terminal sidebar and session scroll state to each tab #44152 — "scope terminal sidebar and session scroll state to each tab", closed as completed with no linked PR
- bug: scroll position lost when navigating between parent and child sessions in web app #42806 — scroll position lost when navigating between parent and child sessions (open, web)
- fix(app): restore session timeline scroll position after tab switches #48125 and fix(app): preserve session scroll position #33875 — earlier attempts at restoring scroll position across tab switches, both closed without merging
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed write-up and for reading the source.
1.18.x is OpenCode v1. v1 only gets fixes for critical bugs, such as data loss, security problems, or crashes with no workaround. Losing the scroll position on a tab switch is frustrating, but it doesn't meet that bar, so it's unlikely to be fixed in v1.
We recommend upgrading to OpenCode v2 (the npm package
@opencode/cli), where active development happens. As you noted, the current v2 code doesn't seem to restore the scroll position for each session yet. If you can reproduce this on v2, please reply here with your v2 version and we'll look at it again. Please also reply if you think this is critical for you.Related issues:
gh-ppathi commentedon Oct 14, 2026
Confirming this still reproduces on OpenCode Desktop v2 (
2.0.28).Environment
2.0.28Reproduction on v2
opencode-agent commentedon Oct 14, 2026
We're closing this as not planned because we haven't heard back. The scroll position being lost on a tab switch was reported on Desktop 1.18.x. That's OpenCode v1, which only gets critical fixes.
If it still happens on OpenCode v2 (
@opencode/cli), please open a new issue with your v2 version and the same steps, and link back to this one. Thanks again for the detailed report and the source notes.