From e3e81226a0ce9569470cece847bee35aeb5925d9 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 13 Mar 2026 13:16:26 -0400 Subject: [PATCH] feat(launcher): URL params to control iframe/menu/header/footer visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows sharing a clean link that auto-configures display state on any device — no manual setup required, ideal for tablet PWA kiosk deployment. All four params are optional and independent. Values persist in localStorage so they survive reloads; the URL param always wins when present. Read inside the existing reactive URL-sync $effect, which fires on every SPA navigation (unlike the root onMount which only fires once on initial load). Supported params: ?iframe=true/false — hide/show global sys & debug menus ?launcher_menu=hide/show — hide/show left session/location panel ?launcher_header=hide/show — hide/show 'Æ Launcher v3' header bar ?launcher_footer=hide/show — hide/show the status footer Example clean poster-kiosk link: /events/{id}/launcher/{loc_id}?session_id={sess_id} &iframe=true&launcher_menu=hide&launcher_header=hide --- .../(launcher)/launcher/+layout.svelte | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte index 278cdc93..93a58295 100644 --- a/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte +++ b/src/routes/events/[event_id]/(launcher)/launcher/+layout.svelte @@ -95,6 +95,28 @@ const path_location_id = data.params.event_location_id; const path_event_id = data.params.event_id; + // WHY: URL params for display overrides — lets you share a clean link + // (e.g. tablet PWA, digital poster kiosk) without the recipient needing + // to configure settings manually on their device. + // These are read on every URL change (reactive to SPA navigation), which + // is better than the root layout's onMount which only fires once on load. + // Values persist in localStorage so they survive page reloads within the + // same device; the URL param always wins when present. + // + // Supported params: + // ?iframe=true/false — hide/show global sys & debug menus + // ?launcher_menu=hide/show — hide/show left session/location panel + // ?launcher_header=hide/show — hide/show "Æ Launcher v3" header bar + // ?launcher_footer=hide/show — hide/show the status footer + // + // Example clean poster-kiosk link: + // /events/{id}/launcher/{loc_id}?session_id={sess_id} + // &iframe=true&launcher_menu=hide&launcher_header=hide + const param_iframe = data.url.searchParams.get('iframe'); + const param_launcher_menu = data.url.searchParams.get('launcher_menu'); + const param_launcher_header = data.url.searchParams.get('launcher_header'); + const param_launcher_footer = data.url.searchParams.get('launcher_footer'); + if (log_lvl > 1) { console.log(`[Launcher Sync] URL Change: event=${path_event_id}, loc=${path_location_id}, sess=${url_session_id}`); } @@ -111,6 +133,19 @@ if (log_lvl) console.log(`[Launcher Sync] Updating store session_id: ${url_session_id}`); $events_slct.event_session_id = url_session_id; } + + // Apply display overrides from URL params (when present) + if (param_iframe === 'true') $ae_loc.iframe = true; + else if (param_iframe === 'false') $ae_loc.iframe = false; + + if (param_launcher_menu === 'hide') $events_loc.launcher.hide__launcher_menu = true; + else if (param_launcher_menu === 'show') $events_loc.launcher.hide__launcher_menu = false; + + if (param_launcher_header === 'hide') $events_loc.launcher.hide__launcher_header = true; + else if (param_launcher_header === 'show') $events_loc.launcher.hide__launcher_header = false; + + if (param_launcher_footer === 'hide') $events_loc.launcher.hide__launcher_footer = true; + else if (param_launcher_footer === 'show') $events_loc.launcher.hide__launcher_footer = false; }); });