From d73591865c77ea7f160ade00fef45dfb45cc2018 Mon Sep 17 00:00:00 2001 From: Till JS Date: Fri, 3 Apr 2026 12:39:14 +0200 Subject: [PATCH] fix: move bottomChromeHeight after isTagStripVisible declaration $derived cannot reference variables declared later in the script. Moved the calculation below the isTagStripVisible $state declaration. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/manacore/apps/web/src/routes/(app)/+layout.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/manacore/apps/web/src/routes/(app)/+layout.svelte b/apps/manacore/apps/web/src/routes/(app)/+layout.svelte index ed0a917a1..6ba105f10 100644 --- a/apps/manacore/apps/web/src/routes/(app)/+layout.svelte +++ b/apps/manacore/apps/web/src/routes/(app)/+layout.svelte @@ -66,8 +66,6 @@ let isCollapsed = $state(false); let showShortcuts = $state(false); let showOnboarding = $state(false); - // Bottom chrome height: calculated from state, not measured (avoids reflow loop) - const bottomChromeHeight = $derived((isCollapsed ? 0 : 80) + (isTagStripVisible ? 44 : 0) + 72); // PillNav ~80px + TagStrip ~44px + QuickInputBar ~72px // ── Theme ─────────────────────────────────────────────── let isDark = $derived(theme.isDark); @@ -129,6 +127,9 @@ isTagStripVisible = !isTagStripVisible; } + // Bottom chrome height: calculated from state, not measured (avoids reflow loop) + const bottomChromeHeight = $derived((isCollapsed ? 0 : 80) + (isTagStripVisible ? 44 : 0) + 72); + // ── DnD context ───────────────────────────────────────── let tagDropHandler = $state<((tagId: string, payload: DragPayload) => void) | null>(null); setContext('tagDropHandler', {