diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index dd3e6e1d..c29b9d71 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -115,6 +115,19 @@ export default function ConversationTile({ setConversationsName(conversation.name); setIsEdit(false); } + + const handleRenameKeyDown = (e: React.KeyboardEvent) => { + e.stopPropagation(); + if (e.key === 'Enter') { + handleSaveConversation({ + id: conversation.id, + name: conversationName, + }); + } else if (e.key === 'Escape') { + onClear(); + } + }; + return ( <>
setConversationsName(e.target.value)} + onKeyDown={handleRenameKeyDown} /> ) : (

@@ -239,7 +253,7 @@ export default function ConversationTile({ >