diff --git a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte index f57cb9c5..d9a09fa7 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte @@ -91,6 +91,36 @@ if (!$events_loc?.launcher) { hide_drawer__debug: true }; } +// WHY: The initialization block above only runs when launcher is completely absent. +// If the user has an older persisted config (from before the Modal migration), +// hide_drawer__cfg may be missing → undefined → !undefined = true → modal opens +// on every load. Explicitly initialize it here to ensure it is always a boolean. +if ($events_loc.launcher.hide_drawer__cfg === undefined) { + $events_loc.launcher.hide_drawer__cfg = true; +} + +let modal_cfg_open = $state(!$events_loc.launcher.hide_drawer__cfg); + +// Sync store → modal: biohazard button writes hide_drawer__cfg = false to open. +// Equality guard prevents spurious writes from unrelated $events_loc updates +// (Svelte 4 whole-store subscription fires on every field write to the store). +$effect(() => { + const should_open = !$events_loc.launcher.hide_drawer__cfg; + if (modal_cfg_open !== should_open) { + modal_cfg_open = should_open; + } +}); + +// Sync modal → store: use events_loc.update() directly rather than $-syntax so +// the write always reaches the persisted store's serialization. $-syntax writes +// inside $effect contexts may be suppressed and not trigger localStorage persistence. +$effect(() => { + const should_hide = !modal_cfg_open; + events_loc.update((loc) => { + if (loc.launcher) loc.launcher.hide_drawer__cfg = should_hide; + return loc; + }); +}); // Generate a stable per-device client ID on first load and persist it. // events_loc is backed by svelte-persisted-store (localStorage) so this @@ -898,59 +928,41 @@ $effect(() => { - ($events_loc.launcher.hide_drawer__cfg = true)} - class="w-full border border-gray-300 bg-orange-50 opacity-90 transition-all duration-300 hover:opacity-97 md:w-96 lg:w-[32rem] dark:border-gray-600 dark:bg-slate-800" - placement="left" - {...{ - transitionType: 'fly', - transitionParams: { - x: -520, - duration: 200, - easing: sineIn - } - }} - bind:hidden={$events_loc.launcher.hide_drawer__cfg} - id="sidebar1"> - - -
e.stopPropagation()}> - + + -
- -
+
+ + + Session Search + + {#if $events_slct?.event_location_id} - - Session Search + + View Selected Location - {#if $events_slct?.event_location_id} - - - View Selected Location - - {/if} - {#if $events_slct?.event_session_id} - - - View Selected Session - - {/if} -
+ {/if} + {#if $events_slct?.event_session_id} + + + View Selected Session + + {/if}
- +