From abd401d783c8867270e8bd9064453972faf5ec68 Mon Sep 17 00:00:00 2001 From: rzen Date: Mon, 4 May 2026 20:25:37 -0400 Subject: [PATCH] =?UTF-8?q?site:=20/find/=20filter=20toggles=20=E2=80=94?= =?UTF-8?q?=20Unused=20(default),=20All,=20plus=20Jokes/Quotes=20toggles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the old "Not in lists" filter with "Unused" (no list and no promotedTo). Adds independent Jokes/Quotes toggles, off by default. Filter + each toggle persist separately in localStorage. Card scoping uses :global() so the filter selectors reach FindCard's CSS scope. Also picks up the editorial-tag picker refactor in FindCard: in-card buttons now POST to /api/edit-find-tag/ via a single delegated handler instead of copying slash commands. --- src/components/FindCard.astro | 92 +++++++++++++++++++++++---- src/pages/find/index.astro | 116 +++++++++++++++++++++++++++++----- 2 files changed, 180 insertions(+), 28 deletions(-) diff --git a/src/components/FindCard.astro b/src/components/FindCard.astro index 27255dd..9c4ee0f 100644 --- a/src/components/FindCard.astro +++ b/src/components/FindCard.astro @@ -6,13 +6,17 @@ import SourceBadge from './SourceBadge.astro'; interface Props { item: FindItem; - inList?: boolean; + unused?: boolean; + joke?: boolean; + quote?: boolean; capturedAt?: Date; availableTags?: string[]; } -const { item, inList, capturedAt, availableTags = [] } = Astro.props; +const { item, unused, joke, quote, capturedAt, availableTags = [] } = Astro.props; const hero = findHero(item.id); -const showInListAttr = import.meta.env.DEV && inList !== undefined; +const showUnusedAttr = import.meta.env.DEV && unused !== undefined; +const showJokeAttr = import.meta.env.DEV && joke !== undefined; +const showQuoteAttr = import.meta.env.DEV && quote !== undefined; const selectedTags: string[] = item.data.editorialTags ?? []; const selectedSet = new Set(selectedTags); @@ -34,7 +38,9 @@ function host(url: string) {
{import.meta.env.DEV && (
+{import.meta.env.DEV && ( + +)} +