From ba45cbdc37569741454b0d4e6b127964556758ef Mon Sep 17 00:00:00 2001 From: George Powell Date: Sun, 22 Feb 2026 23:19:00 -0500 Subject: [PATCH] Progressive disclosure in search dropdown based on guess count Shows book names only (A-Z) for the first 3 guesses, reveals Old/New Testament groupings after 3 guesses, and full section-level groupings in canonical Bible order after 9 guesses. Adds a status banner above the search bar to inform players when new structure becomes visible. Co-Authored-By: Claude Sonnet 4.6 --- src/lib/components/SearchInput.svelte | 269 +++++++++++++++++++++++--- src/routes/+page.svelte | 5 +- 2 files changed, 248 insertions(+), 26 deletions(-) diff --git a/src/lib/components/SearchInput.svelte b/src/lib/components/SearchInput.svelte index 753d589..eeae1c7 100644 --- a/src/lib/components/SearchInput.svelte +++ b/src/lib/components/SearchInput.svelte @@ -1,29 +1,158 @@ +{#if showBanner} +
+ + {#if bannerIsIndigo} + Testament & section groups now visible + {:else} + Old & New Testament groups now visible + {/if} +
+{/if} +
+ {#if searchQuery && filteredBooks.length > 0}
    - {#each filteredBooks as book (book.id)} -
  • - +
  • + {/each} + {:else if displayMode === "testament"} + {#each testamentGroups as group (group.testament)} +
  • +
    - -
  • - {/each} + + {group.label} + +
    +
+ + + {/each} + {:else} + {#each sectionGroups as group (`${group.testament}:${group.section}`)} +
  • + {#if group.showTestamentHeader} +
    + + {group.testamentLabel} + +
    +
    + {/if} +
    + + {group.section} + +
    +
    +
      + {#each group.books as book (book.id)} +
    • + +
    • + {/each} +
    +
  • + {/each} + {/if} {:else if searchQuery}

    No books found

    diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e4447de..3ee9cb9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -25,6 +25,7 @@ type StatsData, } from "$lib/utils/stats-client"; import { createGamePersistence } from "$lib/stores/game-persistence.svelte"; + import { SvelteSet } from "svelte/reactivity"; let { data }: PageProps = $props(); @@ -51,7 +52,7 @@ ); let guessedIds = $derived( - new Set(persistence.guesses.map((g) => g.book.id)), + new SvelteSet(persistence.guesses.map((g) => g.book.id)), ); const currentDate = $derived( @@ -302,7 +303,7 @@ {#if !isWon}
    - +
    {:else if showWinScreen}