diff --git a/surfsense_desktop/src/modules/window.ts b/surfsense_desktop/src/modules/window.ts index 1b3f3baed..245814cad 100644 --- a/surfsense_desktop/src/modules/window.ts +++ b/surfsense_desktop/src/modules/window.ts @@ -33,7 +33,7 @@ export function createMainWindow(): BrowserWindow { mainWindow?.show(); }); - mainWindow.loadURL(`http://localhost:${getServerPort()}/login`); + mainWindow.loadURL(`http://localhost:${getServerPort()}/dashboard`); mainWindow.webContents.setWindowOpenHandler(({ url }) => { if (url.startsWith('http://localhost')) { diff --git a/surfsense_web/components/assistant-ui/inline-mention-editor.tsx b/surfsense_web/components/assistant-ui/inline-mention-editor.tsx index ab1213a49..ae490cdd0 100644 --- a/surfsense_web/components/assistant-ui/inline-mention-editor.tsx +++ b/surfsense_web/components/assistant-ui/inline-mention-editor.tsx @@ -119,9 +119,16 @@ export const InlineMentionEditor = forwardRef { if (!initialText || !editorRef.current) return; - editorRef.current.textContent = initialText; + editorRef.current.textContent = initialText + "\n"; setIsEmpty(false); onChange?.(initialText, Array.from(mentionedDocs.values())); + editorRef.current.focus(); + const sel = window.getSelection(); + const range = document.createRange(); + range.selectNodeContents(editorRef.current); + range.collapse(false); + sel?.removeAllRanges(); + sel?.addRange(range); }, [initialText]); // eslint-disable-line react-hooks/exhaustive-deps // Focus at the end of the editor