-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: wrapping and height calculations #485
base: main
Are you sure you want to change the base?
Conversation
This reverts commit b41c5e7.
In case we don't want to merge the stacked buttons here, I have another version of this branch where I removed those features. https://github.com/charmbracelet/huh/tree/horizontal-btns |
The grid rendering issue may be related to charmbracelet/bubbletea#573... The fourth to sixth elements are shown when I print I thought it might be related to |
Co-authored-by: Carlos Alexandro Becker <[email protected]>
Changes
Content used to cut off if the height of the window was smaller than the content height.
Wrapped content broke formatting and caused content to get cut off.
The offset calculations were off and wouldn't scroll to show hidden content.
There was an off by one error for content that exceeded the window height (would always hide the title of the first field).
Other considerations
Some fieds (confirm, select, input) have the option to be shown as inline. When shown as inline, the styles do not wrap (intentional)
Buttons will stack vertically if they don't fit horizontally. Button widths will also match (do we want that by default or only when stacked?)
Fixes
closes #398
closes #429
Maybe others (need to confirm)
Here's what this PR looks like:
https://github.com/user-attachments/assets/b3588782-33d4-4e11-8105-2f6b7335df6a
Previous behaviour:
https://github.com/user-attachments/assets/0e77808e-5895-45d4-b075-f299babecf2b
A few enhancements I'd still like to see: huh does a lot of redraws that cause rendering issues when not in alt screen. You come across that behaviour when resizing the window a lot while running an example (e.g. burger)