From 50d28ca725f0347018c8d795de058c5696488bfc Mon Sep 17 00:00:00 2001 From: thinkter Date: Tue, 19 May 2026 22:10:47 +0530 Subject: [PATCH 1/2] shift enter --- apps/web/src/app/components/ChatPanel.tsx | 17 +++++++----- .../app/components/mobile/MobileChatPanel.tsx | 26 +++++++++++++------ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/apps/web/src/app/components/ChatPanel.tsx b/apps/web/src/app/components/ChatPanel.tsx index 9194bcb7..24b1b942 100644 --- a/apps/web/src/app/components/ChatPanel.tsx +++ b/apps/web/src/app/components/ChatPanel.tsx @@ -312,7 +312,7 @@ function ChatPanel({ ); return; } - if (e.key === "Tab" || e.key === "Enter") { + if (e.key === "Tab" || (e.key === "Enter" && !e.shiftKey)) { e.preventDefault(); applyMentionSuggestion(activeMentionIndex); return; @@ -334,12 +334,17 @@ function ChatPanel({ ); return; } - if (isPickingCommand && (e.key === "Tab" || e.key === "Enter")) { + if ( + isPickingCommand && + (e.key === "Tab" || (e.key === "Enter" && !e.shiftKey)) + ) { const command = commandSuggestions[activeCommandIndex]; const isExactMatch = command && chatInput.trim().toLowerCase() === `/${command.label}`; if (e.key === "Enter" && isExactMatch) { + e.preventDefault(); + handleSubmit(e); return; } e.preventDefault(); @@ -514,7 +519,7 @@ function ChatPanel({ {directMessageLabel}

) : null} -

+

{renderMessageContent(msg.content)}

@@ -605,8 +610,8 @@ function ChatPanel({ )}
- onInputChange(e.target.value)} onKeyDown={handleKeyDown} @@ -619,7 +624,7 @@ function ChatPanel({ } maxLength={1000} disabled={isChatDisabled} - className="flex-1 px-2.5 py-1.5 bg-black/30 border border-[#FEFCD9]/10 rounded-md text-xs text-[#FEFCD9] placeholder:text-[#FEFCD9]/30 focus:outline-none focus:border-[#FEFCD9]/20 disabled:opacity-50" + className="max-h-24 min-h-8 flex-1 resize-none px-2.5 py-1.5 bg-black/30 border border-[#FEFCD9]/10 rounded-md text-xs text-[#FEFCD9] placeholder:text-[#FEFCD9]/30 focus:outline-none focus:border-[#FEFCD9]/20 disabled:opacity-50" />
)} - { setLocalValue(e.target.value); @@ -443,7 +453,7 @@ function MobileChatPanel({ : "Type a message or /..." } disabled={isChatDisabled} - className="flex-1 mobile-glass mobile-pill px-4 py-2.5 text-sm text-[#FEFCD9] placeholder:text-[#FEFCD9]/30 focus:outline-none focus:border-[#F95F4A]/50 disabled:opacity-50" + className="max-h-28 min-h-10 flex-1 resize-none mobile-glass mobile-pill px-4 py-2.5 text-sm text-[#FEFCD9] placeholder:text-[#FEFCD9]/30 focus:outline-none focus:border-[#F95F4A]/50 disabled:opacity-50" />