Skip to content

Bug: CodeView markdown remount scroll position jumping #1030

Description

@aagrawal05

Prerequisites

Describe the issue

When viewing diffs with richly rendered markdown, scrolling to bottom then scrolling back up, markdown stops rendering(?), the scroll position is lost jumping upwards to compensate for the change in scroll height, then markdown re-renders(?) — video shows this effect much more clearly.

Reproduction

Can reproduce in codiff v1.9.1 very regularly with large md/source changes

Preliminary AI audit of the DOM:
CodeView loses the scroll position when a tall asynchronous line annotation leaves the rendered window and remounts. In the reproduction, the annotation was initially measured at 1,395px, but its 180px loading placeholder was committed during remount. This reduced scrollHeight from 4,745px to 3,530px and moved scrollTop from 1,301px to 86px. The full height returned after loading, but the original scroll position did not.

Screen.Recording.2026-07-24.at.9.37.10.PM-github.mp4

What browser(s) are you seeing the problem on?

Electron/Chromium

What version of @pierre/diffs are you using?

@pierre/diffs@1.3.0-beta.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions