From c35db60736f77c1aef3d049c4cf1cd6ac1ed494c Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Fri, 27 Mar 2026 23:19:33 +0530 Subject: [PATCH] enter to submit --- apps/x/apps/renderer/src/App.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index b6dd6861..f83ea5cb 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -765,6 +765,22 @@ function App() { isRecordingRef.current = false }, [voice]) + // Enter to submit voice input, Escape to cancel + useEffect(() => { + const handleKeyDown = (e: KeyboardEvent) => { + if (!isRecordingRef.current) return + if (e.key === 'Enter') { + e.preventDefault() + handleSubmitRecording() + } else if (e.key === 'Escape') { + e.preventDefault() + handleCancelRecording() + } + } + document.addEventListener('keydown', handleKeyDown) + return () => document.removeEventListener('keydown', handleKeyDown) + }, [handleSubmitRecording, handleCancelRecording]) + // Helper to cancel recording from any navigation handler const cancelRecordingIfActive = useCallback(() => { if (isRecordingRef.current) {