Skip to content

Commit f38abbe

Browse files
BagToadCopilot
authored andcommitted
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>
1 parent 38e10d5 commit f38abbe

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

internal/prompter/huh_prompter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func (p *huhPrompter) buildMultiSelectWithSearchForm(prompt, searchPrompt string
227227
huh.NewGroup(
228228
huh.NewInput().
229229
Title(searchPrompt).
230+
Placeholder("Type to search, Ctrl+U to clear").
230231
Accessor(queryAccessor),
231232
huh.NewMultiSelect[string]().
232233
Title(prompt).

internal/prompter/huh_prompter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func newTestHuhPrompter() *huhPrompter {
113113
func runForm(t *testing.T, f *huh.Form, ix interaction) {
114114
t.Helper()
115115
r, w := io.Pipe()
116-
f.WithInput(r).WithOutput(io.Discard)
116+
f.WithInput(r).WithOutput(io.Discard).WithWidth(80)
117117

118118
errCh := make(chan error, 1)
119119
go func() { errCh <- f.Run() }()

0 commit comments

Comments
 (0)