Skip to content

fix: Enter key sends message when slash input matches no registered command#2867

Merged
dokterbob merged 1 commit intoChainlit:mainfrom
nzjrs:fix/enter-sends-unregistered-slash-input
Apr 1, 2026
Merged

fix: Enter key sends message when slash input matches no registered command#2867
dokterbob merged 1 commit intoChainlit:mainfrom
nzjrs:fix/enter-sends-unregistered-slash-input

Conversation

@nzjrs
Copy link
Copy Markdown
Contributor

@nzjrs nzjrs commented Mar 30, 2026

The Enter guard in the message composer checked !showCommands, but showCommands is set to true whenever the input is a single word starting with /. this blocked Enter from sending even when the typed slash-word matched zero registered commands e.g. the dropdown was not visible, yet the key was swallowed. this is a bug because it prevents users from sending LLM-directed slash commands (e.g. /admin /whatsnew) that are not registered as Chainlit UI commands.

fix: only block Enter when the command dropdown is actually rendered, i.e. when showCommands is true AND filteredCommands is non-empty. no change in behavior when the slash-word matches a registered command -- the dropdown still captures Enter for selection as before.


Summary by cubic

Fixes the message composer so Enter sends the message when a single-word slash input matches no registered command. Enter is only blocked when the command dropdown is visible (when showCommands is true and filteredCommands has items); behavior is unchanged for real commands.

Written for commit ac12cf2. Summary will update on new commits.

…ommand

the Enter guard in the message composer checked !showCommands, but
showCommands is set to true whenever the input is a single word
starting with /. this blocked Enter from sending even when the typed
slash-word matched zero registered commands -- the dropdown was not
visible, yet the key was swallowed. this is a bug because it prevents
users from sending LLM-directed slash commands (e.g. /podcast, /admin)
that are not registered as Chainlit UI commands.

fix: only block Enter when the command dropdown is actually rendered,
i.e. when showCommands is true AND filteredCommands is non-empty. no
change in behavior when the slash-word matches a registered command --
the dropdown still captures Enter for selection as before.
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working frontend Pertains to the frontend. labels Mar 30, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Copy Markdown
Contributor

@hayescode hayescode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed via Codex

LGTM.

@dokterbob dokterbob added this pull request to the merge queue Apr 1, 2026
Merged via the queue into Chainlit:main with commit 6b168b8 Apr 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Pertains to the frontend. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants