From 08602073acb570850df37ce404ae11003d2fe345 Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Wed, 18 Feb 2026 10:35:51 +0100 Subject: [PATCH] =?UTF-8?q?feat(RECIPE-0009):=20complete=20iteration=201?= =?UTF-8?q?=20=E2=80=94=20footer=20status=20bar,=20icon-only=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/+page.svelte | 102 +++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 32 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index eabf47d..6b0324c 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -7,6 +7,7 @@ import NotificationSettings from './components/NotificationSettings.svelte'; import { replaceState } from '$app/navigation'; import { pushNotificationManager } from '$lib/client/PushNotificationManager'; + import type { NotificationState } from '$lib/client/PushNotificationManager'; let items = $state([]); let loading = $state(true); @@ -16,6 +17,7 @@ let connectionStatus = $state<'connecting' | 'connected' | 'disconnected'>('disconnected'); let lastPing = $state(null); let hasAttemptedAutoSubscribe = $state(false); + let notificationViewModel = $state(null); // Get highlighted item ID from URL params (when redirected from Share page) let highlightId = $derived($page.url.searchParams.get('highlight')); @@ -37,11 +39,16 @@ return items.filter(item => item.status === filter); }); + let unsubscribeNotifications: (() => void) | undefined; + onMount(async () => { await loadQueueItems(); if (browser) { startSSEConnection(); setupAutoSubscribe(); + unsubscribeNotifications = pushNotificationManager.onStateChange((newState) => { + notificationViewModel = newState; + }); } }); @@ -51,6 +58,8 @@ eventSource.close(); connectionStatus = 'disconnected'; } + // Add notification state cleanup + unsubscribeNotifications?.(); }); async function loadQueueItems() { @@ -282,25 +291,29 @@ - - - - - - Add Recipe URL - + + {#if items.length > 0} + + + + + + {/if} @@ -364,28 +377,53 @@ {/if} -
+
- -
-
-
- - {connectionStatus === 'connected' ? 'Live updates' : - connectionStatus === 'connecting' ? 'Connecting...' : - 'Disconnected'} - - {#if lastPing} - - ({new Date(lastPing).toLocaleTimeString()}) - - {/if} + +
+
+ + + + +
+
+