From c59b53a51b556bf3980cde5def6e07b171169875 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Tue, 30 Jun 2026 04:37:00 +0200 Subject: [PATCH] fix(channel): drop channel-constant sort options on the channel page Subscribers and Channel-priority sorts are meaningless when the feed is scoped to one channel (both are constant across its videos), so hide them there via a channelScoped flag on Feed. The main feed keeps all sorts. --- frontend/src/components/ChannelPage.tsx | 1 + frontend/src/components/Feed.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ChannelPage.tsx b/frontend/src/components/ChannelPage.tsx index 4488d5b..122772b 100644 --- a/frontend/src/components/ChannelPage.tsx +++ b/frontend/src/components/ChannelPage.tsx @@ -255,6 +255,7 @@ export default function ChannelPage({ onYtSearch={() => {}} onExitYtSearch={() => {}} onOpenChannel={onOpenChannel} + channelScoped /> {!ch?.subscribed && nextToken && (
diff --git a/frontend/src/components/Feed.tsx b/frontend/src/components/Feed.tsx index f7fc781..345a485 100644 --- a/frontend/src/components/Feed.tsx +++ b/frontend/src/components/Feed.tsx @@ -78,6 +78,7 @@ export default function Feed({ onYtSearch, onExitYtSearch, onOpenChannel, + channelScoped, }: { filters: FeedFilters; setFilters: (f: FeedFilters) => void; @@ -95,8 +96,14 @@ export default function Feed({ // Open a channel's dedicated page (from a card's channel name / avatar). Threaded down to // the cards via VirtualFeed. onOpenChannel?: (channelId: string, channelName?: string) => void; + // True when this feed is scoped to a single channel (the channel page). Drops sort options + // that are constant within one channel (subscribers, priority) — they'd be meaningless. + channelScoped?: boolean; }) { const { t } = useTranslation(); + const sortKeys = channelScoped + ? SORT_KEYS.filter((k) => k !== "subscribers" && k !== "priority") + : SORT_KEYS; const [overrides, setOverrides] = useState>({}); const [savedOverrides, setSavedOverrides] = useState>({}); // The open player: which video and where to start (null = resume from saved position). @@ -519,7 +526,7 @@ export default function Feed({ className="bg-card border border-border rounded-lg px-2 py-1.5 text-sm outline-none focus:border-accent" > {/* Relevance only ranks meaningfully when there's a search term — offer it then. */} - {(filters.q.trim() ? (["relevance", ...SORT_KEYS] as SortKey[]) : SORT_KEYS).map((k) => ( + {(filters.q.trim() ? (["relevance", ...sortKeys] as SortKey[]) : sortKeys).map((k) => (