TUI: extend LayoutBudget with horizontal geometry#646
Open
TZZheng wants to merge 1 commit into
Open
Conversation
This was referenced Jul 15, 2026
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
LayoutBudgetfrom vertical-only sizing to one two-axis geometry contractChildWindowSize()content rectangletui/internal/tui/ANATOMY.mdPart of #645 (the third independent root PR in the issue's implementation DAG). This PR does not add the rail widget, Agent selection, input rerouting, or thread/cache behavior.
Behavior and scope
resolveHorizontalLayoutowns the one allowed horizontal partition. A rail is visible only for an allowed view and only when its requested width leaves at least the minimum chat width; hidden rails consume zero columns.App.layoutBudget()formally requests a zero-width rail in this PR, so Mail and non-Mail views retain the full terminal width.The named
minimumChatWidthdefault is 60 columns. It is currently inert because the requested rail width is zero; the threshold and exact partition behavior are covered directly for later visible-rail work.Test-first evidence
Before implementation, the focused contract suite was written and run against base
d0167c35d696654899678e5a5498df04ebab6492:It exited
1after compiling and executing. The intended failures were that the baseLayoutBudgethad noTerminalWidth,MinChatWidth, orContentWidthfields; this was not a syntax, import, dependency, environment, or unrelated flaky-test failure. The contemporaneous RED record has SHA-25690ead718729e5924e89a74516054f8a4df6fb9e4f882694b55b4b5bf77f25384.The initial RED tests used reflection so they could compile against missing fields. After implementation, the committed tests were tightened to direct typed field access.
Validation
Exact candidate:
3c03fe0494870e1d8247d1c7b58b714d4996b606All passed. The repository-shipped anatomy citation checker also passed with no missing or out-of-range targets, and the changed production-file citations were semantically inspected.
Independent read-only review of this exact HEAD:
gpt-5.6-sol, high reasoning): PASS, no blockers; independently ran focused/full tests, vet, formatting, citation, and cleanliness checksBoth reviewers explicitly judged the inactive 60-column minimum acceptable for this foundation PR.
Cleanup and bridge ledger
Rollback
Reverting this commit restores the former height-only budget and single-width forwarding. No persistence or data migration is involved.