mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 21:32:39 +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 spaceId = pendingSearchSpaceId;
|
||||||
const route = spaceId ? `/dashboard/${spaceId}/new-chat` : '/dashboard';
|
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.once('ready-to-show', () => {
|
||||||
quickAskWindow?.show();
|
quickAskWindow?.show();
|
||||||
|
|
@ -85,6 +85,7 @@ function createQuickAskWindow(x: number, y: number): BrowserWindow {
|
||||||
|
|
||||||
async function openQuickAsk(text: string): Promise<void> {
|
async function openQuickAsk(text: string): Promise<void> {
|
||||||
pendingText = text;
|
pendingText = text;
|
||||||
|
pendingMode = 'quick-assist';
|
||||||
pendingSearchSpaceId = await getActiveSearchSpaceId();
|
pendingSearchSpaceId = await getActiveSearchSpaceId();
|
||||||
const cursor = screen.getCursorScreenPoint();
|
const cursor = screen.getCursorScreenPoint();
|
||||||
const pos = clampToScreen(cursor.x, cursor.y, 450, 750);
|
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 { useElectronAPI } from "@/hooks/use-platform";
|
||||||
import { cn } from "@/lib/utils";
|
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
|
// Dynamically import video presentation tool to avoid loading Babel and Remotion in main bundle
|
||||||
const GenerateVideoPresentationToolUI = dynamic(
|
const GenerateVideoPresentationToolUI = dynamic(
|
||||||
() =>
|
() =>
|
||||||
|
|
@ -465,14 +470,8 @@ const AssistantActionBar: FC = () => {
|
||||||
const isLast = useAuiState((s) => s.message.isLast);
|
const isLast = useAuiState((s) => s.message.isLast);
|
||||||
const aui = useAui();
|
const aui = useAui();
|
||||||
const api = useElectronAPI();
|
const api = useElectronAPI();
|
||||||
const [isQuickAssist, setIsQuickAssist] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
const isQuickAssist = !!api?.replaceText && IS_QUICK_ASSIST_WINDOW;
|
||||||
if (!api?.getQuickAskMode) return;
|
|
||||||
api.getQuickAskMode().then((mode) => {
|
|
||||||
if (mode) setIsQuickAssist(true);
|
|
||||||
});
|
|
||||||
}, [api]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionBarPrimitive.Root
|
<ActionBarPrimitive.Root
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue