feat(search): Library provenance filter (organic / all / search-only)

Replace the binary 'show search-discovered' toggle with a 3-way Source selector in the
Library toolbar, so users can also see ONLY search-discovered videos — not just hide or
mix them. Backend: feed param library_source = organic (default, hides via_search) | all
(both) | search (only via_search), applied in scope=all. Strings in HU/EN/DE.
This commit is contained in:
npeter83 2026-06-29 02:11:53 +02:00
parent 546be57963
commit 8b19faaed1
6 changed files with 57 additions and 33 deletions

View file

@ -417,20 +417,24 @@ export default function Feed({
{filters.scope === "all" && (
<>
<span className="mx-1 h-5 w-px bg-border" aria-hidden="true" />
<button
onClick={() =>
setFilters({ ...filters, showSearchDiscovered: !filters.showSearchDiscovered })
}
aria-pressed={!!filters.showSearchDiscovered}
title={t("feed.searchDiscoveredTip")}
className={`text-xs px-3 py-1.5 rounded-full border transition ${
filters.showSearchDiscovered
? "bg-accent text-accent-fg border-accent"
: "border-border text-muted hover:text-fg hover:border-accent"
}`}
>
{t("feed.searchDiscovered")}
</button>
<label className="inline-flex items-center gap-1.5 text-xs text-muted">
<span>{t("feed.source.label")}</span>
<select
value={filters.librarySource ?? "organic"}
onChange={(e) =>
setFilters({
...filters,
librarySource: e.target.value as FeedFilters["librarySource"],
})
}
title={t("feed.source.tip")}
className="bg-card border border-border rounded-lg px-2 py-1 text-xs outline-none focus:border-accent"
>
<option value="organic">{t("feed.source.organic")}</option>
<option value="all">{t("feed.source.all")}</option>
<option value="search">{t("feed.source.only")}</option>
</select>
</label>
</>
)}
</div>