Skip to content

fix(native): fit the terminal to the dock's destination as it starts sliding - #920

Merged
omartelo merged 1 commit into
mainfrom
fix/dock-slide-terminal-refit
Oct 23, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/dock-slide-terminal-refit

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

Opening or closing the dock had a hitch right after it stopped. The slide itself is cheap (about 0.5 ms of layout per frame); the hitch was the session's terminal. While the dock moved, the island's width changed every frame, so the terminal's refit stayed debounced (refitSettle, 100 ms, meant for dragging an edge). Once the dock landed, the terminal sat clipped at its edge for another 100 ms, then refit and the agent redrew the whole screen.

  • A lone session's terminal is laid out at the width the slide ends at from the slide's first frame (island takes a termWidth). Opening, the island's fill shows past the narrower grid; closing, the island clips the wider one as the dock slides away. The agent redraws while the dock is still moving.
  • The refit skips the debounce on the frames a slide begins or ends (dockSlide.began / landed, read through terminals.refitNow). A drag of the dock's edge keeps the debounce.
  • A split layout still follows the island's width during the slide, since each pane would need its own destination width; its terminals refit on the frame the dock lands, without the extra 100 ms.

Test plan

  • gofmt, go vet ./..., go test ./... in native/
  • New TestDockSlideMarksTheFramesItBeginsAndEnds
  • Rig on its own backend in a virtual display with a per-frame trace: the 100 ms frameless gap after the slide is gone, and the refit lands on the slide's first frame; burst captures with man ls show the text rewrapped before the dock finishes sliding in
  • Reviewed by the maintainer in a real window

…sliding

The terminal held its refit back for refitSettle after the dock stopped,
so it sat clipped at the dock's edge and then jumped while the agent
redrew. A lone session's terminal now takes the width the slide ends at
on its first frame, and a split layout refits on the frame the dock
lands.
@omartelo
omartelo merged commit fa2d324 into main Oct 23, 2026
7 checks passed
@omartelo
omartelo deleted the fix/dock-slide-terminal-refit branch October 23, 2026 14:28
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