From 050bdf4e62e030a8a75cbe1578865d09011d802a Mon Sep 17 00:00:00 2001 From: charlesLoder Date: Fri, 10 Apr 2026 16:51:32 -0400 Subject: [PATCH] feat: use ctrl/cmd + enter to submit chat --- src/plugin/Panel/ChatInput/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugin/Panel/ChatInput/index.tsx b/src/plugin/Panel/ChatInput/index.tsx index cca1801..103ae39 100644 --- a/src/plugin/Panel/ChatInput/index.tsx +++ b/src/plugin/Panel/ChatInput/index.tsx @@ -18,8 +18,8 @@ export const ChatInput: FC = () => { dispatch({ type: "setConversationState", conversationState: "idle" }); } - async function handleSubmit(e: React.FormEvent) { - e.preventDefault(); + async function handleSubmit(e?: React.FormEvent) { + if (e) e.preventDefault(); const input = textareaValue.trim(); if (!input) { @@ -84,6 +84,12 @@ export const ChatInput: FC = () => { const PromptInputButtons = state?.provider?.PromptInputButtons?.bind(state.provider) ?? null; // bind `this`; return (
{ + if ((e.metaKey || e.ctrlKey) && e.key === "Enter") { + e.preventDefault(); + handleSubmit(); + } + }} onSubmit={async (e) => { handleSubmit(e); }}