From fa7d1d3f80d89bc8a196abd2a142667df7c67dff Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 25 Mar 2026 23:08:10 +0200 Subject: [PATCH] feat(desktop): improve integration of setup --- apps/client/src/setup.css | 22 ++++++++++++---------- apps/client/src/setup.tsx | 3 +++ apps/server/src/routes/index.ts | 2 +- apps/server/src/services/window.ts | 8 +++++--- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css index 5938f6486b..a6bcc24cba 100644 --- a/apps/client/src/setup.css +++ b/apps/client/src/setup.css @@ -14,16 +14,18 @@ body.setup { width: 100dvw; height: 100dvh; - @media (min-width: 700px) { - background: - radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%), - radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%), - radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%), - var(--left-pane-background-color); - display: flex; - justify-content: center; - align-items: center; - padding: 2em; + body:not(.electron) & { + @media (min-width: 700px) { + background: + radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.3) 0%, transparent 50%), + radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.25) 0%, transparent 50%), + radial-gradient(ellipse at 60% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 50%), + var(--left-pane-background-color); + display: flex; + justify-content: center; + align-items: center; + padding: 2em; + } } .setup-container { diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx index 761f3fedbc..88b009b3e9 100644 --- a/apps/client/src/setup.tsx +++ b/apps/client/src/setup.tsx @@ -25,6 +25,9 @@ async function main() { const bodyWrapper = document.createElement("div"); bodyWrapper.classList.add("setup-outer-wrapper"); document.body.classList.add("setup"); + if (isElectron()) { + document.body.classList.add("electron"); + } render(, bodyWrapper); document.body.replaceChildren(bodyWrapper); } diff --git a/apps/server/src/routes/index.ts b/apps/server/src/routes/index.ts index f3878970b8..14eec1714c 100644 --- a/apps/server/src/routes/index.ts +++ b/apps/server/src/routes/index.ts @@ -30,7 +30,7 @@ export function bootstrap(req: Request, res: Response) { if (!isDbInitialized) { res.send({ ...commonItems, - baseApiUrl: "../api/" + baseApiUrl: "api/" }); return; } diff --git a/apps/server/src/services/window.ts b/apps/server/src/services/window.ts index e04b65e5c4..bf9f7fd033 100644 --- a/apps/server/src/services/window.ts +++ b/apps/server/src/services/window.ts @@ -390,16 +390,18 @@ async function createSetupWindow() { setupWindow = new BrowserWindow({ width, height, + useContentSize: true, resizable: false, + autoHideMenuBar: true, title: "Trilium Notes Setup", icon: getIcon(), webPreferences: { // necessary for e.g. utils.isElectron() - nodeIntegration: true + nodeIntegration: true, + contextIsolation: false } }); - - setupWindow.setMenuBarVisibility(false); + setupWindow.removeMenu(); setupWindow.loadURL(`http://127.0.0.1:${port}`); setupWindow.on("closed", () => (setupWindow = null)); }