feat(web): render tv lanes in attention queues

This commit is contained in:
Miguel Palhas
2026-08-23 19:23:19 +01:00
parent 779d4b8504
commit 160c00c77f
3 changed files with 53 additions and 8 deletions
+4 -2
View File
@@ -171,7 +171,8 @@
</header>
<p class="queue-note readout dim">
kids titles with no qualifying pt release — parked here, sometimes for months, by
design. allow english writes this title's override and the normal search proceeds.
design. allow english writes a movie's override and its search proceeds; series wait
for the detail view.
</p>
<ul class="deck-rows" id="rows-no-pt"></ul>
</section>
@@ -182,7 +183,8 @@
<span class="deck-count readout" id="count-decision"></span>
</header>
<p class="queue-note readout dim">
hard-failed twice on different releases — open the releases and decide by hand.
hard-failed twice on different releases — open a movie's releases and decide by hand;
series entries are display-only for now.
</p>
<ul class="deck-rows" id="rows-decision"></ul>
</section>
+42
View File
@@ -13,6 +13,7 @@ import {
attemptsLabel,
attentionTotal,
fetchAttention,
type SeriesAttention,
} from "./queues";
import {
bucketOf,
@@ -1826,6 +1827,15 @@ function queuesMain(board: HTMLElement, releases: ReleasesView, views: HideableV
for (const movie of queues.needs_decision) {
groups.decision.rows.append(libraryRow(movie, roots, openReleases));
}
// the TV lanes share the two sections: one queue per reason, whatever
// the kind. Series entries are display-only — their release deck and
// overrides arrive with the series detail view (#129, #39).
for (const series of queues.tv_no_pt_source) {
groups.noPt.rows.append(seriesAttentionRow(series));
}
for (const series of queues.tv_needs_decision) {
groups.decision.rows.append(seriesAttentionRow(series));
}
for (const group of [groups.noPt, groups.decision]) {
emptyLine(group);
}
@@ -1911,6 +1921,38 @@ function queuesMain(board: HTMLElement, releases: ReleasesView, views: HideableV
return { hide, open, refreshBadge };
}
/**
* One TV lane entry: the series plus chips counting the episodes or
* seasons that put it there. The API carries internal row ids, not SxxEyy
* numbers, so counts are what can be named honestly. Inert — see above.
*/
function seriesAttentionRow(entry: SeriesAttention): HTMLLIElement {
const item = document.createElement("li");
const row = document.createElement("div");
row.className = "row";
const chips = document.createElement("span");
chips.className = "row-chips";
if (entry.episodes.length > 0) {
const n = entry.episodes.length;
chips.append(
chip(`${n} ${n === 1 ? "episode" : "episodes"}`, (span) => {
span.setAttribute("aria-label", `${n} ${n === 1 ? "episode" : "episodes"} waiting`);
}),
);
}
if (entry.seasons.length > 0) {
const n = entry.seasons.length;
chips.append(
chip(`${n} ${n === 1 ? "season" : "seasons"}`, (span) => {
span.setAttribute("aria-label", `${n} ${n === 1 ? "season" : "seasons"} waiting`);
}),
);
}
row.append(rowTitle(entry.title, entry.year), chips);
item.append(row);
return item;
}
/**
* One no-PT-source entry: the line opens the release deck as evidence; the
* §5.2 one click sits beside it and empties the item.
+7 -6
View File
@@ -78,13 +78,14 @@ export async function allowEnglishAudio(movieId: number): Promise<AllowEnglishOu
return { kind: "done", searchQueued: true };
}
/** Entries across both queues — the rail badge's number.
*
* Deliberately movies only for now: the TV lanes are new and the QUEUES
* deck does not render them yet (the backend landed in issue 126).
*/
/** Entries across all four lanes — the rail badge's number. */
export function attentionTotal(queues: AttentionQueues): number {
return queues.no_pt_source.length + queues.needs_decision.length;
return (
queues.no_pt_source.length +
queues.needs_decision.length +
queues.tv_no_pt_source.length +
queues.tv_needs_decision.length
);
}
/** `searched 3×`, or null before the first attempt ever lands here. */