From 062c67234e91242a3cb6fffa2e19f23bc9961186 Mon Sep 17 00:00:00 2001 From: kleinbem Date: Wed, 11 Nov 2026 02:39:59 +0000 Subject: [PATCH 1/3] fix: consistent service health, keep it on Gatus errors, filter bad bookmarks Cards, the issues filter and the counters each resolved health their own way, and healthyCount counted alias keys. One resolveHealth() now serves all three. A failed or malformed Gatus response returns null and keeps the last known state instead of blanking it; bad entries are skipped. Stored bookmarks must be http(s) URLs and invalid ones are dropped one by one instead of discarding the whole list. Icon-only buttons in the bookmarks section get accessible names. Co-Authored-By: Claude Opus 5.5 --- src/lib/components/BookmarksSection.svelte | 13 +++++--- src/lib/components/CategorySection.svelte | 4 +-- src/lib/data/gatus.ts | 39 ++++++++++++++++------ src/routes/+page.svelte | 13 ++++---- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/lib/components/BookmarksSection.svelte b/src/lib/components/BookmarksSection.svelte index 85a4f3a..2fb18a7 100644 --- a/src/lib/components/BookmarksSection.svelte +++ b/src/lib/components/BookmarksSection.svelte @@ -24,7 +24,8 @@ item !== null && typeof (item as PinnedBookmark).id === 'string' && typeof (item as PinnedBookmark).name === 'string' && - typeof (item as PinnedBookmark).url === 'string' + typeof (item as PinnedBookmark).url === 'string' && + isValidHttpUrl((item as PinnedBookmark).url) ); } @@ -34,8 +35,8 @@ const saved = localStorage.getItem('foyer-bookmarks'); if (saved) { const parsed = JSON.parse(saved); - if (Array.isArray(parsed) && parsed.every(isValidBookmark)) { - bookmarks = parsed; + if (Array.isArray(parsed)) { + bookmarks = parsed.filter(isValidBookmark); } } } catch {} @@ -150,10 +151,11 @@ @@ -185,6 +187,7 @@ type="button" onclick={() => (showAddModal = false)} class="text-zinc-400 hover:text-zinc-600 dark:hover:text-zinc-200 cursor-pointer" + aria-label="Close dialog" > ✕ diff --git a/src/lib/components/CategorySection.svelte b/src/lib/components/CategorySection.svelte index 4610b0f..4290ea0 100644 --- a/src/lib/components/CategorySection.svelte +++ b/src/lib/components/CategorySection.svelte @@ -1,6 +1,7 @@