agent: windows — apply brand tokens and preferences to secondary windows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jake
2026-03-21 10:56:00 +00:00
parent 3a633d1510
commit 5f05e25b74
2 changed files with 21 additions and 31 deletions

View File

@@ -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 @@
<svelte:window onkeydown={handleKeydown} />
<div class="h-screen w-screen overflow-hidden grain rounded-lg border border-border shadow-xl animate-float-enter {glowing ? 'animate-glow-pulse' : ''}">
<Titlebar compact />
{@render children()}
</div>