From f146de5c0231d59d96c37fb33a676a9fd404fcfd Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Thu, 2 Apr 2026 11:05:19 -0500 Subject: [PATCH] Fix: Search Tags + Status (WIP) --- src/components/pages/Search.svelte | 1454 ++++++++-------------------- src/lib/queries.ts | 4 +- 2 files changed, 416 insertions(+), 1042 deletions(-) diff --git a/src/components/pages/Search.svelte b/src/components/pages/Search.svelte index b7c084f..ce56360 100644 --- a/src/components/pages/Search.svelte +++ b/src/components/pages/Search.svelte @@ -1,9 +1,9 @@
- +

Search

- - -
- - {#if tab === "keyword"}
{#each availableLangs as lang (lang)} - {/each} @@ -641,16 +732,10 @@ {#each kw_results.filter((r) => r.mangas.length > 0 || r.loading || r.error) as { source, mangas, loading, error } (source.id)}
- {source.displayName} { (e.target as HTMLImageElement).style.display = "none"; }} - /> + {source.displayName} { (e.target as HTMLImageElement).style.display = "none"; }} /> {source.displayName} - {#if hasMultipleLangs} - {source.lang.toUpperCase()} - {/if} + {#if hasMultipleLangs}{source.lang.toUpperCase()}{/if} {#if loading} {mangas.length} results {/if}
- {#if error}

{error}

{:else if loading} -
{#each Array(4) as _, i (i)} -
-
-
-
+
{/each}
{:else if mangas.length > 0} @@ -677,13 +757,7 @@ {#each mangas.slice(0, (store.settings.renderLimit ?? 48)) as m (m.id)}
{/if} - - {:else if tab === "tag"}
-
- + {#if tag_tagFilter} {/if} @@ -725,23 +792,14 @@
Status
{#each MANGA_STATUSES as { value, label } (value)} - {/each} -
Genre
{#each tag_filteredGenres as tag (tag)} - @@ -752,9 +810,8 @@
-
- {#if !tag_hasActiveTags} + {#if !tag_hasActiveFilters}

Select a status or genre to find matching manga.

{:else} -
{#each tag_activeStatuses as status (status)} @@ -782,42 +838,29 @@
{#if tag_activeTags.length > 1}
- - + +
{/if} - +
@@ -834,25 +877,24 @@ + sources {/if} - {#if tag_loadingLocal || tag_loadingSourceSearch} + {#if tag_loadingLocal} {:else} - {tag_totalVisible}{tag_localHasNext || tag_sourceHasMore ? "+" : ""} of {tag_totalCount + tag_sourceResults.length} results + {tag_totalVisible}{tag_localHasNext ? "+" : ""} results + {#if tag_searchSources && sourceCacheReady} + · {sourceCache.size} cached + {/if} {/if}
{#if tag_loadingLocal} -
{#each Array(48) as _, i (i)} -
-
-
-
+
{/each}
{:else if tag_mergedResults.length > 0} @@ -867,39 +909,17 @@ {/each} - {#if tag_loadingSourceSearch} - {#each Array(8) as _, i (i)} -
-
-
-
- {/each} - {/if} - - {#if tag_localHasNext || tag_sourceHasMore} + {#if tag_localHasNext}
- {#if tag_localHasNext} - - {/if} - {#if tag_sourceHasMore} - - {/if} +
{/if}
@@ -910,7 +930,7 @@ {#if tag_searchSources} Try OR mode or broader tags. {:else} - Try OR mode, enable Sources, or check that these manga are in your library. + Try OR mode, enable Sources, or check your library. {/if}

@@ -919,25 +939,18 @@
- - {:else if tab === "source"}
-
Language - {#each availableLangs as lang (lang)} {/each}
- {#if loadingSources}
{#each src_visibleSources as src (src.id)} -
-
{#if !src_activeSource}
@@ -981,12 +989,8 @@ {:else}
- { (e.target as HTMLImageElement).style.display = "none"; }} - /> + { (e.target as HTMLImageElement).style.display = "none"; }} /> {src_activeSource.displayName} {#if src_loadingBrowse}
-
- +
{#if src_loadingBrowse && src_browseResults.length === 0} -
{#each Array(18) as _, i (i)} -
-
-
-
+
{/each}
{:else if src_browseResults.length > 0} @@ -1068,9 +1061,7 @@ {/if} {:else if !src_loadingBrowse}
-

- {src_submitted ? `No results for "${src_submitted}"` : "No results"} -

+

{src_submitted ? `No results for "${src_submitted}"` : "No results"}

{/if} {/if} @@ -1080,745 +1071,128 @@