diff --git a/frontend/chat-ui/src/components/InputBox.jsx b/frontend/chat-ui/src/components/InputBox.jsx index ee7fbce..c5d1926 100644 --- a/frontend/chat-ui/src/components/InputBox.jsx +++ b/frontend/chat-ui/src/components/InputBox.jsx @@ -67,7 +67,7 @@ export default function InputBox() { }; return ( -
+
{ - dispatch({ type: "DEEP_SET_STAGE", stage, log }); - }); - dispatch({ type: "SET_RESULTS", results: { text: res.text, citations: res.citations } }); - dispatch({ type: "DEEP_STOP" }); + try { + const res = await deepResearch(q, (stage, log) => { + dispatch({ type: "DEEP_SET_STAGE", stage, log }); + }); + dispatch({ type: "SET_RESULTS", results: { text: res.text, citations: res.citations } }); + } catch (err) { + dispatch({ + type: "ADD_TOAST", + toast: { + id: uid("toast"), + title: "Research failed", + desc: err.message ?? String(err), + kind: "error", + }, + }); + } finally { + dispatch({ type: "DEEP_STOP" }); + } } else if (state.mode === "image") { const images = await imageGen(q, state.files); dispatch({ type: "SET_RESULTS", results: { images } }); diff --git a/frontend/chat-ui/src/components/ProfileMenu.jsx b/frontend/chat-ui/src/components/ProfileMenu.jsx index 72ada21..e5f3654 100644 --- a/frontend/chat-ui/src/components/ProfileMenu.jsx +++ b/frontend/chat-ui/src/components/ProfileMenu.jsx @@ -10,16 +10,25 @@ export default function ProfileMenu() { return (
- {open && ( -
- +
+