fix: Enter key sends message when slash input matches no registered command#2867
Merged
dokterbob merged 1 commit intoChainlit:mainfrom Apr 1, 2026
Merged
Conversation
…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.
hayescode
approved these changes
Apr 1, 2026
Contributor
hayescode
left a comment
There was a problem hiding this comment.
Reviewed via Codex
LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Enter guard in the message composer checked
!showCommands, butshowCommandsis 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
showCommandsis true ANDfilteredCommandsis 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
showCommandsis true andfilteredCommandshas items); behavior is unchanged for real commands.Written for commit ac12cf2. Summary will update on new commits.