From f38abbe1ca5c2e5585619718cade063e334c9ea6 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Thu, 19 Mar 2026 14:31:37 -0600 Subject: [PATCH] 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> --- internal/prompter/huh_prompter.go | 1 + internal/prompter/huh_prompter_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/prompter/huh_prompter.go b/internal/prompter/huh_prompter.go index a443f0820..95bf43fab 100644 --- a/internal/prompter/huh_prompter.go +++ b/internal/prompter/huh_prompter.go @@ -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). diff --git a/internal/prompter/huh_prompter_test.go b/internal/prompter/huh_prompter_test.go index 7b5217d5e..e039038ad 100644 --- a/internal/prompter/huh_prompter_test.go +++ b/internal/prompter/huh_prompter_test.go @@ -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() }()