fix: arrange the tree on every render pass, not only on a resize - #185
Merged
Merged
Conversation
Layout only ran when the root had no size yet or the terminal was resized, so an element shown after the first frame, text that changed length, or a root the host sized itself were drawn with stale geometry. SyncRootToConsole now adopts the terminal size under the same rules as before but always walks the tree. Fixes #133 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4JLDZ8V6BpUZBB9ZnsaNt
|
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.



Fixes #133
What was wrong
UIApplication.SyncRootToConsoleranArrangeTreeonly when the root had no size yet or the terminal had been resized. After the first frame, any other change to the tree kept its old layout:IsVisible = truekept its empty size and was never drawnChange
ArrangeTree(root)now runs on every pass. Each pass already clears and redraws the whole screen, so an extra arrange costs little by comparison.Tests
UIApplicationLayoutTestsadds three tests: the two reproductions from the issue, and one where text grows and moves its sibling.TUI.Testsuite passes, 224 tests, including the existing resize tests andRenderWithoutAResizeLeavesAHostAssignedRootSizeAlone.🤖 Generated with Claude Code
https://claude.ai/code/session_01F4JLDZ8V6BpUZBB9ZnsaNt
Generated by Claude Code