commit ff68cc9ff05955c76ff18834b0b02b7d47579dbd
parent f9e5ef98e395de94257fbcb1440428d1f1875cb1
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 19 Nov 2026 19:49:29 -0500
export: the player gives way only while Clip my copy is open
f9e5ef98e capped --player-w for every video at short windows, shrinking
the player for every visitor to make room for a panel most never open.
The cap now applies only under :root[data-local-clip-open], which
LocalClipPanel sets while its panel shows and removes when it closes or
unmounts: the player resizes once on opening and once on closing, never
on a state change within the panel. With no panel open it is
min(92vw, 960px) from sm and 100vw below, as before the lane.
e2e: at 1280x720 and 390x844, with a platform player and with none, the
player is 960 / 390 wide before the pick and with a copy playing; with
the panel open at 1280x720 it is 612 and the column has 18rem; closed,
960 again. The player's container gains data-testid="player-slot".
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 46 insertions(+), 13 deletions(-)
diff --git a/common/components/LocalClipPanel.tsx b/common/components/LocalClipPanel.tsx
@@ -138,6 +138,16 @@ export function LocalClipPanel() {
wasSaving.current = savingNow;
}, [savingNow]);
+ // While the panel shows, the player gives the modal's column room on a
+ // short window (export/app/globals.css, [data-local-clip-open]): once on
+ // opening and once on closing, never on a state change within it.
+ useEffect(() => {
+ if (!shown) return;
+ const root = document.documentElement;
+ root.setAttribute("data-local-clip-open", "");
+ return () => root.removeAttribute("data-local-clip-open");
+ }, [shown]);
+
// 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;
diff --git a/common/components/PlayerProvider.tsx b/common/components/PlayerProvider.tsx
@@ -1332,7 +1332,7 @@ export function PlayerProvider({
{children}
{showPlayer && (
- <div className={containerClass} aria-hidden={displayMode === "hidden"}>
+ <div className={containerClass} aria-hidden={displayMode === "hidden"} data-testid="player-slot">
{localActive && local ? (
// The visitor's own copy, from its object URL, on the cue clock:
// every seek goes in at cue + offset and every tick comes out at
diff --git a/export/CHANGELOG.md b/export/CHANGELOG.md
@@ -6,10 +6,10 @@
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.
-- **The video player leaves room for the transcript on a laptop-height window.** From 640 px wide the player is
- never so tall that the column under it gets less than 18rem: at 1280×720 the video is 612 px wide instead of 960,
- and the title, the cue list and the action strip all show under it (the column had 92 px). Windows 916 px tall
- or more are unchanged.
+- **While Clip my copy is open, the player leaves the panel room on a laptop-height window.** From 640 px wide,
+ with the panel open, the player is never so tall that the column under it gets less than 18rem: at 1280×720 the
+ video is 612 px wide instead of 960 while the panel shows, and the panel and a few cues fit under it. It resizes
+ once on opening and once on closing. Every other time the player is exactly the size it was.
- **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/app/globals.css b/export/app/globals.css
@@ -20,23 +20,28 @@ body {
wide the video is and where its top edge sits — they used to carry two copies
of `min(92vw,960px)` and `top-16`, which is exactly the kind of pair that
drifts. Below sm the player is full-bleed and tucked under the notch; from sm
- it is the centred card it has always been — but never so tall that the
- modal's column under it (title, "Your copy", cue list, action strip) gets
- less than 18rem: on a laptop-height window (1280×720) a 960px-wide video
- left that column 92px. The floor keeps a landscape phone's player usable;
- the column scrolls there. */
+ it is the centred card it has always been. */
:root {
--player-w: 100vw;
--player-top: env(safe-area-inset-top, 0px);
}
@media (min-width: 640px) {
:root {
+ --player-w: min(92vw, 960px);
+ --player-top: 4rem; /* was `top-16` */
+ }
+ /* While "Clip my copy" is open (LocalClipPanel sets the attribute), the
+ player is never so tall that the modal's column under it gets less than
+ 18rem, so the panel and a few cues show at a laptop-height window
+ (1280×720 left that column 92px). Every other time the player is the
+ size above. The floor keeps a landscape phone's player usable; the
+ column scrolls there. */
+ :root[data-local-clip-open] {
--player-w: clamp(
min(92vw, 20rem),
(100dvh - 4rem - 1.5rem - 18rem) * 16 / 9,
min(92vw, 960px)
);
- --player-top: 4rem; /* was `top-16` */
}
}
diff --git a/export/e2e/local-clip.spec.ts b/export/e2e/local-clip.spec.ts
@@ -654,6 +654,13 @@ const slowRead = (page: Page, on: boolean) =>
(window as unknown as { __slowRead: boolean }).__slowRead = v;
}, on);
+// The player's width with no clip panel open: what it was before "Clip my
+// copy" (min(92vw, 960px) from sm, 100vw below).
+const PLAYER_W: Record<number, number> = { 1280: 960, 390: 390 };
+const PANEL_OPEN_ROOM = 288; // 18rem
+const playerWidth = (page: Page) => page.getByTestId("player-slot").evaluate((el) => Math.round(el.getBoundingClientRect().width));
+const columnRoom = (page: Page) => page.getByTestId("modal-column").evaluate((el) => Math.round(parseFloat(getComputedStyle(el).maxHeight)));
+
const SIZES = [
{ name: "a laptop, 1280×720", viewport: { width: 1280, height: 720 } },
{ name: "a phone, 390×844", viewport: { width: 390, height: 844 } },
@@ -683,8 +690,10 @@ for (const size of SIZES) {
// it is not part of the page.
await page.addStyleTag({ content: "nextjs-portal { display: none !important; }" });
await expectModalOpen(page);
- // The player leaves the column under it room for more than the strip.
- expect(await page.getByTestId("modal-column").evaluate((el) => parseFloat(getComputedStyle(el).maxHeight))).toBeGreaterThanOrEqual(280);
+ // The player is its usual size — min(92vw, 960px) from sm, the full
+ // width below — with a platform player or none, and with a copy
+ // playing; only an open clip panel makes it give the column room.
+ await expect.poll(() => playerWidth(page)).toBe(PLAYER_W[size.viewport.width]);
// Before the pick: the control, and (no player) the panel's last line.
if (layout.gone) {
@@ -698,6 +707,8 @@ for (const size of SIZES) {
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:/);
+ await expect.poll(() => playerWidth(page)).toBe(PLAYER_W[size.viewport.width]);
+
// 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");
@@ -713,6 +724,11 @@ for (const size of SIZES) {
// Ready.
const group = clipGroup(page);
await expect(group.getByTestId("local-clip-start")).toBeVisible({ timeout: 30_000 });
+ // The panel open: the column under the player has at least 18rem.
+ await expect.poll(() => columnRoom(page)).toBeGreaterThanOrEqual(PANEL_OPEN_ROOM);
+ const openWidth = await playerWidth(page);
+ if (size.viewport.width === 1280) expect(openWidth).toBe(612);
+ else expect(openWidth).toBe(PLAYER_W[size.viewport.width]);
for (const name of ["Save clip", "Save the clip to a file you choose", "Close the clip"]) {
await expectReachable(group.getByRole("button", { name }), name);
}
@@ -734,6 +750,8 @@ for (const size of SIZES) {
await slowRead(page, false);
await pointerClick(page, group.getByRole("button", { name: "Close the clip" }), "Close");
await expect(clipGroup(page)).toHaveCount(0);
+ // Closed: the player is its usual size again.
+ await expect.poll(() => playerWidth(page)).toBe(PLAYER_W[size.viewport.width]);
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");