fix: mount ModeWatcher and Toaster at the root layout

The reader and login pages use +layout@ breakouts to escape the (root)
shell, so anything mounted in (root)/+layout.svelte never reaches them.
ModeWatcher was mounted there and duplicated in login/+layout@.svelte,
which left the reader's theme toggle inert: it flipped the store but
nothing wrote .dark onto <html>.

Mount both once at the top-level +layout.svelte instead, which every
route inherits regardless of breakouts.
This commit is contained in:
2026-08-11 21:46:50 -04:00
parent 2aba90f910
commit 49f94f9ee1
3 changed files with 10 additions and 8 deletions
@@ -11,9 +11,7 @@
import { setThemeState } from '$lib/theme/theme.svelte';
import type { ThemeConfig } from '$lib/theme/presets';
import { ModeWatcher } from 'mode-watcher';
import { untrack, type Snippet } from 'svelte';
import { Toaster } from 'svelte-sonner';
let {
data,
@@ -40,8 +38,6 @@
});
</script>
<Toaster />
<ModeWatcher />
<div class="[--header-height:calc(--spacing(14))]">
<Sidebar.Provider class="flex flex-col">