From 875046263738ddcbfc6b92ed7d08546eef24b8d1 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 24 Mar 2026 19:28:41 +0200 Subject: [PATCH] listen for quick-ask text in Composer --- surfsense_web/components/assistant-ui/thread.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/surfsense_web/components/assistant-ui/thread.tsx b/surfsense_web/components/assistant-ui/thread.tsx index 081e234a8..eb98fd025 100644 --- a/surfsense_web/components/assistant-ui/thread.tsx +++ b/surfsense_web/components/assistant-ui/thread.tsx @@ -330,6 +330,13 @@ const Composer: FC = () => { const composerRuntime = useComposerRuntime(); const hasAutoFocusedRef = useRef(false); + const [quickAskText, setQuickAskText] = useState(); + useEffect(() => { + return window.electronAPI?.onQuickAskText((text) => { + if (text) setQuickAskText(text); + }); + }, []); + const isThreadEmpty = useAssistantState(({ thread }) => thread.isEmpty); const isThreadRunning = useAssistantState(({ thread }) => thread.isRunning); @@ -536,6 +543,7 @@ const Composer: FC = () => { onDocumentRemove={handleDocumentRemove} onSubmit={handleSubmit} onKeyDown={handleKeyDown} + initialText={quickAskText} className="min-h-[24px]" />