Skip to content

editor: conflict compare unsaved pane still opens scrolled to bottom #984

Description

@drawmeanelephant

Summary

Retest of #975 / PRs #981#982 on main (23ccd757) found the conflict compare unsaved pane still opens scrolled near the bottom. The disk pane correctly starts at scrollTop === 0.

Observed: #unsaved-version.scrollTop ≈ 6490 with scrollHeight ≈ 6696 on first open after dirty + external edit. Left column shows the typed tail; right column shows the file head — easy to misread as a large structural diff.

Repro

  1. Launch boris-editor against the repo.
  2. Open a reasonably long content file; dirty the buffer near the end.
  3. Change the same file on disk externally so the conflict dialog opens.
  4. Inspect #unsaved-version vs #disk-version scrollTop (or just look at the two columns).

Expected

Both compare panes start at the top when the dialog opens (or stay scroll-synced).

Actual

Disk pane top; unsaved pane near end. $effect in editor/ui/src/dialogs/ConflictDialog.svelte already sets scrollTop = 0 when content flags change, but deps are buffer.content / conflict content / deleted flag — not the textarea element refs. showModal focusing #unsaved-version can jump caret/scroll to the end after that reset.

Suggestion

Reset after mount/focus: include textarea refs in the effect, or await tick() after showModal and force both panes to 0 again. Add a Playwright assertion that both #unsaved-version and #disk-version have scrollTop === 0 on first open.

Evidence

Hands-on retest 2026-09-13; report /workspace/boris-editor-retest.md (local). Related closed umbrella: #975.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions