8000 App review 2026-07-10: resolve all 81 findings by johannboehme · Pull Request #146 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3348671
fix(capabilities): add RENDER_ATTACHMENT to WebGPU probe texture usag…
johannboehme Jul 10, 2026
6130abd
fix(job-page): keep page layout on quick-render error, add dismissibl…
johannboehme Jul 10, 2026
9e7f95c
refactor(editor): drop retired single-element loop scheduler exports …
johannboehme Jul 10, 2026
088e67c
fix(codec): fail fast on moov-less/truncated MP4s instead of hanging …
johannboehme Jul 10, 2026
1ba0de2
fix(codec): check ffmpeg.wasm exit code, surface stderr, stop leaking…
johannboehme Jul 10, 2026
97d845e
fix(job-page): live quick-render feedback + double-start guard (#91)
johannboehme Jul 10, 2026
553c39f
fix(editor): loop.end on a chunk seam wraps at the previous segment's…
johannboehme Jul 10, 2026
ecdd24d
fix(codec): retry ffmpeg core load after failure instead of caching t…
johannboehme Jul 10, 2026
5871f5a
fix(editor): tolerate RAF-stall overshoot when arming segment hops an…
johannboehme Jul 10, 2026
445145d
fix(render): sample beat-sync LFO + sidechain at master-time in expor…
johannboehme Jul 10, 2026
0b447ee
fix(history): render ops transition/clear on completion — no stuck RE…
johannboehme Jul 10, 2026
b76696b
fix(render): WebGPU failure handling — factory fallback, device-lost …
johannboehme Jul 10, 2026
ff13b14
test(codec): pin the auto-fallback ladder's failure-triggered routes …
johannboehme Jul 10, 2026
85781e0
fix(triage): preserve decisions and manual edits across slider re-det…
johannboehme Jul 10, 2026
48ccd0a
fix(editor): don't schedule the end-of-arrangement pause behind an ar…
johannboehme Jul 10, 2026
01a812f
fix(render-screen): honest 'No render in progress' state after reload…
johannboehme Jul 10, 2026
c512102
fix(render): keep the editor's full arrangement axis through a master…
johannboehme Jul 10, 2026
a2ee181
fix(pwa): stop deploys from breaking live sessions; version-key the f…
johannboehme Jul 10, 2026
740bf80
feat(job-page): inline player for the rendered video (#132)
johannboehme Jul 10, 2026
37a919f
fix(render): per-layer textures + uniform buffers in WebGPU multi-lay…
johannboehme Jul 10, 2026
f401d7d
fix(editor): park idle a lead-window early at arm time — wraps/hops n…
johannboehme Jul 10, 2026
3ce47f1
fix(triage): make re-detects during background PCM decode non-destruc…
johannboehme Jul 10, 2026
0b0149f
fix(pwa): precache the sync-core wasm + manifest icons so the install…
johannboehme Jul 10, 2026
a3522be
fix(render): draw exported visualizers + overlays at master-time (#106)
johannboehme Jul 10, 2026
8be2e1f
fix(history): always-visible delete button with confirm dialog (#133)
johannboehme Jul 10, 2026
c1d65e2
fix(editor): replay stashed pre-metadata seeks onto the active ping-p…
johannboehme Jul 10, 2026
dd12d24
Merge codec/PWA robustness fixes (#81 #116 #117 #118 #127 #130)
johannboehme Jul 10, 2026
a1a3bc4
fix(job-page): strip existing extension from download filename — no m…
johannboehme Jul 10, 2026
2dd615d
fix(render): cancel per-segment frame rounding against the audio cloc…
johannboehme Jul 10, 2026
7445553
fix(triage): eliminate stale-persist races around slider re-detects (…
johannboehme Jul 10, 2026
0ee2a7d
test(render): pin frame-exact A/V alignment across off-grid segment b…
johannboehme Jul 10, 2026
a0a7b8e
feat(jobs): default job title to the song's name + inline rename on t…
johannboehme Jul 10, 2026
15e7d7d
test(editor): real-Chromium regression pin for long-form loop schedul…
johannboehme Jul 10, 2026
eecccd9
test(render): export-level assertion that punch-in FX fire at their t…
johannboehme Jul 10, 2026
b7efc0e
fix(triage): persist the min-bars filter and align Arrange with Conti…
johannboehme Jul 10, 2026
c1bcdaf
fix(history): tile shows the project (master-audio) duration, not the…
johannboehme Jul 10, 2026
c991a12
test(render): WebGL2↔WebGPU pixel parity for all filters + punch-in F…
johannboehme Jul 10, 2026
05ba454
Merge playback engine fixes (#76 #77 #80 #83 #89 #104 #137 #140)
johannboehme Jul 10, 2026
8971407
Merge GPU backend fixes (#87 #115 #126 #138) + dead noir WGSL fix
johannboehme Jul 10, 2026
7ff6b5a
fix(render): clamp frameAtOrBefore to the first frame when the target…
johannboehme Jul 10, 2026
07587e1
Merge JobPage/History/RenderScreen UX fixes (#90 #91 #92 #93 #132 #13…
johannboehme Jul 10, 2026
6628d0a
fix(triage): stop cam preview accumulating lag on sub-500 ms segment …
johannboehme Jul 10, 2026
2bb0d60
fix(render): restore the AAC↔Opus fallback for the streaming export p…
johannboehme Jul 10, 2026
f07ca64
fix(sync-tuner): number quick-pick chips by lane position, not cam id…
johannboehme Jul 10, 2026
8d10204
perf(triage): stop 60 Hz playhead ticks re-rendering the whole timeli…
johannboehme Jul 10, 2026
e96825c
fix(arrange): real preview-loop for unarranged pool chunks (#73)
johannboehme Jul 10, 2026
b4e4a59
Merge triage fixes (#71 #72 #97 #98 #105 #112)
johannboehme Jul 10, 2026
54ae9cd
fix(render): un-flip the exported NO-SIGNAL test pattern on WebGL2 (#…
johannboehme Jul 10, 2026
d729ae2
fix(arrange): hit-test FilmStrip reorder, drag threshold, click swall…
johannboehme Jul 10, 2026
de5f4c2
Merge export/render correctness fixes (#78 #79 #84 #85 #106 #107 #108…
johannboehme Jul 10, 2026
dc0ba4f
fix(upload): real drag & drop with type routing + navigation guard (#67)
johannboehme Jul 10, 2026
bb9ec13
fix(arrange): touch swipes scroll, drags require long-press intent (#74)
johannboehme Jul 10, 2026
49d2aeb
fix(arrange): MiniMap seeks only on discrete click, drags scroll with…
johannboehme Jul 10, 2026
269aea3
Merge arrange fixes (#73 #74 #99 #100)
johannboehme Jul 10, 2026
f3645a8
feat(upload): one-click demo session synthesized client-side (#131)
johannboehme Jul 10, 2026
353e663
Merge upload UX + demo project (#67 #131)
johannboehme Jul 10, 2026
75e0050
test(sync-core): guard drift refinement with known non-1.0 ratio case…
johannboehme Jul 10, 2026
b5a4568
Merge sync fixes (#128 #134)
johannboehme Jul 10, 2026
aa5a6c6
fix(transport): ignore Cmd/Ctrl-modified keys in transport shortcuts …
johannboehme Jul 10, 2026
a25b43f
fix(storage): stop masking quota errors, clean up orphaned OPFS bytes…
johannboehme Jul 10, 2026
ba4585d
fix(loop): project the trim window as a range, not point endpoints (#66)
johannboehme Jul 10, 2026
87b7b5c
fix(timeline): trim handles use range-endpoint projection, not half-o…
johannboehme Jul 10, 2026
cf0065b
fix(jobs): never silently delete finished projects under quota pressu…
johannboehme Jul 10, 2026
bdf5111
feat(shortcuts): central keymap dispatcher — one set of guards for ev…
johannboehme Jul 10, 2026
7414a5f
fix(cuts): validate timeline-time cuts against pill coverage, not mas…
johannboehme Jul 10, 2026
a9f6161
fix(editor): suppress edit shortcuts while the Help overlay is open (…
johannboehme Jul 10, 2026
6e79b75
fix(quantize): restrict Q-quantize to cuts + FX edges, preview everyt…
johannboehme Jul 10, 2026
783c2d2
fix(jobs): give stuck 'needs sync' jobs a way out — retrySync + alway…
johannboehme Jul 10, 2026
44721a0
fix(quantize): snap against the arr-time beat anchor, matching ruler …
johannboehme Jul 10, 2026
c7f456a
fix(editor): make the paused FX-pad latch reachable from the keyboard… 8000
johannboehme Jul 10, 2026
1a60439
fix(editor): flush pending auto-persist writes instead of discarding …
johannboehme Jul 10, 2026
f0d4cd5
fix(transport): arrow-key stepping runs on the arr axis, not raw mast…
johannboehme Jul 10, 2026
a2feae2
Merge keyboard shortcut consolidation (#88 #95 #96 #123)
johannboehme Jul 10, 2026
815a89b
fix(editor): retry failed auto-persist writes with backoff, surface p…
johannboehme Jul 10, 2026
62d79ca
fix(pills): clamp source shifts as a whole, preserving the window len…
johannboehme Jul 10, 2026
5ddaf47
fix(cuts): moveCut clamps to the song length, not the master duration…
johannboehme Jul 10, 2026
dce3f70
fix(timeline): ON-AIR LED tracks pill edits while paused — complete m…
johannboehme Jul 10, 2026
614d828
fix(jobs): collision-free cam ids on '+ Media' after a delete (#68)
johannboehme Jul 10, 2026
c10c6f7
Merge editor time-mapping fixes (#66 #68 #70 #75 #94 #101 #102 #103 #…
johannboehme Jul 10, 2026
d4523cd
fix(editor): kill silent cross-tab clobber — rev-guarded auto-persist…
johannboehme Jul 10, 2026
ea45ef6
feat(storage): project backup — export/import a self-contained .tk1.z…
johannboehme Jul 10, 2026
6412626
Merge persistence/quota/backup fixes (#64 #65 #86 #119 #120 #124 #129)
johannboehme Jul 10, 2026
49c4440
perf(fx): cap sidechain follower memo with per-env LRU (#111)
johannboehme Jul 10, 2026
3ca2c43
perf(editor): chunk the loudness-envelope build off the main thread (…
johannboehme Jul 10, 2026
9664714
refactor(timeline): single source of truth for bar/beat ruler ticks (…
johannboehme Jul 10, 2026
3498f3c
refactor(audio): extract shared ping-pong engine — dedup editor/triag…
johannboehme Jul 10, 2026
a68e6d4
perf(timeline): stop repainting the multi-lane scene at 60 Hz for the…
johannboehme Jul 10, 2026
2f310c4
perf(timeline): take the LaneHeader column off the 60 Hz playback pat…
johannboehme Jul 10, 2026
5724c71
Merge editor perf fixes (#110 #111 #113 #114)
johannboehme Jul 10, 2026
9bc4ec4
Merge ruler tick dedup (#139)
johannboehme Jul 10, 2026
4f9fd1b
Merge shared ping-pong audio engine (#82)
johannboehme Jul 10, 2026
14edb60
feat(editor): bounded undo/redo history with Cmd/Ctrl+Z (#69)
johannboehme Jul 11, 2026
c366ba1
Merge editor undo/redo (#69)
johannboehme Jul 11, 2026
a7f29e9
test(timeline): extract pill-pointerdown decision into pure function,…
johannboehme Jul 11, 2026
deb8f7f
refactor(arch): carve dependency-free src/core/ out of editor/ and lo…
johannboehme Jul 11, 2026
b976d30
refactor(store): split 3045-line god store into 10 domain slices, ded…
johannboehme Jul 11, 2026
65e308b
Merge architecture refactors (#121 #122 #125)
johannboehme Jul 11, 2026
584c8cd
fix(editor): don't warn 'open in another tab' on same-tab remounts (#…
johannboehme Jul 11, 2026
53453a3
chore(e2e): drive the picker-less upload page via CDP file drops, pol…
johannboehme Jul 11, 2026
b320891
chore(e2e): poll lastRender for render completion, screenshot the ren…
johannboehme Jul 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added frontend/public/__test_fixtures__/tone-alac.m4a
Binary file not shown.
Binary file not shown.
69 changes: 51 additions & 18 deletions frontend/scripts/e2e-full.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ async function shot(page, name, opts = {}) {
console.log(` 📸 ${path}`);
}

/** Drop real files onto the upload page's <main> via CDP drag events —
* file paths travel out-of-band, so multi-GB media works and the page
* sees a native drop (incl. getAsFileSystemHandle). */
async function dropFiles(page, paths) {
const box = await page.locator("main").boundingBox();
const x = box.x + box.width / 2;
co 8000 nst y = box.y + Math.min(box.height / 2, 300);
const cdp = await page.context().newCDPSession(page);
const data = { items: [], files: paths, dragOperationsMask: 1 };
await cdp.send("Input.dispatchDragEvent", { type: "dragEnter", x, y, data });
await cdp.send("Input.dispatchDragEvent", { type: "dragOver", x, y, data });
await cdp.send("Input.dispatchDragEvent", { type: "drop", x, y, data });
await cdp.detach();
}

async function uploadAndSync(page, scenario) {
console.log(`\n=== ${scenario.name} ===`);
await page.goto(`${BASE}/upload`, { waitUntil: "domcontentloaded" });
Expand All @@ -106,25 +121,35 @@ async function uploadAndSync(page, scenario) {
await shot(page, "01-upload-empty");
}

await page.locator("#picker-audio").setInputFiles(scenario.audio);
await page.locator("#picker-videos").setInputFiles(scenario.videos);
await page.waitForTimeout(400);
// The upload page has no <input type=file> anymore (pickers use
// showOpenFilePicker, drops route by MIME) — drive the real drop path
// via CDP drag events carrying actual file paths.
await dropFiles(page, [scenario.audio, ...scenario.videos]);
await page.waitForTimeout(600);
await shot(page, `${scenario.name}-upload-filled`);

await page.getByRole("button", { name: /sync.*open editor/i }).click();
// Two submit modes since the triage/arrange flow landed; DIRECT → EDITOR
// is the classic path this e2e exercises.
await page.locator("button", { hasText: "EDITOR" }).first().click();
await page.waitForURL(/\/job\/[a-f0-9]+/, { timeout: 30_000 });

// Poll until synced
// Poll until synced. Sync state lives per-video these days
// (videos[i].sync), not in a job-level status field.
const t0 = Date.now();
let lastStatus = null;
while (Date.now() - t0 < 600_000) {
const job = await dumpJob(page);
if (job?.status !== lastStatus) {
console.log(` status=${job?.status} pct=${job?.progress?.pct}`);
lastStatus = job?.status;
const vids = job?.videos ?? [];
const status =
job?.error ? "failed"
: vids.length > 0 && vids.every((v) => v.sync) ? "synced"
: "syncing";
if (status !== lastStatus) {
console.log(` status=${status} (${vids.filter((v) => v.sync).length}/${vids.length} cams)`);
lastStatus = status;
}
if (job?.status === "synced") return job;
if (job?.status === "failed") throw new Error(`sync failed: ${job.error}`);
if (status === "synced") return job;
if (status === "failed") throw new Error(`sync failed: ${job.error}`);
await page.waitForTimeout(800);
}
throw new Error("timeout waiting for sync");
Expand Down Expand Up @@ -193,23 +218,31 @@ async function addCutsAndRender(page, jobId, cuts, name) {
await page.waitForTimeout(3500);
await shot(page, `${name}-editor-with-cuts`);

// A completed render is signalled by job.lastRender (completedAt +
// outputBytes), not a job-level status field — baseline it pre-click.
const prevRenderAt = (await dumpJob(page))?.lastRender?.completedAt ?? 0;

// Click "Render" button in the editor.
await page.getByRole("button", { name: /^render$|^rendering/i }).click({ timeout: 3000 });
await page.waitForTimeout(800);
await shot(page, `${name}-render-screen`);

// Wait for render to land.
const t0 = Date.now();
let lastStatus = null;
while (Date.now() - t0 < 600_000) {
while (Date.now() - t0 < 300_000) {
const job = await dumpJob(page);
if (job?.status !== lastStatus) {
console.log(` render status=${job?.status} pct=${job?.progress?.pct}`);
lastStatus = job?.status;
}
if (job?.status === "rendered") return { ok: true, bytes: job.outputBytes };
if (job?.status === "failed") return { ok: false, error: job.error };
const lr = job?.lastRender;
if (lr && lr.completedAt > prevRenderAt)
return { ok: true, bytes: lr.outputBytes };
const failText = await page
.locator("text=/render failed|Rendering failed/i")
.first()
.textContent({ timeout: 200 })
.catch(() => null);
if (failText) return { ok: false, error: failText.trim() };
await page.waitForTimeout(1500);
}
await shot(page, `${name}-render-timeout`);
return { ok: false, error: "render timeout" };
}

Expand Down
184 changes: 184 additions & 0 deletions frontend/scripts/verify-undo-e2e.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
/**
* Undo/redo smoke (#69), end to end in a real Chromium.
*
* Seeds a direct-mode job from the README fixtures, opens the Editor,
* records a cam-cut with the "2" hotkey, then exercises Cmd+Z /
* Shift+Cmd+Z and asserts the change AND its persistence: auto-persist
* must write the restored state back to IndexedDB (the whole point of
* #69 — a wiped performance was un-recoverable within 300 ms).
*
* Prereq: dev server on :5173 (`npm run dev`).
*/
import { chromium } from "playwright";

const BASE = process.env.BASE ?? "http://localhost:5173";
const log = (msg) =>
console.log(`[undo-e2e] ${new Date().toISOString().slice(11, 19)} ${msg}`);

const browser = await chromium.launch({ headless: true });
const ctx = await browser.newContext({ viewport: { width: 1456, height: 900 } });
ctx.on("pageerror", (err) => console.error("[page-error]", err.message));
const page = await ctx.newPage();

await page.goto(BASE, { waitUntil: "networkidle" });
log("upload page visible");

// Seed a two-cam direct job from the fixtures and wait for sync.
const jobId = await page.evaluate(async () => {
const m = await import("/src/local/jobs.ts");
async function asFile(url, name, type) {
const r = await fetch(url);
return new File([await r.blob()], name, { type });
}
const audio = await asFile(
"/__readme_fixtures__/studio.mp3",
"studio.mp3",
"audio/mpeg",
);
const v1 = await asFile("/__readme_fixtures__/take-1.mp4", "take-1.mp4", "video/mp4");
const v2 = await asFile("/__readme_fixtures__/take-2.mp4", "take-2.mp4", "video/mp4");
const id = await m.createJob(
[
{ file: v1, handle: null },
{ file: v2, handle: null },
],
{ file: audio, handle: null },
{ title: "Undo E2E", mode: "direct" },
);
for (let i = 0; i < 120; i++) {
const j = await m.jobsDb.getJob(id);
const vids = j?.videos ?? [];
if (vids.length === 2 && vids.every((v) => v.sync && v.durationS)) break;
await new Promise((r) => setTimeout(r, 500));
}
return id;
});
log(`job synced: ${jobId}`);

await page.goto(`${BASE}/job/${jobId}/edit`, { waitUntil: "networkidle" });
await page.waitForSelector('[aria-label="Play"]', { timeout: 20_000 });
log("editor loaded");

// Dev-only StrictMode artifact: the double-mounted editor can race its
// own Web Lock and raise the "open in another tab" warning. Dismiss it
// so pointer interactions aren't intercepted (keyboard is unaffected).
const tabWarn = page.getByRole("button", { name: "Edit here anyway" });
if (await tabWarn.isVisible().catch(() => false)) {
await tabWarn.click();
log("dismissed second-tab warning (StrictMode lock race)");
}

async function idbCuts() {
return await page.evaluate(async (id) => {
const m = await import("/src/local/jobs.ts");
const j = await m.jobsDb.getJob(id);
return j?.cuts ?? [];
}, jobId);
}

async function settlePersist() {
// auto-persist debounce is 300 ms; give it comfortable slack.
await page.waitForTimeout(900);
}

// Wait for the master audio's metadata so Space actually starts playback
// (HTMLMediaElement metadata load can be slow under headless Chromium).
await page.waitForFunction(
() => {
const aud = document.querySelectorAll("audio");
return aud.length >= 1 && Number.isFinite(aud[0].duration);
},
{ timeout: 20_000 },
);
log("audio metadata loaded");

// Advance the playhead into the song and record a cam-cut. A tap to the
// cam already on PROGRAM is a store no-op, and a cam without material at
// the playhead is too — so at increasing playhead positions try both
// hotkeys until one records.
await page.click("body");
let afterCut = [];
for (const target of [1.5, 5, 9, 14]) {
await page.keyboard.press("Space");
await page.waitForFunction(
(t) => {
const active = [...document.querySelectorAll("audio")].find(
(a) => !a.paused,
);
return !!active && active.currentTime > t;
},
target,
{ timeout: 30_000 },
);
await page.keyboard.press("Space"); // pause at ~target
for (const key of ["2", "1"]) {
await page.keyboard.press(key);
await settlePersist();
afterCut = await idbCuts();
if (afterCut.length > 0) break;
}
if (afterCut.length > 0) break;
}
if (afterCut.length !== 1) {
const diag = await page.evaluate(() => ({
audios: [...document.querySelectorAll("audio")].map((a) => ({
paused: a.paused,
t: a.currentTime,
dur: a.duration,
})),
hooks: window.__editorTestHooks ?? null,
}));
throw new Error(
`expected 1 persisted cut after cam hotkey, got ${afterCut.length} — ${JSON.stringify(diag)}`,
);
}
log(`✓ cut recorded + persisted (${JSON.stringify(afterCut)})`);

// Transport affordance: undo button enabled, redo disabled.
const undoDisabled = await page
.locator('[aria-label="Undo the last edit"]')
.isDisabled();
const redoDisabled = await page
.locator('[aria-label="Redo the last undone edit"]')
.isDisabled();
if (undoDisabled || !redoDisabled) {
throw new Error(
`transport buttons wrong: undoDisabled=${undoDisabled} redoDisabled=${redoDisabled}`,
);
}
log("✓ transport undo enabled / redo disabled");

// Cmd+Z — the cut disappears AND the empty cuts list persists to IDB.
await page.keyboard.press("Meta+z");
await settlePersist();
const afterUndo = await idbCuts();
if (afterUndo.length !== 0) {
throw new Error(`expected 0 persisted cuts after undo, got ${afterUndo.length}`);
}
log("✓ Cmd+Z removed the cut and auto-persist wrote it through");

const toast = await page
.locator('[data-testid="editor-notice"]')
.textContent()
.catch(() => null);
log(`undo toast: ${JSON.stringify(toast)}`);

// Shift+Cmd+Z — the cut returns and persists again.
await page.keyboard.press("Meta+Shift+z");
await settlePersist();
const afterRedo = await idbCuts();
if (afterRedo.length !== 1) {
throw new Error(`expected 1 persisted cut after redo, got ${afterRedo.length}`);
}
log("✓ Shift+Cmd+Z restored the cut and persisted it");

// Redo button click path: undo once more via the transport button.
await page.click('[aria-label="Undo the last edit"]');
await settlePersist();
if ((await idbCuts()).length !== 0) {
throw new Error("transport undo button did not undo");
}
log("✓ transport undo button works");

await browser.close();
log("PASS");
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
detectCapabilities,
initCapabilities,
meetsMinRequirements,
} from "./local/capabilities";
} from "./core/capabilities";
import { HelpOverlay } from "./editor/components/HelpOverlay";
import { RecMark } from "./editor/components/RuleStrip";
import { Footer } from "./components/Footer";
Expand Down
Loading
Loading
0