From 8536dc3c8cee99d7e453bd1e8ccc9126a809162f Mon Sep 17 00:00:00 2001 From: Chad Metcalf Date: Tue, 5 Aug 2025 16:04:26 -0700 Subject: [PATCH] fix: keep slash command suggestions visible when typing exact command names (#157) Previously, typing "/org" would hide the suggestion immediately upon completion. Now suggestions only disappear when user presses space or Enter, making it clearer that the command is available to execute. Fixes UX issue where users lose visual confirmation of valid commands. --- src/ui/UserInput.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/UserInput.tsx b/src/ui/UserInput.tsx index 8b602d649..072c7e950 100644 --- a/src/ui/UserInput.tsx +++ b/src/ui/UserInput.tsx @@ -105,13 +105,13 @@ const UserInput: React.FC = ({ const allCommands = getSlashCommands(); const exactMatch = allCommands.find((cmd) => cmd.name === afterSlash); - // Hide selector if we have an exact match and there's more content after the cursor + // Hide selector if we have an exact match and there's a space after cursor if (exactMatch) { const restOfText = text.slice(cursor); - // If there's a space immediately after cursor, or we're at end of line/text, hide selector + // Only hide if there's a space or newline immediately after cursor + // Don't hide just because we're at the end - user might want to see the suggestion if ( restOfText.startsWith(" ") || - restOfText === "" || restOfText.startsWith("\n") ) { setShowSlashCommands(false);