fix: slash command behavior

This commit is contained in:
Nate 2025-08-21 16:14:32 -07:00
parent 805668bebc
commit 7281a2f078

View file

@ -152,6 +152,17 @@ const UserInput: React.FC<UserInputProps> = ({
}
}
// Check if there are any matching commands
const filteredCommands = allCommands.filter((cmd) =>
cmd.name.toLowerCase().includes(afterSlash.toLowerCase()),
);
// If no commands match, hide the dropdown to allow normal Enter behavior
if (filteredCommands.length === 0) {
setShowSlashCommands(false);
return;
}
// Show selector for partial matches
setShowSlashCommands(true);
setSlashCommandFilter(afterSlash);