commit fe00c4ac22e34fa1717c7481b100913909581241 parent 4eeeef86d12b58cf2e2acdbee6af033a2df362b2 Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Tue, 15 Sep 2026 15:05:16 -0400 views: a payload type is named where it is built Every editor file that still spelled a payload type through the shell that builds it now names the view that owns it. The re-exports the moved builders left behind — the six `export type` blocks and the whole of `operations/lanes.ts`, which had been reduced to three type names — are gone, so there is one path to each of the twelve payload types and it is the one in `common/views/`. Value imports are untouched: nine consumers still call `buildActiveJobsPayload`, `liveJobRows`, `stuckJobIds`, `listJobRows`, `buildAutoQueueStatusPayload`, `buildSchedulerStatusPayload` and `readPriorityView` from the shells at the old paths, because the shells are what do the reading. `operations/syncRow.ts` had both in one statement and is now two: the type from the view, the builder from the shell. `api/widget/sync/route.ts` and `api/pulse/route.ts` export `GET` and `dynamic` and nothing else — no page reaches into a route file for its data any more. `channelPriorityView.ts` also loses a value re-export of `pendingByLeafFromCounts` / `laneFocusSummary`, dead since the status view applies those folds itself (grep: no importer). Two comments named `operations/lanes.ts`; they name the view and the shell line that actually read the briefs. No rendering change, no route path change, no wire shape change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Diffstat:
26 files changed, 46 insertions(+), 86 deletions(-)
diff --git a/editor/app/api/widget/sync/route.ts b/editor/app/api/widget/sync/route.ts @@ -1,8 +1,5 @@ import { NextResponse } from "next/server"; -import { - buildWidgetSyncPayload, - type WidgetSyncPayload, -} from "yt-dlp-transcript-common/views/widgetSync"; +import { buildWidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import { widgetSyncInputs } from "../../../widget/lib/syncInputs"; export const dynamic = "force-dynamic"; @@ -10,12 +7,9 @@ export const dynamic = "force-dynamic"; // The payload is `common/views/widgetSync.ts` and its reads are // `widget/lib/syncInputs.ts`. This file is the HTTP edge and nothing else — it // used to hold the builder AND the type, which is how `app/page.tsx` came to -// import a page's data out of a route. -// -// The type re-export is the last of that: five client components still name -// `WidgetSyncPayload` through this path. Sub-slice D repoints them and deletes -// the line. -export type { WidgetSyncPayload }; +// import a page's data out of a route. Its last trace was a type re-export, +// which the client components named until they were repointed at the view; the +// only thing this file exports now is the endpoint. export async function GET() { return NextResponse.json(buildWidgetSyncPayload(await widgetSyncInputs())); diff --git a/editor/app/components/dashboard/DashboardCockpit.tsx b/editor/app/components/dashboard/DashboardCockpit.tsx @@ -1,9 +1,9 @@ "use client"; -import type { ActiveJobsPayload } from "../../jobs/active/buildActiveJobs"; -import type { WorkersPayload } from "../../workers/components/WorkersView"; +import type { ActiveJobsPayload } from "yt-dlp-transcript-common/views/activeJobs"; +import type { WorkersPayload } from "yt-dlp-transcript-common/views/workers"; import type { WidgetActionablePayload } from "../../api/widget/actionable/route"; -import type { WidgetSyncPayload } from "../../api/widget/sync/route"; +import type { WidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import { usePolledPayload, useNow } from "../../widget/lib/usePolledPayload"; import { PipelineBand } from "./PipelineBand"; import { NeedsWorkPanel } from "./NeedsWorkPanel"; diff --git a/editor/app/components/dashboard/PipelineBand.tsx b/editor/app/components/dashboard/PipelineBand.tsx @@ -2,9 +2,9 @@ import Link from "next/link"; import { useState } from "react"; -import type { ActiveJobsPayload } from "../../jobs/active/buildActiveJobs"; -import type { WorkersPayload } from "../../workers/components/WorkersView"; -import type { WidgetSyncPayload } from "../../api/widget/sync/route"; +import type { ActiveJobsPayload } from "yt-dlp-transcript-common/views/activeJobs"; +import type { WorkersPayload } from "yt-dlp-transcript-common/views/workers"; +import type { WidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import type { WidgetActionablePayload } from "../../api/widget/actionable/route"; import { JobsTable } from "../../jobs/components/JobsTable"; import { LaneDeck } from "../lanes/LaneDeck"; diff --git a/editor/app/components/lanes/LaneDeck.tsx b/editor/app/components/lanes/LaneDeck.tsx @@ -1,10 +1,10 @@ "use client"; import type { ReactNode } from "react"; -import type { WidgetSyncPayload } from "../../api/widget/sync/route"; +import type { WidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import type { WidgetActionablePayload } from "../../api/widget/actionable/route"; -import type { ActiveJobsPayload } from "../../jobs/active/buildActiveJobs"; -import type { WorkersPayload } from "../../workers/components/WorkersView"; +import type { ActiveJobsPayload } from "yt-dlp-transcript-common/views/activeJobs"; +import type { WorkersPayload } from "yt-dlp-transcript-common/views/workers"; import { formatBytes } from "yt-dlp-transcript-common/lib/format"; import { useSectionFrame } from "../../widget/components/WidgetSection"; import { LaneCard, type LaneControl } from "./LaneCard"; diff --git a/editor/app/jobs/active/buildActiveJobs.ts b/editor/app/jobs/active/buildActiveJobs.ts @@ -25,14 +25,6 @@ import { liveInputs } from "../../lib/liveInputs"; // log tail, the channel stats, the meta sidecars, the disk gate and the runner // statuses. The exported names, their signatures and their values are what // they were, so all nine consumers are untouched. -// -// The type re-export keeps the five client files compiling until slice 1D -// repoints them at the view. -export type { - ActiveJobsPayload, - ActiveLaneView, - DiskStatusView, -} from "yt-dlp-transcript-common/views/activeJobs"; // How much of the log tail to read for the one line we want. A transcription // job's log runs to megabytes and this used to read all of it, per slot, per diff --git a/editor/app/jobs/components/JobsTable.tsx b/editor/app/jobs/components/JobsTable.tsx @@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import Link from "next/link"; -import type { ActiveJobsPayload } from "../active/buildActiveJobs"; +import type { ActiveJobsPayload } from "yt-dlp-transcript-common/views/activeJobs"; import type { JobRowView } from "yt-dlp-transcript-common/views/jobRowView"; import { isLive, mergeJobRows } from "yt-dlp-transcript-common/views/jobRows"; import { CancelJobButton } from "./CancelJobButton"; diff --git a/editor/app/jobs/components/LaneStrip.tsx b/editor/app/jobs/components/LaneStrip.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import type { ActiveLaneView } from "../active/buildActiveJobs"; +import type { ActiveLaneView } from "yt-dlp-transcript-common/views/activeJobs"; import type { JobRowView } from "yt-dlp-transcript-common/views/jobRowView"; import { LANE_DOT, LANE_TEXT, LANE_WORD } from "yt-dlp-transcript-common/views/laneState"; import { DrainJobButton } from "./DrainJobButton"; diff --git a/editor/app/operations/[id]/page.tsx b/editor/app/operations/[id]/page.tsx @@ -249,7 +249,7 @@ export default async function OperationPage({ sections.length > 0 ? ( // No extra disk walk: the census is built from the request-cached // `getChannelBriefs` that `buildAutoQueueStatusPayload` already read - // above (operations/lanes.ts:198). Keyed for the same reason + // above (operations/status.ts:38). Keyed for the same reason // settingsFormFor's elements are — a server element handed to a client // component lands in its children array with React's dev-only key check // still to run over it. diff --git a/editor/app/operations/channelPriorityView.ts b/editor/app/operations/channelPriorityView.ts @@ -33,14 +33,10 @@ import type { PriorityView } from "yt-dlp-transcript-common/views/channelPriorit // with no priorities set on exactly today's payload and today's cost. // The pure half — the `PriorityView` type and the two folds the payload applies -// to it — is `common/views/channelPriority.ts`. What is left here is the READ -// that resolves one, which is the half that cannot move: it lists channels and, -// for a site focus, the sites directory. -export type { PriorityView }; -export { - pendingByLeafFromCounts, - laneFocusSummary, -} from "yt-dlp-transcript-common/views/channelPriority"; +// to it — is `common/views/channelPriority.ts`, which the status view imports +// directly. What is left here is the READ that resolves one, which is the half +// that cannot move: it lists channels and, for a site focus, the sites +// directory. // "a, b and c" for a short channel focus; "a, b and 4 more" past three, because // this lands mid-sentence in a banner and a 30-slug list is not a name. diff --git a/editor/app/operations/components/InFlightList.tsx b/editor/app/operations/components/InFlightList.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import type { AutoQueueKindStatus } from "../status"; +import type { AutoQueueKindStatus } from "yt-dlp-transcript-common/views/autoQueueStatus"; import { type Channel, formatElapsed, leafOrder, leafSentence } from "./dispatch"; // What the runner is doing RIGHT NOW. `runner.inFlight` has always been in the diff --git a/editor/app/operations/components/LaneHeader.tsx b/editor/app/operations/components/LaneHeader.tsx @@ -2,8 +2,8 @@ import Link from "next/link"; import { Button } from "yt-dlp-transcript-common/components/ui/button"; -import type { AutoQueueKindStatus } from "../status"; -import type { LaneWorker } from "../lanes"; +import type { AutoQueueKindStatus } from "yt-dlp-transcript-common/views/autoQueueStatus"; +import type { LaneWorker } from "yt-dlp-transcript-common/views/autoQueueLanes"; import { PauseLaneButton } from "../../components/lanes/pauseControl"; import { formatElapsed, idleReasonText } from "./dispatch"; @@ -173,8 +173,8 @@ function Sep() { // // READ-ONLY, and never part of any policy — delegation is a worker-pool concern // decided per item at dispatch, and this only reports it. Derived through the -// SAME workerMatches rule the dispatchers grant by (operations/lanes.ts), so -// this line and the actual routing cannot disagree. +// SAME workerMatches rule the dispatchers grant by (views/autoQueueLanes.ts), +// so this line and the actual routing cannot disagree. // // It moved here from the sweep console's scope list, which drew it per // operation row. A lane is the right scope: the slots belong to the machine, so diff --git a/editor/app/operations/components/NextUp.tsx b/editor/app/operations/components/NextUp.tsx @@ -1,7 +1,7 @@ "use client"; import Link from "next/link"; -import type { AutoQueueKindStatus } from "../status"; +import type { AutoQueueKindStatus } from "yt-dlp-transcript-common/views/autoQueueStatus"; import { type Channel, ORDER_LABEL, diff --git a/editor/app/operations/components/OperationDetail.tsx b/editor/app/operations/components/OperationDetail.tsx @@ -2,7 +2,7 @@ import type { ReactNode } from "react"; import type { AutoQueueKind } from "yt-dlp-transcript-common/jobs/autoQueueState"; -import type { AutoQueueStatusPayload } from "../status"; +import type { AutoQueueStatusPayload } from "yt-dlp-transcript-common/views/autoQueueStatus"; // Type-only: syncRow.ts is a server module. See OperationRail. import type { SyncRowView } from "../syncRow"; import FocusBanner from "../../channels/components/FocusBanner"; diff --git a/editor/app/operations/components/OperationsBoard.tsx b/editor/app/operations/components/OperationsBoard.tsx @@ -1,6 +1,6 @@ "use client"; -import type { AutoQueueStatusPayload } from "../status"; +import type { AutoQueueStatusPayload } from "yt-dlp-transcript-common/views/autoQueueStatus"; import type { SyncRowView } from "../syncRow"; import { OperationRail } from "./OperationRail"; import { railStates } from "./railStates"; diff --git a/editor/app/operations/components/PolicyTreeEditor.tsx b/editor/app/operations/components/PolicyTreeEditor.tsx @@ -11,7 +11,7 @@ import { } from "yt-dlp-transcript-common/jobs/autoQueuePolicy"; import type { AutoQueueKind } from "yt-dlp-transcript-common/jobs/autoQueueState"; import { saveAutoQueueAction, type SaveResult } from "../actions"; -import type { AutoQueueKindStatus } from "../status"; +import type { AutoQueueKindStatus } from "yt-dlp-transcript-common/views/autoQueueStatus"; import { ClaimLadder } from "./ClaimLadder"; import type { RungOps } from "./LadderRung"; import { LaneOrder } from "./LaneOrder"; diff --git a/editor/app/operations/components/RunnerOperationView.tsx b/editor/app/operations/components/RunnerOperationView.tsx @@ -2,8 +2,11 @@ import { useCallback, useEffect, useState } from "react"; import type { AutoQueueKind } from "yt-dlp-transcript-common/jobs/autoQueueState"; -import type { AutoQueueKindStatus, PlatformCooldownView } from "../status"; -import type { LaneWorker } from "../lanes"; +import type { + AutoQueueKindStatus, + PlatformCooldownView, +} from "yt-dlp-transcript-common/views/autoQueueStatus"; +import type { LaneWorker } from "yt-dlp-transcript-common/views/autoQueueLanes"; import { InFlightList } from "./InFlightList"; import { LaneHeader } from "./LaneHeader"; import { NextUp } from "./NextUp"; diff --git a/editor/app/operations/components/railStates.ts b/editor/app/operations/components/railStates.ts @@ -1,4 +1,4 @@ -import type { AutoQueueStatusPayload } from "../status"; +import type { AutoQueueStatusPayload } from "yt-dlp-transcript-common/views/autoQueueStatus"; import { LANES, type AutoQueueKind } from "yt-dlp-transcript-common/lib/autoQueueTypes"; import { deriveLaneState } from "yt-dlp-transcript-common/views/laneState"; import type { RailLaneState } from "./OperationRail"; diff --git a/editor/app/operations/components/sync/SyncConsole.tsx b/editor/app/operations/components/sync/SyncConsole.tsx @@ -1,7 +1,7 @@ "use client"; import { useCallback, useEffect, useRef, useState } from "react"; -import type { SchedulerStatusPayload } from "../../../scheduler/status"; +import type { SchedulerStatusPayload } from "yt-dlp-transcript-common/views/schedulerStatus"; import { BulkCadenceBar } from "./BulkCadenceBar"; import { ChannelCadenceEditor } from "./ChannelCadenceEditor"; diff --git a/editor/app/operations/components/useOperationsStatus.ts b/editor/app/operations/components/useOperationsStatus.ts @@ -1,7 +1,7 @@ "use client"; import { useCallback, useEffect, useRef, useState } from "react"; -import type { AutoQueueStatusPayload } from "../status"; +import type { AutoQueueStatusPayload } from "yt-dlp-transcript-common/views/autoQueueStatus"; // THE ONE POLL. Every operations surface — the board and each operation page — // reads the same payload from the same endpoint on the same 3-second cadence, diff --git a/editor/app/operations/lanes.ts b/editor/app/operations/lanes.ts @@ -1,11 +0,0 @@ -// The lane payload itself is `common/views/autoQueueLanes.ts`; the shell that -// reads its inputs is `./status.ts`, which needs the same channel briefs. -// -// What is left here is one type re-export, for the two client components that -// still name it through this path (`LaneHeader`, `RunnerOperationView`). Slice -// 1's sub-slice D repoints those and deletes this file. -export type { - LaneOperationView, - LaneWorker, - AutoQueueLanesPayload, -} from "yt-dlp-transcript-common/views/autoQueueLanes"; diff --git a/editor/app/operations/status.ts b/editor/app/operations/status.ts @@ -15,19 +15,11 @@ import { getWorkerPool } from "yt-dlp-transcript-common/jobs/workerPool"; import { buildAutoQueueLanes } from "yt-dlp-transcript-common/views/autoQueueLanes"; import { buildAutoQueueStatusPayload as build, - type AutoQueueKindStatus, type AutoQueueStatusPayload, - type PlatformCooldownView, } from "yt-dlp-transcript-common/views/autoQueueStatus"; import { getChannelBriefs } from "../lib/requestCache"; import { readPriorityView } from "./channelPriorityView"; -export type { - AutoQueueKindStatus, - AutoQueueStatusPayload, - PlatformCooldownView, -}; - // THE SHELL. The payload is `common/views/autoQueueStatus.ts` (and the rail's // bands are `views/autoQueueLanes.ts`); everything below is the reading. // diff --git a/editor/app/operations/syncRow.ts b/editor/app/operations/syncRow.ts @@ -3,10 +3,8 @@ import { SYNC_OPERATION, operationLabel, } from "yt-dlp-transcript-common/lib/operations"; -import { - buildSchedulerStatusPayload, - type SchedulerStatusPayload, -} from "../scheduler/status"; +import type { SchedulerStatusPayload } from "yt-dlp-transcript-common/views/schedulerStatus"; +import { buildSchedulerStatusPayload } from "../scheduler/status"; // THE SYNC ROW ON THE OPERATIONS RAIL, folded down to what a one-line row can // say. Sync is channel-scoped, so these are channel figures and there is no diff --git a/editor/app/scheduler/status.ts b/editor/app/scheduler/status.ts @@ -8,8 +8,6 @@ import { import { readSchedulerState } from "yt-dlp-transcript-common/jobs/syncSchedulerState"; import { resolveHeartbeatSeconds } from "./heartbeat"; -export type { SchedulerStatusPayload }; - // THE SHELL. The payload is `common/views/schedulerStatus.ts`; this reads the // four things it takes and nothing else. `resolveHeartbeatSeconds` is why the // split lands here rather than one file further down: it lives beside diff --git a/editor/app/widget/components/MonitorWidget.tsx b/editor/app/widget/components/MonitorWidget.tsx @@ -7,21 +7,21 @@ import { fmtTime } from "../lib/relativeTime"; import type { ActiveJobsPayload, DiskStatusView, -} from "../../jobs/active/buildActiveJobs"; +} from "yt-dlp-transcript-common/views/activeJobs"; import type { JobRowView } from "yt-dlp-transcript-common/views/jobRowView"; import type { JobProgressMetric, JobTaskKind, } from "yt-dlp-transcript-common/jobs/registry"; import { jobKindLabel } from "../../jobs/jobKindLabels"; -import type { WorkersPayload, WorkerView } from "../../workers/components/WorkersView"; +import type { WorkersPayload, WorkerView } from "yt-dlp-transcript-common/views/workers"; import { InlineActionButton } from "../../components/actions/InlineActionButton"; import type { WidgetActionablePayload } from "../../api/widget/actionable/route"; import type { CleanablePayload, CleanableChannel, } from "../../api/widget/cleanable/route"; -import type { WidgetSyncPayload } from "../../api/widget/sync/route"; +import type { WidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import { buildWidgetQuery, patchWidgetConfig, diff --git a/editor/app/widget/components/WidgetControls.tsx b/editor/app/widget/components/WidgetControls.tsx @@ -1,10 +1,10 @@ "use client"; import { useState } from "react"; -import type { WidgetSyncPayload } from "../../api/widget/sync/route"; +import type { WidgetSyncPayload } from "yt-dlp-transcript-common/views/widgetSync"; import type { WidgetActionablePayload } from "../../api/widget/actionable/route"; -import type { ActiveJobsPayload } from "../../jobs/active/buildActiveJobs"; -import type { WorkersPayload } from "../../workers/components/WorkersView"; +import type { ActiveJobsPayload } from "yt-dlp-transcript-common/views/activeJobs"; +import type { WorkersPayload } from "yt-dlp-transcript-common/views/workers"; import { LaneDeck } from "../../components/lanes/LaneDeck"; import { DrainAllButton } from "../../jobs/components/DrainAllButton"; import { RetryAllFailedButton } from "../../jobs/components/RetryAllFailedButton"; diff --git a/editor/app/workers/components/WorkersView.tsx b/editor/app/workers/components/WorkersView.tsx @@ -20,9 +20,7 @@ import type { // The payload shape used to be DECLARED here, in a `"use client"` file, and // the server builder imported it back out — the renderer owning the wire // shape. It lives in `common/views/workers.ts` now, beside the function that -// builds it. Re-exported so the current importers keep compiling; slice 1D -// repoints them at the view and deletes these three lines. -export type { WorkersPayload, WorkerTask, WorkerView }; +// builds it, and every component that names it says so. // Live wall-clock that re-renders once a second; null until mounted so SSR and // the first client render agree (no Date.now() hydration mismatch).