diff --git a/web/src/components/ChatArea.tsx b/web/src/components/ChatArea.tsx index 5cc0294..e857dcf 100644 --- a/web/src/components/ChatArea.tsx +++ b/web/src/components/ChatArea.tsx @@ -783,10 +783,23 @@ export function ChatArea() { const q = commandQuery.toLowerCase(); const filtered = SLASH_COMMANDS.filter((c) => c.name.startsWith(q)).slice(0, 8); if (filtered[dropdownIndex]) { - setInput('/' + filtered[dropdownIndex].name + ' '); + const cmd = filtered[dropdownIndex]; setCommandQuery(null); setDropdownIndex(0); - inputRef.current?.focus(); + // /poll opens modal instead of sending a message + if (cmd.name === 'poll') { + setShowPollModal(true); + setInput(''); + return; + } + // ponytail: execute the command transform directly + const args = input.startsWith('/' + cmd.name + ' ') + ? input.slice(cmd.name.length + 2).trim() + : ''; + const text = cmd.transform(args, currentUser?.username || 'user'); + sendMessage(activeChannelId!, text, replyToMessage?.id); + setInput(''); + setReplyToMessage(null); } } } else if (e.key === 'Escape') {