fix(channel): inherit content-type filters instead of forcing Live/Upcoming

Opening a channel hardcoded includeLive:true (+ normal on / shorts off), so a
channel view silently showed live/upcoming even when the feed had them off. Seed
the content triad from the global feed once at mount; the channel toolbar can
still toggle them locally.
This commit is contained in:
2026-07-18 18:27:17 +02:00
parent da143fd70d
commit ae7d893a3e
+10 -3
View File
@@ -6,6 +6,7 @@ import { ArrowLeft, Ban, Check, ExternalLink, Loader2, Plus, RefreshCw, SlidersH
import Avatar from "./Avatar";
import Feed from "./Feed";
import { PageToolbar, PageToolbarSlot } from "./PageShell";
import { useFeedFilters } from "./FeedFiltersProvider";
import { useConfirm } from "./ConfirmProvider";
import { notify } from "../lib/notifications";
import { notifyYouTubeActionError } from "../lib/youtubeErrors";
@@ -76,6 +77,11 @@ export default function ChannelPage({
const { closeChannel } = useNavigationActions();
const qc = useQueryClient();
const confirm = useConfirm();
// Seed the channel view's content-type prefs from the global feed (read once at mount). The
// channel page is its own filter scope, but WHICH content types the user wants to see (normal /
// shorts / live-upcoming) is a genuine preference, not part of "this channel's catalog" — so we
// inherit it instead of forcing Live/Upcoming on. The channel toolbar can still toggle these.
const globalFilters = useFeedFilters();
const [tab, setTab] = useState<"videos" | "about">("videos");
// The whole channel chrome (banner, identity, tabs, toolbar) is fixed: it portals into the shell's
// fixed band so only the video grid scrolls. This node sits at the bottom of that chrome and is
@@ -182,9 +188,10 @@ export default function ChannelPage({
sort: "newest",
scope: "all",
librarySource: "all",
includeNormal: true,
includeShorts: false,
includeLive: true,
// Content-type prefs inherited from the global feed (seeded once) — no longer forced.
includeNormal: globalFilters.includeNormal,
includeShorts: globalFilters.includeShorts,
includeLive: globalFilters.includeLive,
show: "all",
channelIds: [channelId],
}));