jupyterlab/jupyterlab

Switching to markdown preview is slow; the scroll position gets lost

Open

#13,678 opened on Dec 29, 2022

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (13,454 stars) (2,937 forks)batch import
bughelp wantedpkg:markdownviewertag:Performance

Description

Description

Switching tabs to markdown viewer is slow. It takes ~11 partially presented frames and renderMarkdown gets called twice.

Reproduce

  1. Open JupyterLab README.md with right click: "Open With" → "Markdown Preview"
  2. Open a new launcher
  3. Switch back and forth
  4. See that the markdown tab contents flickers

Screenshot from 2022-12-29 13-51-24

Screenshot from 2022-12-29 13-56-06

For scroll position not being preserved see:

scroll-position-md

Expected behavior

  • We should not need to invalidate the rendered markdown when switching back and forth and definitely we should not call renderMarkdown twice.
  • The scroll position should be preserved.

Context

  • JupyterLab version: 4.0.0a31 and 3.x

Contributor guide