commit 467661bd6ed0e8015853b97f8bbc8176b4fdceca
parent 2301f68ba3d8a5e811d683ad893d04ab60aedcf0
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 30 Oct 2026 13:30:00 -0400
umtool bench: the gap and zoom tools under the waveform, so it keeps its place on the page
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 73 insertions(+), 68 deletions(-)
diff --git a/umtool/components/projects/ClipBench.tsx b/umtool/components/projects/ClipBench.tsx
@@ -3466,78 +3466,11 @@ export default function ClipBench({ data }: { data: ClipBenchData }) {
</button>
)}
</span>
- {/* ---- GAPS inside the clip ----
- Seconds cut out of its middle: it renders as one segment of
- jump cuts. Written at once (not drafted like the edges), and
- every playback here skips them, as the cut will. */}
- <span data-gaps={(clip.gaps ?? []).map((g) => `${g.from}-${g.to}`).join(",")} className="flex flex-wrap items-center gap-1.5">
- {(clip.gaps ?? []).length ? (
- <span data-gaps-summary="" className="num text-[var(--color-text)]">
- {(clip.gaps ?? []).length} gap{(clip.gaps ?? []).length === 1 ? "" : "s"}{" "}
- <span className="text-[var(--color-dim)]">
- (the cut plays {gappedLength(gapSpan(clip).from, gapSpan(clip).to, clip.gaps ?? []).toFixed(2)} s of{" "}
- {(gapSpan(clip).to - gapSpan(clip).from).toFixed(2)} s, one segment)
- </span>
- </span>
- ) : (
- <span className="text-[var(--color-dim)]">no gaps — the cut plays whole</span>
- )}
- <button
- type="button"
- data-gap-pick={gapPick ? "armed" : ""}
- aria-pressed={gapPick}
- className={`${buttonVariants({ variant: "outline", size: "sm" })}${gapPick ? " bg-panel-2 border-muted" : ""}`}
- title="drag on the waveform to select seconds to cut out of the clip (g; or hold Alt and drag; Esc cancels)"
- onClick={() => setGapPick((v) => !v)}
- >
- {gapPick ? "Drag on the waveform…" : "Select a gap"}
- </button>
- {gapSel && (
- <>
- <button
- type="button"
- data-gap-cut=""
- className={buttonVariants({ size: "sm" })}
- disabled={!!busy || gapSel.to - gapSel.from < GAP_LIMITS.min}
- title="cut the selected seconds out of the clip (g)"
- onClick={() => void cutGap()}
- >
- Cut gap {hms(gapSel.from)}–{hms(gapSel.to)} ({(gapSel.to - gapSel.from).toFixed(2)} s)
- </button>
- <button
- type="button"
- data-gap-hear=""
- className={buttonVariants({ variant: "outline", size: "sm" })}
- title="two seconds either side, the selection skipped: the jump as the cut will play it"
- onClick={() => void play(Math.max(sel.from, gapSel.from - 2), Math.min(sel.to, gapSel.to + 2), { extra: gapSel })}
- >
- Hear it
- </button>
- <button
- type="button"
- data-gap-play-span=""
- className={buttonVariants({ variant: "outline", size: "sm" })}
- title="play what the selection would take out"
- onClick={() => void play(gapSel.from, gapSel.to, { through: true })}
- >
- Play the span
- </button>
- </>
- )}
- {gapUndo && (
- <button type="button" data-gap-undo="" className={buttonVariants({ variant: "outline", size: "sm" })} disabled={!!busy} onClick={undoGap} title={`undo: ${gapUndo.what}`}>
- Undo
- </button>
- )}
- </span>
- <ZoomControls zoom={zoom} whole={view} selection={gapSel ?? sel} playhead={playhead} />
<span className="micro max-md:hidden">
<kbd>[</kbd> <kbd>]</kbd> start · <kbd>,</kbd> <kbd>.</kbd> end — each plays the edge
it moved · <kbd>space</kbd> the whole selection · <kbd>R</kbd> reset · <kbd>-</kbd>{" "}
<kbd>=</kbd> speed · <kbd>a</kbd> auto · <kbd>m</kbd> mute from the playhead,{" "}
- <kbd>;</kbd> <kbd>'</kbd> move it, <kbd>M</kbd> clear — shift for 0.5s ·{" "}
- <kbd>z</kbd> <kbd>Z</kbd> zoom (or Ctrl/⌘ + wheel), <kbd>f</kbd> fit, <kbd>F</kbd> to the selection ·{" "}
- <kbd>g</kbd> (or Alt + drag) select a gap, <kbd>g</kbd> cut it, <kbd>G</kbd> put back the one at the playhead
+ <kbd>;</kbd> <kbd>'</kbd> move it, <kbd>M</kbd> clear — shift for 0.5s
</span>
{busy && <span className="text-[var(--color-meter)]">{busy}</span>}
{note && (
@@ -3654,6 +3587,78 @@ export default function ClipBench({ data }: { data: ClipBenchData }) {
</div>
{/* Zoomed: the whole cached window, what is shown of it -- drag to pan. */}
{zoom.zoomed && <ZoomOverview zoom={zoom} whole={view} peaks={peaks} sel={sel} gaps={clip.gaps ?? []} />}
+ {/* Under the waveform: its zoom, and the clip's gaps (the waveform keeps its place on the page). */}
+ <div data-wave-tools="" className="flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px]">
+ {/* ---- GAPS inside the clip ----
+ Seconds cut out of its middle: it renders as one segment of
+ jump cuts. Written at once (not drafted like the edges), and
+ every playback here skips them, as the cut will. */}
+ <span data-gaps={(clip.gaps ?? []).map((g) => `${g.from}-${g.to}`).join(",")} className="flex flex-wrap items-center gap-1.5">
+ {(clip.gaps ?? []).length ? (
+ <span data-gaps-summary="" className="num text-[var(--color-text)]">
+ {(clip.gaps ?? []).length} gap{(clip.gaps ?? []).length === 1 ? "" : "s"}{" "}
+ <span className="text-[var(--color-dim)]">
+ (the cut plays {gappedLength(gapSpan(clip).from, gapSpan(clip).to, clip.gaps ?? []).toFixed(2)} s of{" "}
+ {(gapSpan(clip).to - gapSpan(clip).from).toFixed(2)} s, one segment)
+ </span>
+ </span>
+ ) : (
+ <span className="text-[var(--color-dim)]">no gaps — the cut plays whole</span>
+ )}
+ <button
+ type="button"
+ data-gap-pick={gapPick ? "armed" : ""}
+ aria-pressed={gapPick}
+ className={`${buttonVariants({ variant: "outline", size: "sm" })}${gapPick ? " bg-panel-2 border-muted" : ""}`}
+ title="drag on the waveform to select seconds to cut out of the clip (g; or hold Alt and drag; Esc cancels)"
+ onClick={() => setGapPick((v) => !v)}
+ >
+ {gapPick ? "Drag on the waveform…" : "Select a gap"}
+ </button>
+ {gapSel && (
+ <>
+ <button
+ type="button"
+ data-gap-cut=""
+ className={buttonVariants({ size: "sm" })}
+ disabled={!!busy || gapSel.to - gapSel.from < GAP_LIMITS.min}
+ title="cut the selected seconds out of the clip (g)"
+ onClick={() => void cutGap()}
+ >
+ Cut gap {hms(gapSel.from)}–{hms(gapSel.to)} ({(gapSel.to - gapSel.from).toFixed(2)} s)
+ </button>
+ <button
+ type="button"
+ data-gap-hear=""
+ className={buttonVariants({ variant: "outline", size: "sm" })}
+ title="two seconds either side, the selection skipped: the jump as the cut will play it"
+ onClick={() => void play(Math.max(sel.from, gapSel.from - 2), Math.min(sel.to, gapSel.to + 2), { extra: gapSel })}
+ >
+ Hear it
+ </button>
+ <button
+ type="button"
+ data-gap-play-span=""
+ className={buttonVariants({ variant: "outline", size: "sm" })}
+ title="play what the selection would take out"
+ onClick={() => void play(gapSel.from, gapSel.to, { through: true })}
+ >
+ Play the span
+ </button>
+ </>
+ )}
+ {gapUndo && (
+ <button type="button" data-gap-undo="" className={buttonVariants({ variant: "outline", size: "sm" })} disabled={!!busy} onClick={undoGap} title={`undo: ${gapUndo.what}`}>
+ Undo
+ </button>
+ )}
+ </span>
+ <span className="micro max-md:hidden">
+ <kbd>z</kbd> <kbd>Z</kbd> zoom (or Ctrl/⌘ + wheel), <kbd>f</kbd> fit, <kbd>F</kbd> to the selection ·{" "}
+ <kbd>g</kbd> (or Alt + drag) select a gap, <kbd>g</kbd> cut it, <kbd>G</kbd> put back the one at the playhead
+ </span>
+ <ZoomControls zoom={zoom} whole={view} selection={gapSel ?? sel} playhead={playhead} />
+ </div>
</div>
{/* Offered at the edge of the cache, as always -- and also whenever