From 628c4e16f9cb284a71edbd39c3c7d115f98b67bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Tue, 28 Apr 2026 12:52:29 +0800 Subject: [PATCH] feat: support ESC key to close slash command panels --- desktop/src/components/chat/ChatInput.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop/src/components/chat/ChatInput.tsx b/desktop/src/components/chat/ChatInput.tsx index 7ba03253..d41734ed 100644 --- a/desktop/src/components/chat/ChatInput.tsx +++ b/desktop/src/components/chat/ChatInput.tsx @@ -362,6 +362,14 @@ export function ChatInput({ variant = 'default' }: ChatInputProps) { return } + if (localSlashPanel) { + if (event.key === 'Escape') { + event.preventDefault() + setLocalSlashPanel(null) + return + } + } + if (slashMenuOpen && filteredCommands.length > 0) { if (event.key === 'ArrowDown') { event.preventDefault()