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
+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.