commit 48eb8496945c6bddcdffefaff6f520eef6f124a5
parent 51439ebe060e1f13d8a5acf8afe84d6a5003454a
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 23 Oct 2026 16:38:29 -0400
Merge lane/source-duration-zero: a live capture's clips can be trimmed again in the clip editor
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A clip from a stream captured live can be trimmed again in umtool's clip editor.** Such a stream's record has no length, which umtool passed on as zero, so every drag of a clip's edge snapped back to the left with "that is the edge of what is cached". An unknown length is now treated as unknown.
- **umtool's clip editor opens a clip from a whole saved recording as a short excerpt.** When the only file holding a clip was the whole recording (hours long), the editor used all of it as its view: a waveform of the whole stream with the clip a sliver in it, and a video seeking hours into a large file. It now cuts the clip and 45 seconds either side from the recording once, on the umtool machine, and works on that; the cut starts when the clip is opened and is kept for the next time. The rendered video still cuts from the whole recording.
- **A report video can blur a clip's picture for sharing, keep an uncensored version beside it, and take a new clip from any span of a recording.** In umtool's clip editor each clip has a **Blur** box: **Blur picture** blurs that clip's footage when the video is built (the sound plays as recorded) and writes a caption on it, "Original footage uncensored, blurred here for TOS" by default and editable, with a strength and, with **From playhead** / **To playhead**, only part of the clip. The header, QR code, on-screen panel, captions and stamps are not blurred, and the live preview shows the blur as the build will draw it. The Build tab's Look panel has **Blurred clips: uncensored**, and a take made with `--set render.blur=off` renders the same cut unblurred, so a blurred cut for sharing and an uncensored take sit side by side. **New clip** in the clip editor (from a selection on the strip, which now reaches ± 180 s, or the span just after the clip) inserts a clip right after the current one, with its quote read from the transcript and **Blur picture** available on the form; the project page's timeline has the same as **Add clip**. A clip with nothing on disk to play offers **Fetch this clip's window**. From a terminal: `umtool set <project> <clip> blur.on=true blur.caption="…" blur.strength=8 blur.from=… blur.to=…` (`blur.on=` clears it) and `umtool look <project> blur=off`.
- **A recording saved from a live capture now plays in umtool's clip editor.** A stream recorded while it was on air has no length in its transcript's record, and umtool read a saved recording's length from there, so the whole recording counted as no window and every clip cut from it sat in the clip walk as not fetched. umtool now asks the saved file itself for its length when the record has none (once per file).
diff --git a/umtool/app/api/report/clip/route.ts b/umtool/app/api/report/clip/route.ts
@@ -76,7 +76,9 @@ export async function GET(request: Request) {
proposed: entry?.proposed ?? null,
endsSentence: entry?.endsSentence ?? null,
noPunctuation: entry?.noPunctuation ?? false,
- sourceDuration: entry?.duration ?? null,
+ // A record captured live has no length in its cues (`duration: 0`): unknown,
+ // not zero -- a zero here capped every drag at second 0.
+ sourceDuration: entry?.duration && entry.duration > 0 ? entry.duration : null,
segment: seg?.rel ?? entry?.segment ?? null,
segmentMtime: seg?.mtimeMs ?? null,
sourceTitle: entry?.sourceTitleClean ?? null,
diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx
@@ -1146,7 +1146,10 @@ export default function ClipBench({ data }: { data: ClipBenchData }) {
//
// Clamped to the cached file. Past its edge the handle stops and the "fetch
// more" button appears; past the source's own duration it stops for good.
- const clampTo = Math.min(cachedTo || Infinity, data.sourceDuration ?? Infinity);
+ // The source's length, or null when it is not known (a live capture's record
+ // says 0; the route sends null for it now, and this guards an older reply).
+ const sourceDuration = data.sourceDuration && data.sourceDuration > 0 ? data.sourceDuration : null;
+ const clampTo = Math.min(cachedTo || Infinity, sourceDuration ?? Infinity);
const onSel = useCallback(
(next: { from: number; to: number }, dragging: boolean, edge?: "start" | "end" | null) => {
const from = Math.max(fetchStart, next.from);
@@ -1169,7 +1172,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) {
const atStartEdge = sel.from <= fetchStart + 0.05 && fetchStart > 0;
const atEndEdge =
- sel.to >= cachedTo - 0.05 && (data.sourceDuration == null || cachedTo < data.sourceDuration - 0.05);
+ sel.to >= cachedTo - 0.05 && (sourceDuration == null || cachedTo < sourceDuration - 0.05);
// ---- saving -------------------------------------------------------------
const doSave = useCallback(
@@ -1874,7 +1877,7 @@ export default function ClipBench({ data }: { data: ClipBenchData }) {
// different sentences: the pad cap, and the end of the recording itself.
const atStartOfSource = !!cached && cached.from <= 0.02;
const atEndOfSource =
- !!cached && data.sourceDuration != null && cached.to >= data.sourceDuration - 0.02;
+ !!cached && sourceDuration != null && cached.to >= sourceDuration - 0.02;
const beforeMaxed = reachBefore >= data.maxPad - 0.5 || atStartOfSource;
const afterMaxed = reachAfter >= data.maxPad - 0.5 || atEndOfSource;
const atMaxPad = beforeMaxed && afterMaxed;