Skip to content

[Bug]: File preview resets to the top when switching away from a chat and back #40225

Open

Description

@ishanavasthi

Before submitting

  • 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

  1. In chat A, open a long file in the file preview panel (HTML, PDF, or any other file type).
  2. Scroll partway down the file.
  3. Switch to chat B.
  4. 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.

Activity

  1. trmosala commented on Nov 21, 2026

    @trmosala

    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 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.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions