commit 2041886fe4d644f2874af082c8c2c2dd784b1959
parent 340afde362fa1e21a7a11ae5a21c9605c656e3e3
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 20 Nov 2026 17:49:28 -0500
umtool: serve the gap-cue layer's preview pages (Play's iframe of a mark)
LAYER_REGIONS gains gap-cue; its window pages are named for a mark,
<entry>.g<k>, served only for the cut's own entries. Without it Play's
gap-cue layer was a 404 (the deck e2e caught it).
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/umtool/lib/report/layerPreview.test.mjs b/umtool/lib/report/layerPreview.test.mjs
@@ -48,6 +48,11 @@ test("the files route serves a layer's project by its name, a window's only for
assert.equal(layerPreviewOf("chapter-preview-b", ["a", "b"]), "chapter-preview-b");
assert.equal(layerPreviewOf("chapter-preview-zz", ["a", "b"]), null);
assert.equal(layerPreviewOf("chapter-preview-..", [".."]), null);
+ // The gap mark's windows are its marks (`<entry>.g<k>`), served for the cut's own entries only.
+ assert.equal(layerPreviewOf("gap-cue-preview-b.g0", ["a", "b"]), "gap-cue-preview-b.g0");
+ assert.equal(layerPreviewOf("gap-cue-preview-b.g12", ["b"]), "gap-cue-preview-b.g12");
+ assert.equal(layerPreviewOf("gap-cue-preview-zz.g0", ["a", "b"]), null);
+ assert.equal(layerPreviewOf("gap-cue-preview-b", ["b"]), null, "a mark id, not an entry's");
assert.equal(layerPreviewOf("deck-preview"), null);
assert.deepEqual(previewDirFor("/p", "sourced", ["status-preview", "index.html"], []), { dir: "/p/out/sourced/chrome/status-preview", rest: ["index.html"] });
// The deck's own preview, as it always was.
diff --git a/umtool/lib/report/serve.mjs b/umtool/lib/report/serve.mjs
@@ -1077,7 +1077,7 @@ export function previewDirFor(projectDir, variant, rest, segmentIds) {
// (Every module that declares `play` must be here, or Play's iframe of its page is a 404: the measure
// extras and the instruments too -- the dial's finale is a window its module names `dial-finale-preview`,
// never confused with the dial's `dial-preview-<segment>`.)
-export const LAYER_REGIONS = Object.freeze(["pair", "status", "chapter", "stats", "threads", "flips", "fx", "shelf", "diet", "peak", "goals", "promise", "streak", "dial", "odometer", "trail", "dial-finale", "runs-finale"]);
+export const LAYER_REGIONS = Object.freeze(["gap-cue", "pair", "status", "chapter", "stats", "threads", "flips", "fx", "shelf", "diet", "peak", "goals", "promise", "streak", "dial", "odometer", "trail", "dial-finale", "runs-finale"]);
/** The project name a layer preview is served under, or null when `head` is not one. */
export function layerPreviewOf(head, segmentIds = []) {
@@ -1088,7 +1088,9 @@ export function layerPreviewOf(head, segmentIds = []) {
if (head.startsWith(prefix)) {
const seg = head.slice(prefix.length);
if (!seg || /[\/\\\0]/.test(seg) || seg === "." || seg === "..") return null;
- return new Set(segmentIds).has(seg) ? head : null;
+ // The gap mark's windows are its marks, `<segment>.g<k>` (chrome-gap-cue.mjs): one of the cut's entries' marks.
+ const own = region === "gap-cue" ? /^(.+)\.g\d+$/.exec(seg)?.[1] ?? null : seg;
+ return own !== null && new Set(segmentIds).has(own) ? head : null;
}
}
return null;