commit 05426df1db4531d6864f5008f35c16f08d1d7579
parent d6c8ccb435d172cf1b6faa05bb07dcf4b9f2c0df
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 18 Nov 2026 01:55:12 -0500
channels: a row's bands carry their numbers, not the operation's label and cost basis
Every channel row carried, for each of its pipeline bands, the band's
label, its cost basis in words and whether the operation is dispatched:
facts about the operation, identical on every row, which the table
states once on the column and no cell reads. On a 234-channel corpus
they were 129 KB of the 430 KB of rows the channels page serialises
(and the rows go into the document twice).
ChannelRowView.pipelines is the band's numbers now (BandCounts); the
helpers that draw or word a band (StateBand, bandSentence and the rest)
take the numbers. Sorting, filtering and every cell are unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 60 insertions(+), 13 deletions(-)
diff --git a/common/views/channelRow.test.ts b/common/views/channelRow.test.ts
@@ -191,3 +191,27 @@ test("a remote-only channel's row says so, with its archive, and is not 'manual
assert.equal(remote.hasUrl, false);
assert.equal(buildChannelRowView(input()).remoteOnly, null);
});
+
+test("a row's bands carry the numbers, not what is true of the operation", () => {
+ // The label, the cost basis and `dispatched` are the same on every row of a
+ // column; the table states them on the column. On a row they were a third
+ // of what the channels page serialised.
+ const band = {
+ id: "digest",
+ label: "Digest",
+ costBasis: "about one model call per transcript chunk",
+ eligible: 10,
+ present: 4,
+ reachable: 3,
+ blocked: 2,
+ missingInput: 1,
+ deferred: 0,
+ dispatched: true,
+ };
+ const row = buildChannelRowView(input({ bands: [band] }));
+ assert.deepEqual(row.pipelines, [
+ { id: "digest", eligible: 10, present: 4, reachable: 3, blocked: 2, missingInput: 1, deferred: 0 },
+ ]);
+ // The input is not touched.
+ assert.equal(band.label, "Digest");
+});
diff --git a/common/views/channelRow.ts b/common/views/channelRow.ts
@@ -12,7 +12,7 @@ import {
locationOfDataDir,
type StorageLocation,
} from "../lib/storageLocations";
-import type { OperationBand } from "./pipeline/band";
+import type { BandCounts, OperationBand } from "./pipeline/band";
import {
digestReachableCountOf,
undownloadedCountOf,
@@ -104,7 +104,7 @@ export type ChannelRowView = {
};
// The pipeline bands, in column order, projected from the same snapshot the
// counts come from. `[]` for a table that draws no pipeline column.
- pipelines: OperationBand[];
+ pipelines: ChannelRowBand[];
priority: ChannelRowPriority;
// How old this channel's report is. Every count and every band on this row is
// projected from that report, so its age is the caveat on all of them.
@@ -201,6 +201,22 @@ export function channelVolumeOf(
: { id: "", label: "Elsewhere" };
}
+// ONE BAND ON A ROW: the band's numbers, by operation id. A band also carries
+// what is true of the OPERATION and so is the same on every row — its label,
+// its cost basis in words, whether this system dispatches it. A table states
+// those once, on the column (channels/page.tsx `pipelineColumns`); repeated on
+// every row of every channel they were a third of the rows the channels page
+// serialises, and no cell read them.
+export type ChannelRowBand = BandCounts;
+
+function rowBandOf(band: OperationBand): ChannelRowBand {
+ const { label: _label, costBasis: _costBasis, dispatched: _dispatched, ...numbers } = band;
+ void _label;
+ void _costBasis;
+ void _dispatched;
+ return numbers;
+}
+
export function buildChannelRowView(i: ChannelRowInput): ChannelRowView {
const snap = i.snapshot;
return {
@@ -221,7 +237,7 @@ export function buildChannelRowView(i: ChannelRowInput): ChannelRowView {
untranscribed: untranscribedCountOf(snap),
digestReachable: digestReachableCountOf(snap),
},
- pipelines: i.bands,
+ pipelines: i.bands.map(rowBandOf),
priority: i.priority,
report: {
generatedAt: snap?.generatedAt ?? null,
diff --git a/common/views/pipeline/band.ts b/common/views/pipeline/band.ts
@@ -61,6 +61,13 @@ export type OperationBand = {
dispatched: boolean;
};
+// A BAND'S NUMBERS, without what is true of the operation rather than of the
+// channel (its label, its cost basis, whether it is dispatched). Everything
+// that draws or words a band reads only these, which is what lets a table of
+// channels carry them per row and state the rest once per column
+// (views/channelRow.ts `ChannelRowBand`).
+export type BandCounts = Omit<OperationBand, "label" | "costBasis" | "dispatched">;
+
// Sum that returns null if ANY term is null. Same rule digestEligibleKnown uses
// in the widget payload: a partial sum is a denominator smaller than its own
// numerator, which is a worse lie than admitting the number is not knowable.
@@ -78,7 +85,7 @@ export function sumOrNull(
// The fraction of a band that is `present`, or null when either half is unknown.
// Null renders as an unfilled outline — never as 0, which on a fully-digested
// channel would read as "nothing digested".
-export function bandCoverage(band: OperationBand): number | null {
+export function bandCoverage(band: BandCounts): number | null {
if (band.present == null || band.eligible == null || band.eligible <= 0) {
return null;
}
@@ -141,7 +148,7 @@ export const SEGMENTS = [
export type SegmentKey = (typeof SEGMENTS)[number]["key"];
-export function segmentValue(band: OperationBand, key: SegmentKey): number {
+export function segmentValue(band: BandCounts, key: SegmentKey): number {
if (key === "present") return band.present ?? 0;
return band[key];
}
@@ -153,7 +160,7 @@ export function segmentValue(band: OperationBand, key: SegmentKey): number {
// silently redraw the band as "100% accounted for", so instead the band renders
// as an un-filled outline and says `coverage unknown`. Unknown is not zero, and
// it is not full either.
-export function bandDenominator(band: OperationBand): number | null {
+export function bandDenominator(band: BandCounts): number | null {
if (band.eligible != null && band.eligible > 0) return band.eligible;
return null;
}
@@ -165,7 +172,7 @@ export function bandDenominator(band: OperationBand): number | null {
// measured corpus `reachable` and `missingInput` are four orders of magnitude
// apart on diarization; one "remaining" number would say the same thing about a
// lane that is finished and a lane that cannot start.
-export function bandSentence(band: OperationBand): string {
+export function bandSentence(band: BandCounts): string {
const parts: string[] = [`${band.reachable.toLocaleString()} can run now`];
if (band.blocked > 0) {
parts.push(`${band.blocked.toLocaleString()} blocked upstream`);
@@ -192,7 +199,7 @@ export function bandSentence(band: OperationBand): string {
// true sentence about a pipeline. "11,333 no media" and "11,329 to do" are the
// same size of number and mean opposite things; a single "remaining" figure
// would render them identically.
-export function bandHeadline(band: OperationBand): string {
+export function bandHeadline(band: BandCounts): string {
const candidates: Array<[number, string]> = [
[band.reachable, "to do"],
[band.blocked, "blocked"],
diff --git a/editor/app/channels/components/ChannelsTable.tsx b/editor/app/channels/components/ChannelsTable.tsx
@@ -4,7 +4,7 @@ import { useMemo, useState, type ReactNode, type Ref } from "react";
import type { ChannelRowView } from "yt-dlp-transcript-common/views/channelRow";
import {
bandSentence,
- type OperationBand,
+ type BandCounts,
} from "yt-dlp-transcript-common/views/pipeline/band";
import type { ChannelGroupSectionView } from "yt-dlp-transcript-common/views/channelGroupSections";
import { tierOrder } from "yt-dlp-transcript-common/lib/channelPriority";
@@ -63,7 +63,7 @@ export function defaultDirFor(key: ChannelSortKey): SortDir {
return DEFAULT_DIR[key] ?? "desc";
}
-function bandOf(row: ChannelRowView, id: string): OperationBand | undefined {
+function bandOf(row: ChannelRowView, id: string): BandCounts | undefined {
return row.pipelines.find((b) => b.id === id);
}
@@ -446,7 +446,7 @@ function PipelineCell({
}: {
slug: string;
column: PipelineColumn;
- band: OperationBand | undefined;
+ band: BandCounts | undefined;
// The bare number for a column that already had one. THE SUITE ASSERTS ON
// THIS: channels-counts.spec.ts does getByLabel("transcripts count for X")
// .toHaveText("3"), so the labelled cell keeps a text node holding the raw
diff --git a/editor/app/components/pipelines/StateBand.tsx b/editor/app/components/pipelines/StateBand.tsx
@@ -4,7 +4,7 @@ import {
bandDenominator,
SEGMENTS,
segmentValue,
- type OperationBand,
+ type BandCounts,
} from "yt-dlp-transcript-common/views/pipeline/band";
// THE INSTRUMENT. One component, three scales, one vocabulary.
@@ -49,7 +49,7 @@ export function StateBand({
size,
className = "",
}: {
- band: OperationBand;
+ band: BandCounts;
size: BandSize;
className?: string;
}) {