From 5f05e25b7459412d98cbc302a4af4cce863748d8 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 21 Mar 2026 10:56:00 +0000 Subject: [PATCH] =?UTF-8?q?agent:=20windows=20=E2=80=94=20apply=20brand=20?= =?UTF-8?q?tokens=20and=20preferences=20to=20secondary=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- src/routes/float/+layout@.svelte | 26 ++++++++++---------------- src/routes/viewer/+layout@.svelte | 26 +++++++++++--------------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/routes/float/+layout@.svelte b/src/routes/float/+layout@.svelte index e30a3e6..55d0152 100644 --- a/src/routes/float/+layout@.svelte +++ b/src/routes/float/+layout@.svelte @@ -4,29 +4,22 @@ import { listen } from "@tauri-apps/api/event"; import { getCurrentWindow } from "@tauri-apps/api/window"; import { settings } from "$lib/stores/page.svelte.js"; + import { getPreferences, updatePreferences } from "$lib/stores/preferences.svelte.js"; + import Titlebar from "$lib/components/Titlebar.svelte"; let { children } = $props(); let glowing = $state(false); let unlistenFocus = null; - let quickAddEl = $state(null); - // Theme application (float window has its own DOM) + const prefs = getPreferences(); + + // Theme — sync legacy settings to preferences store (same as main layout) $effect(() => { - const theme = settings.theme; - if (theme === "Light") { - document.documentElement.classList.add("light"); - return; + const legacyTheme = settings.theme; + const mapped = legacyTheme === "Light" ? "light" : legacyTheme === "Dark" ? "dark" : "system"; + if (prefs.theme !== mapped) { + updatePreferences({ theme: mapped }); } - if (theme === "Dark") { - document.documentElement.classList.remove("light"); - return; - } - // System mode - const mq = window.matchMedia("(prefers-color-scheme: light)"); - const apply = () => document.documentElement.classList.toggle("light", mq.matches); - apply(); - mq.addEventListener("change", apply); - return () => mq.removeEventListener("change", apply); }); // Listen for settings changes from main window @@ -67,5 +60,6 @@
+ {@render children()}
diff --git a/src/routes/viewer/+layout@.svelte b/src/routes/viewer/+layout@.svelte index 460d9d8..7f565f1 100644 --- a/src/routes/viewer/+layout@.svelte +++ b/src/routes/viewer/+layout@.svelte @@ -1,27 +1,22 @@