fix(channels): reflect shared deep-queue state in the full-history chip

deep_requested is per-subscription, but deep backfill is channel-wide and shared:
once any subscriber requests full history, the whole back-catalog arrives for
everyone. The chip only looked at the current user's flag, so a second subscriber
saw a misleading 'get full history' on a channel already queued by someone else.
Add a channel-level deep_in_queue to /api/channels and show an informational
'full history queued' badge (vs the owner's cancelable button) in that case.
This commit is contained in:
npeter83 2026-06-12 02:29:10 +02:00
parent 0bba654ec5
commit d06fff0550
3 changed files with 39 additions and 14 deletions

View file

@ -354,24 +354,31 @@ function ChannelRow({
/>
{c.backfill_done ? (
<SyncBadge ok label="full" hint="Full history fetched." />
) : (
<Tooltip
hint={
c.deep_requested
? "Full history requested — this channel's whole back-catalog will backfill as the shared quota allows. Click to cancel the request."
: "Only recent uploads so far. Click to request this channel's full back-catalog (older videos + complete search)."
}
>
) : c.deep_requested ? (
<Tooltip hint="Full history requested — this channel's whole back-catalog will backfill as the shared quota allows. Click to cancel your request.">
<button
onClick={onDeep}
className={`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full border transition ${
c.deep_requested
? "bg-accent text-accent-fg border-accent"
: "bg-card border-border text-muted hover:border-accent"
}`}
className="inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full border border-accent bg-accent text-accent-fg transition"
>
<History className="w-3 h-3" />
{c.deep_requested ? "full history queued" : "get full history"}
full history queued
</button>
</Tooltip>
) : c.deep_in_queue ? (
<Tooltip hint="Another subscriber already requested this channel's full history, so its whole back-catalog is on its way to everyone — nothing to do here.">
<span className="inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full border border-accent/40 text-accent">
<History className="w-3 h-3" />
full history queued
</span>
</Tooltip>
) : (
<Tooltip hint="Only recent uploads so far. Click to request this channel's full back-catalog (older videos + complete search).">
<button
onClick={onDeep}
className="inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full border bg-card border-border text-muted hover:border-accent transition"
>
<History className="w-3 h-3" />
get full history
</button>
</Tooltip>
)}