Skip to content

Hide "Did you mean:" when there are no fuzzy match suggestions#212

Merged
branchseer merged 1 commit intomainfrom
claude/hide-did-you-mean-1KmSm
Mar 10, 2026
Merged

Hide "Did you mean:" when there are no fuzzy match suggestions#212
branchseer merged 1 commit intomainfrom
claude/hide-did-you-mean-1KmSm

Conversation

@branchseer
Copy link
Copy Markdown
Member

Summary

Improved the user experience when a task name is not found by only showing the "Did you mean:" suffix when there are actual fuzzy match suggestions to display. Previously, the suffix would appear even when no matching tasks existed, creating a confusing empty suggestion list.

Key Changes

  • vite_task/src/session/mod.rs: Modified the non-interactive error header generation to check if fuzzy matches exist before appending "Did you mean:" suffix. When no suggestions are available, the header now simply states "Task not found." without the misleading suffix.
  • vite_select/src/lib.rs: Added early return in non-interactive mode when the filtered items list is empty. This prevents rendering a redundant "No matching tasks." message after the "not found" header, keeping the output clean and focused.
  • tests/e2e_snapshots/: Added a new test case "non-interactive no suggestions" to verify the behavior when a typo has no fuzzy matches, ensuring the output only shows the "not found" message without suggestions.

Implementation Details

The fix involves two coordinated changes:

  1. Before rendering the "Did you mean:" header, the code now performs a fuzzy match against available task labels to determine if suggestions actually exist
  2. The select module's non-interactive path now exits early when no matches are found, preventing the display of unhelpful "No matching tasks." text

https://claude.ai/code/session_01QVjgsRa8uw66PsSyAJNBjp

When a typo has no fuzzy matches, show only "Task X not found." instead
of "Task X not found. Did you mean:" with an empty list.

https://claude.ai/code/session_01QVjgsRa8uw66PsSyAJNBjp
@branchseer branchseer requested a review from fengmk2 March 10, 2026 03:39
@branchseer branchseer merged commit 4bbcba1 into main Mar 10, 2026
6 checks passed
@branchseer branchseer deleted the claude/hide-did-you-mean-1KmSm branch March 10, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants