From ad07bb2892eccfef921640f2f07cca20641d391a Mon Sep 17 00:00:00 2001 From: branchseer Date: Fri, 13 Mar 2026 08:50:24 +0800 Subject: [PATCH] ux: hint Escape key when no tasks match in interactive selector When a user runs a non-existent task (e.g. `vp run zzzzz`), the interactive selector shows "No matching tasks." which can make users think the command is hanging. Adding "Press Escape to clear search." gives an actionable next step. Co-Authored-By: Claude Opus 4.6 --- crates/vite_select/src/interactive.rs | 2 +- .../interactive enter with no results does nothing.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/vite_select/src/interactive.rs b/crates/vite_select/src/interactive.rs index 5574fc2b..45e2c16f 100644 --- a/crates/vite_select/src/interactive.rs +++ b/crates/vite_select/src/interactive.rs @@ -434,7 +434,7 @@ pub fn render_items(writer: &mut impl Write, params: &RenderParams<'_>) -> anyho // Empty state if !has_items { - write!(writer, " No matching tasks.{line_ending}")?; + write!(writer, " No matching tasks. Press Escape to clear search.{line_ending}")?; lines += 1; } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap index 6d57a6bf..0d5fa856 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/interactive enter with no results does nothing.snap @@ -25,7 +25,7 @@ Select a task (↑/↓, Enter to run, type to search): @ expect-milestone: task-select:zzzzz:0 Select a task (↑/↓, Enter to run, type to search): zzzzz - No matching tasks. + No matching tasks. Press Escape to clear search. @ write-key: enter @ write-key: escape @ expect-milestone: task-select::0