Skip to content

Keep panel drags smooth while the terminal is open - #427

Merged
broisnees merged 1 commit into
nightlyfrom
fix/panel-resize-fps
Nov 24, 2026
Merged

broisnees merged 1 commit into
nightlyfrom
fix/panel-resize-fps

Conversation

@broisnees

Copy link
Copy Markdown
Collaborator

Dragging the terminal dock, a sidebar or a split pane refit the terminal and reallocated the data grid's canvas every frame. Drags dropped well below the display rate on every OS.

  • A drag is now tracked in panel-motion.js (beginPanelResize / endPanelResize, ref-counted, data-resizing on <html>, a stroke:panel-resize-end event on release).
  • The terminal holds its grid during a drag and refits once on release. Its fit() uses xterm's cell size instead of FitAddon.fit(), so no forced style recalc and no blank frame. The PTY gets the final size once.
  • Window resizes: one change fits at once, a stream of changes debounces 100ms.
  • The data grid grows its canvas in 256px steps during a drag and skips repaints when the viewport only shrank.
  • The terminal dock uses ResizeHandle with a wider grab area. Double-click resets it to 260px, and the height persists in layout.js.

#426 carries a copy of this PR's StudioShell dock hunks (they were swept into its commit) and imports layout.js exports that only exist here, so this PR merges first. The hunks are identical, so #426 merges cleanly after it.

Checked: design lint, both vitest suites (2014 + 20), npm run build.

Dragging the terminal dock, a sidebar or a split pane refit xterm and
reallocated the data grid's canvas on every frame, which dropped the
drag well below the display rate on Linux, Windows and macOS.

beginPanelResize/endPanelResize in panel-motion.js ref-count an active
drag, set data-resizing on <html> and fire stroke:panel-resize-end on
release. ResizeHandle and PaneLayout call them and use pointer capture
with pointercancel and lostpointercapture, so a drag always ends.

TerminalPage holds its grid while a drag runs and refits once on
release. Its fit() works from xterm's cell size instead of
FitAddon.fit(), which forced style recalcs and cleared the renderer
before each resize. Window resizes fit at once for a single change and
debounce 100ms while the size keeps changing. The PTY hears the final
size once.

DataTable grows its canvas backing store in 256px steps during a drag
and skips the repaint when the viewport only shrank.

The terminal dock uses ResizeHandle (wider grab area, double-click
resets to 260px) and its height is clamped and persisted in layout.js.
@broisnees broisnees added the release:skip Merge into nightly without a version bump (docs, CI, chores) label Nov 24, 2026
@broisnees
broisnees merged commit 4f45926 into nightly Nov 24, 2026
1 check passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release:skip Merge into nightly without a version bump (docs, CI, chores)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant