mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-02 22:01:05 +02:00
desktop: clipboard auto-insert with prompt picker, remove old sessionStorage logic
This commit is contained in:
parent
03ca4f1f32
commit
6df9eea5a6
3 changed files with 24 additions and 36 deletions
|
|
@ -4,7 +4,6 @@ import {
|
|||
type AppendMessage,
|
||||
AssistantRuntimeProvider,
|
||||
type ThreadMessageLike,
|
||||
useAui,
|
||||
useExternalStoreRuntime,
|
||||
} from "@assistant-ui/react";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
|
|
@ -159,28 +158,6 @@ const TOOLS_WITH_UI = new Set([
|
|||
// "write_todos", // Disabled for now
|
||||
]);
|
||||
|
||||
function QuickAskAutoSubmit() {
|
||||
const searchParams = useSearchParams();
|
||||
const aui = useAui();
|
||||
const handledRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!window.electronAPI || handledRef.current) return;
|
||||
if (sessionStorage.getItem("quickAskAutoSubmit") === "false") return;
|
||||
|
||||
const prompt = searchParams.get("quickAskPrompt");
|
||||
if (!prompt) return;
|
||||
|
||||
handledRef.current = true;
|
||||
setTimeout(() => {
|
||||
aui.composer().setText(prompt);
|
||||
aui.composer().send();
|
||||
}, 500);
|
||||
}, [searchParams, aui]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export default function NewChatPage() {
|
||||
const params = useParams();
|
||||
const queryClient = useQueryClient();
|
||||
|
|
@ -1610,7 +1587,6 @@ export default function NewChatPage() {
|
|||
return (
|
||||
<AssistantRuntimeProvider runtime={runtime}>
|
||||
<ThinkingStepsDataUI />
|
||||
<QuickAskAutoSubmit />
|
||||
<div key={searchSpaceId} className="flex h-[calc(100dvh-64px)] overflow-hidden">
|
||||
<div className="flex-1 flex flex-col min-w-0 overflow-hidden">
|
||||
<Thread />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue