Skip to content

fix: wrap titles and descriptions when needed - #570

Merged
caarlos0 merged 6 commits into
mainfrom
wrap
Mar 13, 2025
Merged

caarlos0 merged 6 commits into
mainfrom
wrap

Conversation

@caarlos0

@caarlos0 caarlos0 commented Mar 12, 2025 •

Copy link
Copy Markdown
Contributor

closes #519
closes #570

CleanShot 2025-03-12 at 16 44 15@2x

CleanShot 2025-03-12 at 17 03 22@2x

@caarlos0 caarlos0 self-assigned this Mar 12, 2025
@caarlos0
caarlos0 requested a review from a team as a code owner March 12, 2025 19:44
@caarlos0
caarlos0 requested review from raphamorim and removed request for a team March 12, 2025 19:44
@caarlos0 caarlos0 added the bug Something isn't working label Mar 12, 2025
@caarlos0 caarlos0 changed the title fix: wrap titles and descriptions when needed. fix: wrap titles and descriptions when needed Mar 12, 2025
Comment thread wrap.go Resolved
@caarlos0
caarlos0 requested a review from aymanbagabas March 12, 2025 20:03
Comment thread examples/go.mod Resolved

@aymanbagabas aymanbagabas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than using cellbuf@v0.0.13, LGTM

@caarlos0
caarlos0 merged commit 36d9de4 into main Mar 13, 2025
@caarlos0
caarlos0 deleted the wrap branch March 13, 2025 00:06
@mrusme

mrusme commented Mar 14, 2025 •

Copy link
Copy Markdown

Tested with this piece of code:

go get -u github.com/charmbracelet/huh@main && make
		FormCup(
			cupDAO,
			&globCupEntity,
			"Drink Cup",
			"This wizard will guide through the steps to track a new cup"+
				" of coffee that was consumed.\nasdf asdf asdf sa fsad f sadfsad f asdf sad f sadfsad f asdfsdf sadfas f sa dfsadfsdf sa dfsadfas df sad fs df sdsd f ds fsd af asd f sd f sd f as f sda f sad f sda f sad f as df asdfasdf asd fas df s adfasdf sd f sad f sda f sd f sda fs asd fsafsdfsd f sdaf s daf sadfsadf sda f sadf sd af sadf sd f sd afsd f sad f sadfffffsdaffsadfsadf sdfsafsd f sdaf sadfasdfsdf sd f sdafsadfsdafs daf sadfsadf sadf asdfsdafs adf sd fsdafsadfsdafs adf sad f sdaffsdaf asdfsa dfsadfsadfsd fsdfsdfsadf sd fasdfsadfsd fsadfasdfsadf asdfasdf asdf sadfasdfasdfsadf sdafasdfsadfasdf sadf sda fasdfsadfsadfsdf asdf sadfsadfsadfsadf sdafsadfasdfsadfsad fsadfsadfsa dfasdfasdfsadfsdafsad fs dafasdfsadfsdafsdafsadfsdafsda fasdfsadfsadfsdafs dafasdfsdafsdafsdfsd f sdafsdafsadfsadfsadfsadfsadfsadf sdafsadfsdafsadfsdaf safd fasdfsdfasdfsadfsad fsadfsadfsadfsadfsdf sdf sadfad",
			accessible,
		)

....

		form := huh.NewForm(
			huh.NewGroup(
				huh.NewNote().
					Title(title).
					Description(description).
					Next(true).
					NextLabel("Let's go!"),
			),
...

screenshot_2025-03-14-140154

Did I miss anything?

//edit: The terminal is tall enough:

▲ kopi echo "$COLUMNS x $LINES"                                                      
104 x 52

@caarlos0

Copy link
Copy Markdown
Contributor Author

I cannot reproduce this.

Can you create a minimal reproducible for it? Something like this.

Also, can you try it on #573 ?

go get github.com/charmbracelet/huh@height

@mrusme

mrusme commented Mar 15, 2025

Copy link
Copy Markdown

Thank you for your suggestion.

Also, can you try it on #573 ?

I used the height branch with the previously described code and I can confirm that the button shows now. This means that the branch you linked is also necessary for #538 to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long descriptions hide the user's input

4 participants

⌂ 换网址