Skip to content

fix(web-ui): snap chat to bottom instantly on pane tab re-activation - #565

Merged
16francej merged 2 commits into
mainfrom
tab-scroll-snap
Aug 17, 2026
Merged

fix(web-ui): snap chat to bottom instantly on pane tab re-activation#565
16francej merged 2 commits into
mainfrom
tab-scroll-snap

Conversation

@16francej

Copy link
Copy Markdown
Contributor

Problem

Switching back to a chat tab in a split layout animates a smooth scroll from the top to the bottom of the transcript instead of opening already at the bottom.

Root cause

dockview hides inactive tab panels with display:none. A re-shown pane has lost its scroll position; the ResizeObserver-driven redraw then catches up through .chat-scroll's scroll-behavior: smooth, producing the animated scroll. A hidden pane also measures 0x0, leaving density at 'strip', so density must be resynced before the forced redraw or the snap is skipped.

Fix

On onDidVisibilityChange, redraw already-loaded panes with forceScroll: true (after resyncing density), which snaps via scroll-behavior: auto. First show still loads as before.

Tests

  • New test/tab-switch-scroll-snap.test.ts covering the forced redraw ordering and the auto-behavior snap path.
  • Updated split-canvas-entry.test.ts to the new handler shape.

Josh France added 2 commits August 17, 2026 18:04
Dockview hides inactive tab panels with display:none, so a re-shown pane
loses its scroll position and the ResizeObserver-triggered redraw catches
up through the smooth-scroll path (.chat-scroll has scroll-behavior:
smooth), visibly animating to the bottom. Re-activating an already-loaded
pane now resyncs density (a hidden pane measured 0x0) and redraws with
forceScroll, which snaps with scroll-behavior:auto.
@16francej
16francej merged commit 4930d60 into main Aug 17, 2026
21 checks passed
@16francej
16francej deleted the tab-scroll-snap branch August 17, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant