Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit cd97fdb16e501bfd8862c3addc15b21b633660f3
parent 6b5c34e84fa3722f12615585dbbc12615ff1607b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 10 Nov 2026 15:53:26 -0500

umtool: a note taken in a version's review pass records the version with its anchor (entry anchors take an optional `take`; `umtool notes` says "of version vN") -- L7b review item 11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diffstat:
Mumtool/components/notes/AnchoredNotes.tsx | 3++-
Mumtool/components/projects/workspace/ReviewPass.tsx | 3++-
Mumtool/e2e/review-pass.spec.ts | 10++++++++++
Mumtool/lib/annotations/digest.mjs | 6++++--
Mumtool/lib/annotations/shape.mjs | 4+++-
Mumtool/lib/annotations/store.test.mjs | 4++++
Mumtool/lib/annotations/types.ts | 2+-
7 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/umtool/components/notes/AnchoredNotes.tsx b/umtool/components/notes/AnchoredNotes.tsx @@ -9,7 +9,8 @@ import { NoteComposer, NoteThread } from "./NoteThread"; // The notes on one THING: a timeline row (`entry`), a take (`take`). A count // of the open ones, folded; unfolded, every note on it and a box for another. -type Pin = { kind: "entry"; entry: string } | { kind: "take"; take: string }; +// An entry pin's `take`: a note taken on a saved version (its review pass) records it. +type Pin = { kind: "entry"; entry: string; take?: string } | { kind: "take"; take: string }; export const notesOn = (notes: Note[], pin: Pin) => notes.filter((n) => { diff --git a/umtool/components/projects/workspace/ReviewPass.tsx b/umtool/components/projects/workspace/ReviewPass.tsx @@ -361,7 +361,8 @@ export default function ReviewPass({ </span> </form> )} - {noting && <AnchoredNotes key={entry.id} notes={notes} pin={{ kind: "entry", entry: entry.id }} startOpen />} + {/* On a version, the note records which (its anchor's `take`): `umtool notes` says it was about vN. */} + {noting && <AnchoredNotes key={entry.id} notes={notes} pin={{ kind: "entry", entry: entry.id, ...(take ? { take: take.id } : {}) }} startOpen />} {err && ( <p role="alert" className="m-0 text-[12px] text-reject-text" data-review-error=""> {err} diff --git a/umtool/e2e/review-pass.spec.ts b/umtool/e2e/review-pass.spec.ts @@ -154,6 +154,16 @@ test("a version's review pass is read-only: watched and noted, never marked -- O await page.keyboard.press("k"); await page.waitForTimeout(400); expect(readFileSync(path.join(DIR, "video.manifest.json"), "utf8")).toBe(before); + // A note on a version's block records the version (`umtool notes` says which it was about). + const block = await pass(page).getAttribute("data-review-current"); + await page.keyboard.press("n"); + const input = page.getByTestId(`note-input-${block}`); + await expect(input).toBeFocused(); + await input.fill("on v1 this ran long"); + await input.press("Enter"); + await expect + .poll(() => (json("notes.json").notes as { text: string; anchor: Record<string, string> }[]).find((n) => n.text === "on v1 this ran long")?.anchor) + .toEqual({ kind: "entry", entry: block, take: "v1" }); // The take walk's old address is this pass (a 308). const res = await page.request.get(urls.takeWalkHref(P, "v1"), { maxRedirects: 0 }); expect(res.status()).toBe(308); diff --git a/umtool/lib/annotations/digest.mjs b/umtool/lib/annotations/digest.mjs @@ -130,10 +130,12 @@ function anchorLines(a, ctx) { return lines; } case "entry": { + // A note taken on a saved version (its review pass) says which: the draft's entry may differ from it. + const on = a.take ? ` of version \`${a.take}\`` : ""; const e = (manifest?.timeline ?? []).find((x) => x.id === a.entry); - if (!e) return [`**On:** timeline entry \`${a.entry}\` (no longer in the manifest)`]; + if (!e) return [`**On:** timeline entry \`${a.entry}\`${on} (no longer in the manifest)`]; const title = e.title ?? e.onscreen?.title; - const lines = [`**On:** timeline entry \`${a.entry}\` (${e.type ?? "entry"})${title ? ` “${clip(title, 160)}”` : ""}`]; + const lines = [`**On:** timeline entry \`${a.entry}\`${on} (${e.type ?? "entry"})${title ? ` “${clip(title, 160)}”` : ""}`]; if (e.quote) lines.push(quoteLine(e.quote)); if (e.type === "clip" && e.channel && e.video) lines.push(`source ${e.channel}/${e.video}@${e.start}-${e.end}`); return lines; diff --git a/umtool/lib/annotations/shape.mjs b/umtool/lib/annotations/shape.mjs @@ -79,7 +79,9 @@ export function validateAnchor(raw) { return { anchor: { kind: "cite", cite: a.cite } }; case "entry": if (!short(a.entry, 128) || !ID.test(a.entry)) return { error: "entry anchor needs an entry id" }; - return { anchor: { kind: "entry", entry: a.entry } }; + // `take`: the saved version the note was taken on (a version's review pass, umtool redesign L7b). + if (a.take !== undefined && (!isStr(a.take) || !TAKE_ID.test(a.take))) return { error: "entry take is not a take id" }; + return { anchor: { kind: "entry", entry: a.entry, ...(a.take !== undefined ? { take: a.take } : {}) } }; case "take": if (!isStr(a.take) || !TAKE_ID.test(a.take)) return { error: "take anchor needs a take id" }; return { anchor: { kind: "take", take: a.take } }; diff --git a/umtool/lib/annotations/store.test.mjs b/umtool/lib/annotations/store.test.mjs @@ -130,6 +130,10 @@ test("anchors: every kind validates; bad ones refuse", () => { assert.equal(validateAnchor(ok[4]).anchor.t, 12.35); assert.deepEqual(validateAnchor(ok[4]).anchor.resolved, { title: "T", sourceT: 81.23, approx: true }); assert.equal(validateAnchor({ kind: "text", section: "s", quote: "q" }).anchor.prefix, ""); + // A note on a block of a saved version (its review pass, L7b) records the version. + assert.deepEqual(validateAnchor({ kind: "entry", entry: "c02", take: "v3" }).anchor, { kind: "entry", entry: "c02", take: "v3" }); + assert.deepEqual(validateAnchor({ kind: "entry", entry: "c02" }).anchor, { kind: "entry", entry: "c02" }); + assert.ok("error" in validateAnchor({ kind: "entry", entry: "c02", take: "Bad Id" })); const bad = [ null, { kind: "text", section: "s" }, diff --git a/umtool/lib/annotations/types.ts b/umtool/lib/annotations/types.ts @@ -39,7 +39,7 @@ export type Anchor = | { kind: "section"; section: string } | { kind: "whole" } | { kind: "moment"; file: string; t: number; take?: string; entry?: string; resolved?: MomentResolved } - | { kind: "entry"; entry: string } + | { kind: "entry"; entry: string; take?: string } | { kind: "take"; take: string } | { kind: "edit"; entry?: string; field: string; from: unknown; to: unknown } /** A moment of the cut as the Play view plays it: the cut second, the clip and its source second, the take. */