Skip to content

Preserve rendered Markdown scroll position when switching files or threads #43237

Duplicate

Description

@Wraient

Problem

The rendered Markdown preview in the right sidebar loses its vertical reading position when navigating away and returning. This interrupts reading long Markdown files and requires manually finding the previous section again.

Reported in the desktop app. Source inspection of upstream main at 7deb51b5503c172eb3abddc6f0efec701e685cd4 found that source/code views have per-file scroll restoration within a mounted file panel, but rendered Markdown does not use that mechanism. This report has not been independently reproduced in a live UI run.

Steps to reproduce

  1. Open a long Markdown file in the right sidebar with rendered Markdown enabled.
  2. Scroll well down the document.
  3. Open another file, then return to the original Markdown file.
  4. Repeat by switching to another thread and returning to the original thread and Markdown file.

Actual behavior

The rendered Markdown preview returns to the beginning instead of the previous reading position.

Expected behavior

Remember and restore the rendered Markdown preview's vertical scroll position when returning after switching files or threads, including when navigation recreates the preview panel. Keep positions associated with the correct thread, workspace, and file so unrelated documents do not inherit each other's position.

Acceptance criteria

  • Switching from rendered Markdown file A to file B and back restores A's vertical position.
  • Switching to another thread and back restores the original rendered Markdown file's vertical position, including when the other thread has no file preview open or uses another workspace.
  • Different Markdown files and threads retain their own positions.
  • A file with no saved position opens at the top; a saved position beyond the end of a shortened file is safely clamped.
  • Restoration works with the virtualized/chunked Markdown renderer after content has loaded.

Activity

  1. juliusmarminge commented on Nov 26, 2026

    @juliusmarminge
    Member

    This is the same problem as #22300, so I'm closing it in favour of that one. If it is different, say how and it will be reopened.

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