commit de1a0d84df4f01cd57eb325a52dade7c55530719
parent a657cd09657d3f067ec41e98f1e4c365d94a2eaa
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 20 Oct 2026 08:59:13 -0400
ops: channel-priority takes the focus (site, channels or none), as the /channels focus bar does
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/COMMANDS.md b/COMMANDS.md
@@ -97,7 +97,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run)
| action | what it does | example |
|---|---|---|
-| `channel-priority` | channel-priority sets channels' priority, as the /channels deck's tier control does: {"slugs", "tier": "normal" \| "low" \| "paused"} sets the base tier; with "operation" (sync, transcription, download, digest, backfill) it pins that operation's tier, "tier": null clearing it back to the base; "preset": "sync-only" \| "clear" is the deck's two shortcuts and takes no tier. A manual change clears an automatic pause. | `pnpm ops channel-priority --json '{"slugs":["x"],"operation":"download","tier":"paused"}'` |
+| `channel-priority` | channel-priority sets channels' priority, as the /channels deck's tier control does: {"slugs", "tier": "normal" \| "low" \| "paused"} sets the base tier; with "operation" (sync, transcription, download, digest, backfill) it pins that operation's tier, "tier": null clearing it back to the base; "preset": "sync-only" \| "clear" is the deck's two shortcuts and takes no tier. A manual change clears an automatic pause. {"focus": {"kind": "site", "siteId"} \| {"kind": "channels", "slugs"} \| {"kind": "none"}} alone is the deck's focus bar: those channels lead every lane (a site focus follows its membership); "none" ends it. | `pnpm ops channel-priority --json '{"slugs":["x"],"operation":"download","tier":"paused"}'`<br>`pnpm ops channel-priority --json '{"focus":{"kind":"site","siteId":"x"}}'` |
| `channel-config` | channel-config changes a channel as its Configure form does: {"slug"} and any of "patch" (form field names; "" clears one), "sites" (the WHOLE membership set: \[{"siteId", "groupId"? \| "newGroupName"?}\], \[\] = on no site; an unknown site id is refused), "excludeFromBuild" and "excludeFromCleanup" (set to the value given, not toggled). A VOD mirror's recorded date: "patch": {"recordedDateTitlePattern": "<regex with named groups year, month, day>"} (CHANNEL.md, recordedDate). A mirror's creator channels: "patch": {"mirrorOf": "<slug>, <slug>"} (CHANNEL.md, mirror; then mirror-scan). | `pnpm ops channel-config --json '{"slug":"x","patch":{"downloadFilterExclude":"rerun"}}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[{"siteId":"anilyzer"}]}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[],"excludeFromBuild":true}'` |
| `site-config` | site-config sets two keys of a site as its form does: {"siteId"} and any of "citedChannels" (the WHOLE cited scope, channel slugs: what the site's reports may cite without publishing the channel; \[\] clears it; a slug the pool holds is dropped) and "publishAuto" ("off" \| "build" \| "preview" \| "production", the publish lane's policy; a deploying one needs a Pages project, a private site is clamped to "build"). Only those two keys; an unknown site or channel is refused before anything is written. Answers the saved values. | `pnpm ops site-config --json '{"siteId":"anilyzer","citedChannels":["critic-channel"]}'`<br>`pnpm ops site-config --json '{"siteId":"anilyzer","publishAuto":"build"}'` |
| `articles-config` | articles-config sets an article's audience and its place in the published list (transcripts/reports/index.json), through the article registry: {"id"} and any of "audience" ("public" \| "private"; absent in report.json = private), "published" (true = listed, false = a draft) and "position" (its place in the list, 0 = first; publishing with none keeps a listed article where it is, else puts it last). Refused before anything is written: an unknown article, a position on a draft or out of range, publishing an article whose report.json has problems (listed). Answers the article as saved. | `pnpm ops articles-config --json '{"id":"demo-article","published":true}'`<br>`pnpm ops articles-config --json '{"id":"demo-article","audience":"public","position":0}'` |
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **Focus the queues on a site, or on some channels, from a terminal.** `pnpm ops channel-priority --json '{"focus":{"kind":"site","siteId":"<id>"}}'` does what the /channels focus bar's **Focus site** does: that site's channels lead every lane, and the focus follows the site's membership. `{"kind":"channels","slugs":[…]}` focuses a list and `{"kind":"none"}` ends the focus. `focus` goes alone in the body. Needs a restart of the editor.
- **The clip editor can ask an assistant to label and rank the clip finder's proposals — optionally.** A **Suggest** button in the clip editor's side column asks the model your generation settings choose (the local model, the Claude API, or a Claude Code session through `/gen`) to name each proposal in at most six words, say in one line what makes it land, and rank them; the labels show on every clip and unused proposal, and **Sort by the assistant's rank** orders both lists by them. Labels made before the clips were proposed again are marked stale, not hidden. Nothing in the cut changes: the labels are suggestions. Without a model, or with no labels, the clip editor works as before. From a shell: `pnpm ops report-draft '{"task":"clips-suggest","project":"<dir>","dryRun":true}'` shows how many proposals and what it would cost first.
- **Ask the assistant about a clip, and apply what it suggests with one click.** On a comment in the clip editor, **Ask the assistant** has the model read your comment, the clip's words and the clips around it, and reply in the thread (badged "agent"). When it suggests a concrete edit — new edges, a merge with the next clip, or leaving the clip out — the reply shows an **Apply** button; nothing changes until you click it, and Apply does exactly what the clip editor's own buttons do. The editor needs `UMTOOL_URL` set to post the reply.
- **Room at a report video's clip edges: a join no longer eats the end of a sentence.** With `render.room` (the Build tab's Look panel: **Room at the clips' edges**, Tail and Head), each clip's sound runs on past its cut to the first pause in its words — never more than 2.5 s — and fades there, then its picture keeps going, muted, for the length of the join, so the transition plays over quiet video; the clip after it starts the same length early, muted, when its first word comes straight away, so that word is not faded in under the join either. The words come from the project's word timings, else the transcript, else the sound's own silences. Captions stop where the sound does, and even loudness measures only what is heard. A clip cut from a downloaded window has only as much room as the window holds (the check says so; a saved whole video has plenty). The clip editor shades each clip's muted tail and head on the strip and has **Room at its edges** to turn it off for one clip. Highlights of a channel on no site now start with it on, and with 0.4 s blur slides. A manifest without `render.room` renders exactly as before. Needs a restart of umtool.
diff --git a/editor/app/api/ops/channel-priority/route.ts b/editor/app/api/ops/channel-priority/route.ts
@@ -7,6 +7,9 @@ import {
} from "yt-dlp-transcript-common/lib/channelPriority";
import {
applyChannelPriorityPresetAction,
+ endFocusAction,
+ focusChannelsAction,
+ focusSiteAction,
setChannelOperationTierAction,
setChannelTierAction,
} from "../../../channels/actions";
@@ -22,16 +25,38 @@ export const dynamic = "force-dynamic";
// POST { slugs: string[], tier?: "normal"|"low"|"paused"|null, operation?: one
// of sync|transcription|download|digest|backfill, preset?: "sync-only"|"clear" }
+// or { focus: {kind:"site", siteId} | {kind:"channels", slugs} | {kind:"none"} }
//
// Three named gestures, one route, because they are one gesture in the UI: the
// /channels deck's tier control. `operation` present pins that operation's
// override (null clears it back to the base tier); absent sets the BASE tier.
-// `preset` is the deck's two shortcuts and takes no tier.
+// `preset` is the deck's two shortcuts and takes no tier. `focus` is the
+// deck's focus bar (Focus this site / Focus these / End focus), alone in its
+// body: it is corpus-wide, so it takes no slugs of its own.
export async function POST(request: Request) {
return ops(
request,
- ["slugs", "tier", "operation", "preset"],
+ ["slugs", "tier", "operation", "preset", "focus"],
async (body) => {
+ if (body.focus !== undefined) {
+ if (["slugs", "tier", "operation", "preset"].some((k) => body[k] !== undefined)) {
+ throw new OpsInputError('"focus" goes alone: it is corpus-wide and takes no slugs, tier, operation or preset');
+ }
+ const f = body.focus as Record<string, unknown> | null;
+ if (!f || typeof f !== "object" || Array.isArray(f)) {
+ throw new OpsInputError('"focus" must be {kind:"site", siteId}, {kind:"channels", slugs} or {kind:"none"}');
+ }
+ if (f.kind === "none") return actionResponse(await endFocusAction());
+ if (f.kind === "site") {
+ const siteId = optString(f, "siteId")?.trim();
+ if (!siteId) throw new OpsInputError('a site focus needs a "siteId"');
+ return actionResponse(await focusSiteAction(siteId));
+ }
+ if (f.kind === "channels") {
+ return actionResponse(await focusChannelsAction(reqSlugs(f, "slugs")));
+ }
+ throw new OpsInputError('"focus.kind" must be "site", "channels" or "none"');
+ }
const slugs = reqSlugs(body, "slugs");
const preset = optString(body, "preset");
if (preset !== undefined) {
diff --git a/editor/e2e/ops-api.spec.ts b/editor/e2e/ops-api.spec.ts
@@ -311,6 +311,35 @@ test("channel-priority writes a per-operation override", async ({ request }) =>
expect(bogus.body.error).toMatch(/normal, low, paused/);
});
+test("channel-priority sets and ends the focus", async ({ request }) => {
+ await resetData("title-filter-channel");
+ await settings();
+ const SLUG = "test-filter";
+ const focusOf = async () =>
+ (
+ await readJson<{ channelPriority?: { focus?: Record<string, unknown> } }>(
+ testPaths().settingsFile,
+ )
+ ).channelPriority?.focus ?? null;
+
+ const set = await ops(request, "channel-priority", {
+ focus: { kind: "channels", slugs: [SLUG] },
+ });
+ expect(set.body).toEqual({ ok: true });
+ await expect.poll(focusOf).toEqual({ kind: "channels", slugs: [SLUG] });
+
+ const mixed = await ops(request, "channel-priority", {
+ slugs: [SLUG],
+ focus: { kind: "none" },
+ });
+ expect(mixed.status).toBe(400);
+ expect(mixed.body.error).toMatch(/goes alone/);
+
+ const ended = await ops(request, "channel-priority", { focus: { kind: "none" } });
+ expect(ended.body).toEqual({ ok: true });
+ await expect.poll(async () => (await focusOf())?.kind ?? "none").toBe("none");
+});
+
test("metadata-scan starts a job, and the job says it is a metadata-scan", async ({
request,
}) => {
diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs
@@ -69,6 +69,7 @@
// pnpm ops rename-channel --json '{"slug":"old-slug","newSlug":"new-slug"}'
// pnpm ops delete-channel --json '{"slug":"x","confirm":"x"}'
// pnpm ops channel-priority --json '{"slugs":["x"],"operation":"download","tier":"paused"}'
+// pnpm ops channel-priority --json '{"focus":{"kind":"site","siteId":"x"}}'
// pnpm ops lane --json '{"lane":"download","held":true}'
// pnpm ops refresh-report --json '{"all":true}'
// pnpm ops relocate --json '{"slugs":["x"],"locationId":"platter"}'
@@ -1014,6 +1015,9 @@ export function usage() {
' backfill) it pins that operation\'s tier, "tier": null clearing it back',
' to the base; "preset": "sync-only" | "clear" is the deck\'s two shortcuts',
' and takes no tier. A manual change clears an automatic pause.',
+ ' {"focus": {"kind": "site", "siteId"} | {"kind": "channels", "slugs"} |',
+ ' {"kind": "none"}} alone is the deck\'s focus bar: those channels lead',
+ ' every lane (a site focus follows its membership); "none" ends it.',
"",
'sync lists a channel and downloads what is new, as its Sync button does:',
' {"slug"}. "full": true runs the periodic whole-listing sweep now (else',