diff --git a/surfsense_web/components/assistant-ui/assistant-message.tsx b/surfsense_web/components/assistant-ui/assistant-message.tsx index 910e1fc89..27ba08395 100644 --- a/surfsense_web/components/assistant-ui/assistant-message.tsx +++ b/surfsense_web/components/assistant-ui/assistant-message.tsx @@ -8,6 +8,7 @@ import { } from "@assistant-ui/react"; import { useAtomValue } from "jotai"; import { CheckIcon, ClipboardPaste, CopyIcon, DownloadIcon, MessageSquare, RefreshCwIcon } from "lucide-react"; +import { useSearchParams } from "next/navigation"; import type { FC } from "react"; import { useEffect, useMemo, useRef, useState } from "react"; import { commentsEnabledAtom, targetCommentIdAtom } from "@/atoms/chat/current-thread.atom"; @@ -274,7 +275,12 @@ export const AssistantMessage: FC = () => { const AssistantActionBar: FC = () => { const isLast = useAuiState((s) => s.message.isLast); const aui = useAui(); - const canReplace = isLast && typeof window !== "undefined" && !!window.electronAPI?.replaceText; + const searchParams = useSearchParams(); + const isTransform = + isLast && + typeof window !== "undefined" && + !!window.electronAPI?.replaceText && + searchParams.get("quickAskMode") === "transform"; return ( { - {canReplace && ( - { - const text = aui.message().getCopyText(); - window.electronAPI?.replaceText(text); - }} - > - - - )} {isLast && ( @@ -316,6 +311,19 @@ const AssistantActionBar: FC = () => { )} + {isTransform && ( + + )} ); };