diff --git a/src/routes/list/+page.svelte b/src/routes/list/+page.svelte index abeb656..8f56e57 100644 --- a/src/routes/list/+page.svelte +++ b/src/routes/list/+page.svelte @@ -27,12 +27,7 @@ let { data }: { data: PageData } = $props(); // Local username field that does NOT update the URL as you type. - let formMal = $state(""); - - // Keep form input synced with navigation (back/forward) and initial load. - $effect(() => { - formMal = data.username || params.mal || ""; - }); + let formMal = $state(params.mal); // If SSR returned no songRows (because client DB wasn't available), // re-run load on the client once the DB is ready by invalidating. @@ -46,11 +41,6 @@ } }); - function onSearch() { - // Only update username param on explicit Search - params.mal = formMal; - } - function songArtistLabel(r: (typeof data.songRows)[number]) { return r.artistName ?? r.groupName ?? null; } @@ -63,17 +53,16 @@

MAL List → Songs

- Enter a MAL username in the URL as - /list?mal=USERNAME. This - loads up to {LIST_QUERY_LIMIT} anime from MAL (for now) and then queries your local - client DB for related songs. + {#if !clientDb} + Loading DB... + {/if}

{ e.preventDefault(); - onSearch(); + params.mal = formMal; }} >
@@ -85,8 +74,7 @@ id="mal-user" class="rounded border px-3 py-2 text-sm" placeholder="e.g. CaZzzer" - value={formMal} - oninput={(e) => (formMal = (e.currentTarget as HTMLInputElement).value)} + bind:value={formMal} autocomplete="off" spellcheck={false} /> @@ -122,9 +110,7 @@
- {#if !data.username} - Waiting for username… - {:else} + {#if data.username} MAL entries: {data.malResponse?.data.length ?? 0} (limited to {LIST_QUERY_LIMIT}) • Songs found: {data.songRows.length} {/if}