fix(ui): show command suggestions even on perfect match and sort them (#15287)

This commit is contained in:
Sandy Tao
2025-12-18 14:05:36 -10:00
committed by GitHub
parent 1e10492e55
commit 70696e364b
5 changed files with 209 additions and 11 deletions
@@ -589,7 +589,12 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
}
// If the command is a perfect match, pressing enter should execute it.
if (completion.isPerfectMatch && keyMatchers[Command.RETURN](key)) {
// We prioritize execution unless the user is explicitly selecting a different suggestion.
if (
completion.isPerfectMatch &&
keyMatchers[Command.RETURN](key) &&
(!completion.showSuggestions || completion.activeSuggestionIndex <= 0)
) {
handleSubmit(buffer.text);
return;
}