Repository navigation
fix(native): fit the terminal to the sidebar's destination as it starts moving - #923
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 refitrefitSettle(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.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.sidebarMorph.holdsStage,landed), through theterminals.refitNowthat 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:stageRowreads 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 ./...innative/TestSidebarMorphFitsTheTerminalToWhereItEndsAsItStarts(fails withstageOverhangreturning 0)