Repository navigation
Fix TUI sizing: borders, input width, wrapping, wide runes - #32
Merged
Merged
Conversation
- Style Width and Height include the border, as in the browser: a bordered Width 20 Box or Text is 20 cells, and a bordered Fill box no longer overflows the terminal. Box inner sizes subtract the border. - An Input with Style.Width scrolls its value within the width instead of wrapping onto extra rows. - TextArea wraps long lines before clipping to Rows, so it keeps its height. - A Card title longer than Style.Width is truncated instead of widening the card. - An unsized Divider spans its pane, not the terminal, so it no longer breaks Split and Sidebar rows. - A wrapping Row that collapses re-renders its children at the column width, so Responsive content picks the variant for the space it has. - The status bar and divider labels measure and truncate by display cells, so wide glyphs no longer push the frame past the terminal. Closes #27
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
Fixes #27, from the TUI audit.
Width: 20Box or Text was 22 cells, and a borderedFillbox overflowed the terminal.styleToLipglosssubtracts the border, and Box inner sizes account for it.textinputwidth, so a long value scrolls instead of wrapping onto 3 rows.Rows, so it keeps its height.Style.Widthare truncated instead of widening the card.availWidth), not the terminal. It used to breakSplitandSidebarrows.x/ansi, already an indirect dependency, now direct), so CJK and emoji no longer push the frame past the terminal.Test plan
sizing_test.go, one test per item. All seven fail on main.go test -race ./...,make e2e, both vets