commit 40885bad97dcc43160caa39d2e20f36040177250
parent 195d8681c0815d3dfee99d52122440e56e75b469
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 19 Nov 2026 19:11:50 -0500
common: nothing in the video window hides under its action strip
The column under the player had a max-height and no overflow of its own,
so its scroll container was the full-window wrapper (overflow-hidden).
When what sits above the cue list was taller than the room (at 1280x720
the column had 92px; the "Your copy" bar with Clip my copy open), the
column spilled past the window and the sticky action strip (Clip in /
Clip out / Share / ...) was pinned over it: Save clip sat under the
strip, and scrolling it into view moved the strip with it.
Now the column is the scroll container: overflow-y-auto with a bottom
scroll padding of the strip's height, so focus and scrollIntoView stop
above it, and the strip stays pinned to the column's bottom edge in every
state (no jump when the panel opens). The wrapper is overflow-clip, not
-hidden, so nothing can scroll the whole column up under the player. The
cue list keeps a few lines (min-h-24), the rings are inset (the column
clips), and the clip panel is scrolled into view, in the column only,
when it opens or changes state.
e2e: at 1280x720 and 390x844, with no player and with the player given
way to the copy, every control of the bar and of the panel (ready,
saving with progress and Cancel, saved, refused) is hit at its centre,
and real pointer clicks save and cancel. Red at 1280x720 before.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 217 insertions(+), 7 deletions(-)
diff --git a/common/components/LocalClipPanel.tsx b/common/components/LocalClipPanel.tsx
@@ -138,6 +138,13 @@ export function LocalClipPanel() {
wasSaving.current = savingNow;
}, [savingNow]);
+ // Opened, or a new state in it (ready, saving, saved…): the group is
+ // brought into the modal column's view, above its pinned action strip.
+ const phase = job.phase;
+ useEffect(() => {
+ if (shown && groupRef.current) revealInScroller(groupRef.current);
+ }, [shown, phase]);
+
const close = () => {
const cancelled = closeLocalClip();
setClosedNote(cancelled ? cancelledSentence(cancelled) : "");
@@ -224,6 +231,25 @@ export function LocalClipPanel() {
);
}
+// Scrolls the nearest scrolling ancestor — and only it — so `el` is inside its
+// scrollport less the scroll padding (the modal column pads its bottom by the
+// sticky action strip's height). scrollIntoView would also scroll every other
+// ancestor and the page behind the modal; its `container` option is not in
+// every browser yet.
+function revealInScroller(el: HTMLElement) {
+ let box = el.parentElement;
+ while (box && !/(auto|scroll)/.test(getComputedStyle(box).overflowY)) box = box.parentElement;
+ if (!box) return;
+ const st = getComputedStyle(box);
+ const b = box.getBoundingClientRect();
+ const r = el.getBoundingClientRect();
+ const top = b.top + (parseFloat(st.scrollPaddingTop) || 0);
+ const bottom = b.bottom - (parseFloat(st.scrollPaddingBottom) || 0);
+ // Its bottom edge into view, unless that would hide its top.
+ if (r.bottom > bottom) box.scrollTop += Math.min(r.bottom - bottom, r.top - top);
+ else if (r.top < top) box.scrollTop -= top - r.top;
+}
+
function Actions({ children }: { children: React.ReactNode }) {
return <div className="flex flex-wrap items-center gap-2">{children}</div>;
}
diff --git a/common/components/LocalFileBar.tsx b/common/components/LocalFileBar.tsx
@@ -61,7 +61,7 @@ export function LocalFileBar() {
role="group"
aria-label="Your copy"
data-testid="local-file-bar"
- className="mx-3 sm:mx-0 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg bg-zinc-900/80 ring-1 ring-white/10 p-2 text-xs text-zinc-200"
+ className="shrink-0 mx-3 sm:mx-0 flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg bg-zinc-900/80 ring-1 ring-inset ring-white/10 p-2 text-xs text-zinc-200"
>
<span className="min-w-0 max-w-full truncate">
Your copy: <span className="text-white">{localFile.name}</span>
diff --git a/common/components/TranscriptModal.tsx b/common/components/TranscriptModal.tsx
@@ -298,14 +298,24 @@ export default function TranscriptModal() {
onClick={() => setDisplayMode("mini")}
className="absolute inset-0 bg-black/70 backdrop-blur-sm"
/>
- <div className="relative flex flex-col items-center w-full h-full overflow-hidden pointer-events-none">
+ {/* overflow-clip, not -hidden: a clip is not a scroll container, so
+ focus or scrollIntoView can never scroll the whole column up under
+ the player, and the action strip's `sticky` belongs to the column. */}
+ <div className="relative flex flex-col items-center w-full h-full overflow-clip pointer-events-none">
{/* The column that sits UNDER the player. Its top margin and its height
are derived from the same --player-w/--player-top the player itself
is positioned with (globals.css), so the two can't drift apart.
Below sm it takes the full remaining height, which is what makes the
- cue list tall and the action strip land on the bottom edge. */}
+ cue list tall and the action strip land on the bottom edge.
+ When what sits above the cue list is taller than the room (a short
+ window, the "Your copy" bar with its clip panel open), the COLUMN
+ scrolls: the action strip stays pinned to its bottom edge, the cue
+ list keeps a few lines, and nothing ends up under the strip — the
+ scroll padding is the strip's height, so focus and scrollIntoView
+ stop above it. */}
<div
- className="w-(--player-w) pointer-events-auto flex flex-col gap-2 sm:gap-3 max-sm:h-full"
+ data-testid="modal-column"
+ className="w-(--player-w) pointer-events-auto flex flex-col gap-2 sm:gap-3 max-sm:h-full overflow-y-auto overscroll-contain scroll-pb-[calc(4rem+env(safe-area-inset-bottom,0px))] sm:scroll-pb-16"
style={{
marginTop:
"calc(var(--player-top) + var(--player-w) * 9 / 16 + 0.75rem)",
@@ -365,7 +375,7 @@ export default function TranscriptModal() {
<div
ref={scrollRef}
data-testid="cue-list"
- className="flex-1 min-h-0 overflow-y-auto overscroll-contain touch-pan-y border border-zinc-700 bg-zinc-900 rounded-none sm:rounded-lg"
+ className="flex-1 min-h-24 overflow-y-auto overscroll-contain touch-pan-y border border-zinc-700 bg-zinc-900 rounded-none sm:rounded-lg"
>
{isDigest ? (
<DigestPanel
@@ -415,7 +425,7 @@ export default function TranscriptModal() {
{/* Action strip, pinned to the bottom edge. The clip/share group
scrolls sideways when it doesn't fit; the window group never does,
so Close is reachable at any width without a horizontal scroll. */}
- <div className="shrink-0 sticky bottom-0 flex items-stretch gap-2 bg-zinc-900/80 ring-1 ring-white/10 rounded-none sm:rounded-lg p-2 pb-[calc(0.5rem+env(safe-area-inset-bottom,0px))] sm:pb-2">
+ <div className="shrink-0 sticky bottom-0 flex items-stretch gap-2 bg-zinc-900/80 ring-1 ring-inset ring-white/10 rounded-none sm:rounded-lg p-2 pb-[calc(0.5rem+env(safe-area-inset-bottom,0px))] sm:pb-2">
<div className="flex-1 min-w-0 flex items-center gap-2 overflow-x-auto">
<ControlButton
title="Mark clip start at current time"
diff --git a/export/CHANGELOG.md b/export/CHANGELOG.md
@@ -1,6 +1,11 @@
# Changelog
## [Unreleased]
+- **Nothing in the video window hides under its action strip.** When what sits above the cue list is taller than
+ the room under the player (the "Your copy" bar with **Clip my copy** open, a short window), the column under the
+ player scrolls, the strip (Clip in, Clip out, Share, …) stays pinned to its bottom edge, and the cue list keeps a
+ few lines. Before, at 1280×720, **Save clip** sat under the strip and could not be clicked. The clip panel is
+ scrolled into view when it opens and when its state changes.
- **Clip my copy: cut a clip from your own file, in the browser.**
- With your own copy playing, **Clip my copy** (in the "Your copy" bar) cuts the clip between the **Clip in** and
**Clip out** marks from that file. The marks are on the transcript's clock; your offset is applied.
diff --git a/export/e2e/local-clip.spec.ts b/export/e2e/local-clip.spec.ts
@@ -1,4 +1,4 @@
-import { expect, test, type Page, type Request } from "@playwright/test";
+import { expect, test, type Locator, type Page, type Request } from "@playwright/test";
import { execFileSync, spawnSync } from "node:child_process";
import { readFileSync, writeFileSync } from "node:fs";
import { expectModalOpen } from "./helpers";
@@ -590,3 +590,172 @@ test.describe("export — clip your own copy in the browser", () => {
await expect(page.getByRole("button", { name: "Clip my copy" })).toBeFocused();
});
});
+
+// EVERY CONTROL REACHABLE, AT A LAPTOP'S AND A PHONE'S SIZE. The modal's
+// action strip (Clip in / Clip out / Share / …) is sticky at the column's
+// bottom edge; nothing of the "Your copy" bar or the clip panel may end up
+// under it, in either layout and in any state of the panel. "Reachable" is
+// what a keyboard or a scroll gives: the control scrolled into view the way
+// focus scrolls it, then the point at its centre must hit the control itself.
+// The saves are made by a real pointer click at that point, not by a locator
+// click (which scrolls and retries until something works).
+
+async function hitAtCentre(loc: Locator): Promise<{ ok: boolean; x: number; y: number; at: string }> {
+ await expect(loc).toBeVisible();
+ return loc.evaluate((el) => {
+ el.scrollIntoView({ block: "nearest", inline: "nearest" });
+ const r = el.getBoundingClientRect();
+ const x = r.left + r.width / 2;
+ const y = r.top + r.height / 2;
+ const top = document.elementFromPoint(x, y);
+ const ok = top !== null && (top === el || el.contains(top));
+ return { ok, x, y, at: top ? top.outerHTML.slice(0, 160) : "nothing" };
+ });
+}
+
+async function expectReachable(loc: Locator, what: string) {
+ const hit = await hitAtCentre(loc);
+ expect(hit.ok, `${what}: the point at its centre (${Math.round(hit.x)}, ${Math.round(hit.y)}) hits ${hit.at}`).toBe(true);
+}
+
+// A real pointer click at the control's (uncovered) centre.
+async function pointerClick(page: Page, loc: Locator, what: string) {
+ const hit = await hitAtCentre(loc);
+ expect(hit.ok, `${what}: the point at its centre (${Math.round(hit.x)}, ${Math.round(hit.y)}) hits ${hit.at}`).toBe(true);
+ await page.mouse.click(hit.x, hit.y);
+}
+
+// The file is read slowly while window.__slowRead is set (100 ms per 64 KiB),
+// so a save is still running when Cancel is looked at. It is set from the
+// start: what the clipper reads while preparing it may keep.
+async function switchableSlowRead(page: Page) {
+ await page.addInitScript(() => {
+ const w = window as unknown as { __slowRead: boolean };
+ w.__slowRead = true;
+ const orig = Blob.prototype.stream;
+ Blob.prototype.stream = function (this: Blob) {
+ const reader = orig.call(this).getReader();
+ return new ReadableStream({
+ async pull(controller) {
+ const { done, value } = await reader.read();
+ if (done) return controller.close();
+ if (w.__slowRead) await new Promise((r) => setTimeout(r, Math.ceil(value.byteLength / 65536) * 100));
+ controller.enqueue(value);
+ },
+ cancel(reason) {
+ return reader.cancel(reason);
+ },
+ });
+ } as typeof Blob.prototype.stream;
+ });
+}
+const slowRead = (page: Page, on: boolean) =>
+ page.evaluate((v) => {
+ (window as unknown as { __slowRead: boolean }).__slowRead = v;
+ }, on);
+
+const SIZES = [
+ { name: "a laptop, 1280×720", viewport: { width: 1280, height: 720 } },
+ { name: "a phone, 390×844", viewport: { width: 390, height: 844 } },
+] as const;
+const LAYOUTS = [
+ { name: "the source no longer public (no player)", id: "synthmem001", gone: true },
+ { name: "a public source (the player gives way to the copy)", id: "synthpub001", gone: false },
+] as const;
+
+for (const size of SIZES) {
+ for (const layout of LAYOUTS) {
+ test.describe(`export — every control of your copy is reachable on ${size.name}, ${layout.name}`, () => {
+ test.skip(!FFMPEG, "ffmpeg/ffprobe not on PATH");
+ test.use({ viewport: size.viewport });
+
+ test("the bar, and the clip panel ready, saving, saved and refused", async ({ page }, info) => {
+ test.setTimeout(120_000);
+ const src = info.outputPath("synth-big.webm");
+ // Past the reader's 8 MiB cache, so a save reads (slowly) again.
+ makeMedia(src, "webm", { seconds: 20, heavy: true });
+ await installMissingSourceRoutes(page, { cues: CUES });
+ await stillPlayback(page);
+ await stubSavePicker(page);
+ await switchableSlowRead(page);
+ await page.goto(`/?v=${slugOf(layout.id)}`);
+ // The dev server's own issue badge sits over the bottom-left corner;
+ // it is not part of the page.
+ await page.addStyleTag({ content: "nextjs-portal { display: none !important; }" });
+ await expectModalOpen(page);
+
+ // Before the pick: the control, and (no player) the panel's last line.
+ if (layout.gone) {
+ const panel = page.getByTestId("source-missing");
+ await expectReachable(panel.getByRole("button", { name: "Play your own copy" }), "Play your own copy");
+ await expectReachable(panel.getByText("Your file stays in this browser: nothing is uploaded."), "the panel's last line");
+ } else {
+ await expectReachable(page.getByTestId("local-file-offer").getByRole("button", { name: "Play your own copy" }), "Play your own copy");
+ }
+ await expect(page.getByRole("button", { name: "Play your own copy" })).toBeVisible();
+ await page.getByTestId("local-file-input").setInputFiles({ name: "my-synth-big.webm", mimeType: CODECS.webm.mime, buffer: readFileSync(src) });
+ await expect(video(page)).toHaveAttribute("src", /^blob:/);
+
+ // The bar: its offset strip and every control in it.
+ const bar = page.getByTestId("local-file-bar");
+ await expectReachable(bar.getByTestId("local-file-offset"), "the offset");
+ for (const name of ["Offset −1 second", "Offset −0.1 second", "Offset +0.1 second", "Offset +1 second", "This line is playing now", "Stop using my copy"]) {
+ await expectReachable(bar.getByRole("button", { name }), name);
+ }
+ for (const text of ["clip line two", "clip line eleven"]) {
+ await expectReachable(page.locator("li", { hasText: text }).getByRole("button"), `the cue "${text}"`);
+ }
+ await markClip(page, "clip line two", "clip line eleven");
+ await pointerClick(page, clipToggle(page), "Clip my copy");
+
+ // Ready.
+ const group = clipGroup(page);
+ await expect(group.getByTestId("local-clip-start")).toBeVisible({ timeout: 30_000 });
+ for (const name of ["Save clip", "Save the clip to a file you choose", "Close the clip"]) {
+ await expectReachable(group.getByRole("button", { name }), name);
+ }
+ await expectReachable(group.getByRole("link", { name: "licence" }), "the licence link");
+ await expectReachable(group.getByRole("link", { name: "source" }), "the source link");
+
+ // Saving: the progress and Cancel, then a real click on Cancel.
+ let downloads = 0;
+ page.on("download", () => downloads++);
+ await pointerClick(page, group.getByRole("button", { name: "Save clip" }), "Save clip");
+ await expect(group.getByRole("progressbar", { name: "Saving clip" })).toBeVisible();
+ await expectReachable(group.getByTestId("local-clip-progress"), "the progress");
+ await pointerClick(page, group.getByRole("button", { name: "Cancel the clip" }), "Cancel");
+ await expect(group.getByTestId("local-clip-cancelled")).toHaveText("Cancelled; nothing was saved.");
+ await expectReachable(group.getByRole("button", { name: "Close the clip" }), "Close, cancelled");
+ expect(downloads).toBe(0);
+
+ // Saved: a real click on "Save clip" gives the download.
+ await slowRead(page, false);
+ await pointerClick(page, group.getByRole("button", { name: "Close the clip" }), "Close");
+ await expect(clipGroup(page)).toHaveCount(0);
+ await pointerClick(page, clipToggle(page), "Clip my copy, again");
+ await expect(group.getByTestId("local-clip-start")).toBeVisible({ timeout: 30_000 });
+ const download = page.waitForEvent("download");
+ await pointerClick(page, group.getByRole("button", { name: "Save clip" }), "Save clip");
+ const d = await download;
+ expect(d.suggestedFilename()).toBe(`${layout.gone ? TITLE_BASE : "Synth-public-talk"}_00h00m02s-00h00m11s.webm`);
+ const out = info.outputPath("clip.webm");
+ await d.saveAs(out);
+ expect(Math.abs(Number(ffprobe(out).format.duration) - 9)).toBeLessThan(0.12);
+ await expect(group.getByTestId("local-clip-done")).toBeVisible();
+ await expectReachable(group.getByRole("button", { name: "Close the clip" }), "Close, saved");
+ await pointerClick(page, group.getByRole("button", { name: "Close the clip" }), "Close");
+
+ // Refused: a file it cannot copy.
+ await pointerClick(page, bar.getByRole("button", { name: "Stop using my copy" }), "Stop");
+ await expect(page.getByRole("button", { name: "Play your own copy" })).toBeVisible();
+ await page.getByTestId("local-file-input").setInputFiles({ name: "my-synth-copy.wav", mimeType: "audio/wav", buffer: makeWav(12) });
+ await expect(video(page)).toHaveAttribute("src", /^blob:/);
+ await markClip(page, "clip line two", "clip line five");
+ await pointerClick(page, clipToggle(page), "Clip my copy, a WAV");
+ await expect(group.getByTestId("local-clip-refusal")).toBeVisible();
+ await expectReachable(group.getByTestId("local-clip-refusal"), "the refusal");
+ await expectReachable(group.getByRole("button", { name: "Close the clip" }), "Close, refused");
+ });
+ });
+ }
+}