Skip to content

fix(native): fit the terminal to the sidebar's destination as it starts moving - #923

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

omartelo merged 1 commit into
mainfrom
fix/sidebar-open-terminal-refit

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #920, the same hitch on the sidebar. Through a morph the stage keeps the narrower sidebar shape's reserve (stageReserve), so it resizes once: as a collapse starts, or once an expand lands. Expanding, the terminal therefore sat at its old width through the morph and refit refitSettle (100 ms) after it landed, then the agent redrew. Measured on a rig: refit at +303 ms on expand (morph ends at ~200 ms), +113 ms on collapse.

  • A lone session's terminal subtracts sidebar.stageOverhang, how much wider the stage is than where the morph leaves it, so it takes the expanded width from the morph's first frame. The island keeps sliding with the sidebar's edge; its fill shows past the narrower grid.
  • The refit skips the debounce on every frame the morph holds the stage at one size and on the frame it lands in (sidebarMorph.holdsStage, landed), through the terminals.refitNow that fix(native): fit the terminal to the dock's destination as it starts sliding #920 added for the dock. A split layout, which still follows the stage, refits on the landing frame.

After, on the same rig: expand refits at +9 ms, collapse at +10 ms, a split expand on the landing frame (+234 ms) with no extra 100 ms.

Test changed

stageFrames (stale_chrome_test.go) now gives its window a sidebar: stageRow reads the sidebar's morph, and the fixture's window had none, which the real window never lacks. No assertion changed.

Test plan

  • gofmt, go vet ./..., go test ./... in native/
  • New TestSidebarMorphFitsTheTerminalToWhereItEndsAsItStarts (fails with stageOverhang returning 0)
  • Rig on its own backend in a virtual display with a per-frame trace, lone session and split, both directions; burst captures show the shell's prompt redrawn at the new width while the sidebar is still opening

…ts moving

Through an expand the stage keeps the collapsed sidebar's width and only
shrinks once the morph lands, so the terminal refit refitSettle after
that and jumped. A lone session's terminal now takes the expanded width
from the morph's first frame (sidebar.stageOverhang), and every frame the
morph holds the stage still, plus the one it lands in, refits at once.
@omartelo
omartelo merged commit 564f74c into main Oct 23, 2026
7 checks passed
@omartelo
omartelo deleted the fix/sidebar-open-terminal-refit branch October 23, 2026 15:04
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