charmbracelet / bubbles

TUI components for Bubble Tea 🫧
MIT License
5.56k stars 264 forks source link

help: rendering issues when the text doesn't fit into the available width #461

Open BommerG opened 9 months ago

BommerG commented 9 months ago

Describe the bug the help bubble shows strange behavior when the text to display doesn't fit into the available width. short help: word wrap happens in certain situations before the ellipsis is displayed full help: there seems to be an invisible tail which gets wrapped in certain situations. full help: word wrap happens in certain situations before the last column is dropped see also: https://github.com/BommerG/list-default

Setup Please complete the following information along with version numbers, if applicable.

To Reproduce Steps to reproduce the behavior:

  1. run the example code
  2. change the width of your terminal window to force the help bubble to reduce the output
  3. you should see that the left and the right frame don't have the same height in certain situations

Source Code https://github.com/BommerG/list-default/blob/main/main.go

Expected behavior the help bubble should always react correctly to the changing width and avoid word wrap or any other behavior that could disturb the correct rendering of the help text.

Screenshots https://github.com/BommerG/list-default/blob/main/line_wrap.png https://github.com/BommerG/list-default/blob/main/imaginary_word_wrap.png https://github.com/BommerG/list-default/blob/main/full_help_word_wrap.png

Additional context I'm new to bubbletea and go in general.