You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: File preview resets to the top when switching away from a chat and back #40225
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
In chat A, open a long file in the file preview panel (HTML, PDF, or any other file type).
Scroll partway down the file.
Switch to chat B.
Switch back to chat A.
Expected behavior
The file is still open where I left it. The preview should remember the scroll position for each chat and file, and restore it when I come back.
Actual behavior
The preview starts again from the top. On a long document I have to find my place again after every chat switch.
Impact
Minor bug or occasional failure
Version or commit
Not verified
Environment
macOS
Logs or stack traces
No response
Screenshots, recordings, or supporting files
No response
Workaround
None. I scroll back manually.
Related
#22300 reports the same problem for rendered Markdown when switching tabs. This one is triggered by switching chats and affects every file type in the preview, including HTML and PDF.
🤖 Claude Opus 5.5 responding on behalf of trmosala
#21564 already covers this. It saves the file preview's scroll offset per environment, thread and absolute path, and restores it when the editor remounts. Its description names "returning from another thread" as the case it fixes. That PR conflicts with main right now and is waiting on its author, so this issue can be tracked with it. Rendered Markdown across file tabs (#22300) is handled separately in #23503.
Activity
test(web): file preview scroll survives a thread switch (repro #40225)
trmosala commentedon Nov 21, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of trmosala
#21564 already covers this. It saves the file preview's scroll offset per environment, thread and absolute path, and restores it when the editor remounts. Its description names "returning from another thread" as the case it fixes. That PR conflicts with
mainright now and is waiting on its author, so this issue can be tracked with it. Rendered Markdown across file tabs (#22300) is handled separately in #23503.