feat(feed): shared-library scope toggle in the header
Add a "Mine / Library" segmented toggle (shown on the feed page) that switches FeedFilters.scope between the user's own subscriptions and the whole shared catalog. A read-scope-less user (signed in but no YouTube grant) can now browse and manage the shared library on their own account — the empty "my feed" state offers a "browse the shared library" shortcut alongside the connect-YouTube CTA. scope is preserved across "Clear all" (it's a mode, not a filter) and kept out of the URL state. Trilingual strings (HU/EN/DE) for the toggle and the CTA.
This commit is contained in:
parent
95a18dfcc1
commit
eb58f436b6
11 changed files with 71 additions and 5 deletions
|
|
@ -60,8 +60,9 @@ const DATE_PRESETS: { days: number; key: string }[] = [
|
|||
{ days: 365, key: "1year" },
|
||||
];
|
||||
|
||||
// Filter values owned by the sidebar (everything except the header search `q`).
|
||||
const DEFAULT_SIDEBAR_FILTERS: Omit<FeedFilters, "q"> = {
|
||||
// Filter values owned by the sidebar (everything except the header search `q` and the
|
||||
// `scope` mode, both preserved across a "Clear all").
|
||||
const DEFAULT_SIDEBAR_FILTERS: Omit<FeedFilters, "q" | "scope"> = {
|
||||
tags: [],
|
||||
tagMode: "or",
|
||||
sort: "newest",
|
||||
|
|
@ -170,7 +171,7 @@ export default function Sidebar({
|
|||
|
||||
function clearAll() {
|
||||
setCustomDates(false);
|
||||
setFilters({ ...DEFAULT_SIDEBAR_FILTERS, q: filters.q });
|
||||
setFilters({ ...DEFAULT_SIDEBAR_FILTERS, q: filters.q, scope: filters.scope });
|
||||
}
|
||||
|
||||
const available: Record<WidgetId, boolean> = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue