mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Merge remote-tracking branch 'upstream/dev' into feat/vision-autocomplete
This commit is contained in:
commit
936bac21e9
2 changed files with 8 additions and 8 deletions
|
|
@ -58,7 +58,7 @@ function createQuickAskWindow(x: number, y: number): BrowserWindow {
|
|||
|
||||
const spaceId = pendingSearchSpaceId;
|
||||
const route = spaceId ? `/dashboard/${spaceId}/new-chat` : '/dashboard';
|
||||
quickAskWindow.loadURL(`http://localhost:${getServerPort()}${route}`);
|
||||
quickAskWindow.loadURL(`http://localhost:${getServerPort()}${route}?quickAssist=true`);
|
||||
|
||||
quickAskWindow.once('ready-to-show', () => {
|
||||
quickAskWindow?.show();
|
||||
|
|
@ -85,6 +85,7 @@ function createQuickAskWindow(x: number, y: number): BrowserWindow {
|
|||
|
||||
async function openQuickAsk(text: string): Promise<void> {
|
||||
pendingText = text;
|
||||
pendingMode = 'quick-assist';
|
||||
pendingSearchSpaceId = await getActiveSearchSpaceId();
|
||||
const cursor = screen.getCursorScreenPoint();
|
||||
const pos = clampToScreen(cursor.x, cursor.y, 450, 750);
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ import { useMediaQuery } from "@/hooks/use-media-query";
|
|||
import { useElectronAPI } from "@/hooks/use-platform";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Captured once at module load — survives client-side navigations that strip the query param.
|
||||
const IS_QUICK_ASSIST_WINDOW =
|
||||
typeof window !== "undefined" &&
|
||||
new URLSearchParams(window.location.search).get("quickAssist") === "true";
|
||||
|
||||
// Dynamically import video presentation tool to avoid loading Babel and Remotion in main bundle
|
||||
const GenerateVideoPresentationToolUI = dynamic(
|
||||
() =>
|
||||
|
|
@ -465,14 +470,8 @@ const AssistantActionBar: FC = () => {
|
|||
const isLast = useAuiState((s) => s.message.isLast);
|
||||
const aui = useAui();
|
||||
const api = useElectronAPI();
|
||||
const [isQuickAssist, setIsQuickAssist] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!api?.getQuickAskMode) return;
|
||||
api.getQuickAskMode().then((mode) => {
|
||||
if (mode) setIsQuickAssist(true);
|
||||
});
|
||||
}, [api]);
|
||||
const isQuickAssist = !!api?.replaceText && IS_QUICK_ASSIST_WINDOW;
|
||||
|
||||
return (
|
||||
<ActionBarPrimitive.Root
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue