From 4323babfb95d4c64497b01190933dc88f6ad3e28 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Fri, 25 Sep 2026 18:20:04 -0400 Subject: [PATCH] fix(composer): a fully typed user ID + Enter sends as typed d2503332 made Enter pick the mention suggestion, which also caught "/kick @alice:server" + Enter (the e2e "/kick failure is reported" test): typing a complete ID opens the mention list too, and Enter picked it instead of running the command. Enter now picks only while a partial name is being typed (no ':' in the query); a complete @user:server or #alias:server sends as typed, like before. Chromium e2e 19 passed; "@bo" + Enter still picks, ":smi" + Enter still sends. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- .../editor/autocomplete/RoomMentionAutocomplete.tsx | 3 ++- .../editor/autocomplete/UserMentionAutocomplete.tsx | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/components/editor/autocomplete/RoomMentionAutocomplete.tsx b/src/app/components/editor/autocomplete/RoomMentionAutocomplete.tsx index 91fffbab0..2935245ac 100644 --- a/src/app/components/editor/autocomplete/RoomMentionAutocomplete.tsx +++ b/src/app/components/editor/autocomplete/RoomMentionAutocomplete.tsx @@ -140,7 +140,8 @@ export function RoomMentionAutocomplete({ }; useKeyDown(window, (evt: KeyboardEvent) => onTabPress(evt, pickTop)); - useAutocompleteEnter(true, pickTop); + // Same rule as people: a fully typed #alias:server sends as typed. + useAutocompleteEnter(!query.text.includes(':'), pickTop); return ( Rooms} requestClose={requestClose}> diff --git a/src/app/components/editor/autocomplete/UserMentionAutocomplete.tsx b/src/app/components/editor/autocomplete/UserMentionAutocomplete.tsx index 9ab348290..48fbbb070 100644 --- a/src/app/components/editor/autocomplete/UserMentionAutocomplete.tsx +++ b/src/app/components/editor/autocomplete/UserMentionAutocomplete.tsx @@ -140,9 +140,9 @@ export function UserMentionAutocomplete({ }; useKeyDown(window, (evt: KeyboardEvent) => onTabPress(evt, pickTop)); - // The list always shows a suggestion (a member, or the typed id), so Enter - // always picks rather than sending "hey @bo". - useAutocompleteEnter(true, pickTop); + // Enter picks while a partial name is being typed ("hey @bo"). Once a full + // user ID has been typed ("/kick @alice:server"), Enter sends as typed. + useAutocompleteEnter(!query.text.includes(':'), pickTop); const getName = (member: RoomMember) => getMemberName(room, member.userId);