feat(huh prompter): add placeholder to search input
Add 'Type to search, Ctrl+U to clear' placeholder to the MultiSelectWithSearch search input. Set WithWidth(80) in the test harness to prevent textinput placeholder rendering panics when there is no terminal. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
38e10d5ebf
commit
f38abbe1ca
2 changed files with 2 additions and 1 deletions
|
|
@ -227,6 +227,7 @@ func (p *huhPrompter) buildMultiSelectWithSearchForm(prompt, searchPrompt string
|
|||
huh.NewGroup(
|
||||
huh.NewInput().
|
||||
Title(searchPrompt).
|
||||
Placeholder("Type to search, Ctrl+U to clear").
|
||||
Accessor(queryAccessor),
|
||||
huh.NewMultiSelect[string]().
|
||||
Title(prompt).
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ func newTestHuhPrompter() *huhPrompter {
|
|||
func runForm(t *testing.T, f *huh.Form, ix interaction) {
|
||||
t.Helper()
|
||||
r, w := io.Pipe()
|
||||
f.WithInput(r).WithOutput(io.Discard)
|
||||
f.WithInput(r).WithOutput(io.Discard).WithWidth(80)
|
||||
|
||||
errCh := make(chan error, 1)
|
||||
go func() { errCh <- f.Run() }()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue