From 6619e6e1fb463add92581c773aec4dedd439b304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 8 Oct 2026 23:35:05 -0400 Subject: [PATCH] Site: close road gaps, ElyMark exports to PDF, test road links; recording fixes --- site/src/model.ts | 5 +++-- site/test/model.test.ts | 33 +++++++++++++++++++++++++++++++++ site/video/record/lib.sh | 11 ----------- site/video/record/tree.sh | 2 +- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/site/src/model.ts b/site/src/model.ts index 8f64cd7..9923bef 100644 --- a/site/src/model.ts +++ b/site/src/model.ts @@ -38,13 +38,14 @@ const tree = [on(6.5, 7.6, 0.7, 0.7, 2.8), on(8.7, 7.6, 0.7, 0.7, 1.8), on(7.2, /** Headings stepping down. */ const mark = [0, 1, 2].map((i) => on(1, 7 + i, 3, 1, 2 - i * 0.6)); -/** Roads: every document exports to PDF; Markdown goes to Git. */ +/** Roads: exports go to PDF; Markdown goes to Git. */ const road = (x: number, y: number, w: number, d: number) => on(x, y, w, d, 0.08, 0, ACCENT); const roads = [ road(2, 4, 0.6, 0.6), - road(6, 4, 0.6, 0.6), + road(6, 3.9, 0.6, 0.7), road(10.7, 2.85, 0.6, 1.75), road(2, 4.6, 11, 0.6), + road(2, 5.2, 0.6, 1.8), road(4, 7.6, 2.5, 0.6), ]; diff --git a/site/test/model.test.ts b/site/test/model.test.ts index 8686dbd..3c8b09d 100644 --- a/site/test/model.test.ts +++ b/site/test/model.test.ts @@ -25,3 +25,36 @@ test("the accent covers at most a tenth of the visible tops", () => { test("six apps between the desk and the roads", () => { assert.deepEqual(model.slice(1, -1).map((p) => p.name), ["ElyDoc", "ElyTable", "ElyShow", "ElyPDF", "ElyTree", "ElyMark"]); }); + +type Box = (typeof all)[number]; +const near = (a: number, aw: number, b: number, bw: number) => a <= b + bw + 1e-9 && b <= a + aw + 1e-9; +const shared = (a: number, aw: number, b: number, bw: number) => Math.min(a + aw, b + bw) - Math.max(a, b) > 1e-9; +/** Two ground blocks meet along an edge or overlap. */ +const meet = (a: Box, b: Box) => + a.z === b.z && near(a.x, a.w, b.x, b.w) && near(a.y, a.d, b.y, b.d) && + (shared(a.x, a.w, b.x, b.w) || shared(a.y, a.d, b.y, b.d)); + +const part = (name: string) => { + const found = model.find((p) => p.name === name); + assert.ok(found, name); + return found.blocks; +}; + +/** Whether roads join two apps' ground blocks. */ +function linked(from: string, to: string): boolean { + const roads = part("Roads"); + const ground = (name: string) => part(name).filter((b) => b.z === roads[0].z); + const start = roads.filter((r) => ground(from).some((b) => meet(r, b))); + const seen = new Set(start); + for (const r of seen) for (const n of roads) if (!seen.has(n) && meet(r, n)) seen.add(n); + return [...seen].some((r) => ground(to).some((b) => meet(r, b))); +} + +test("every app has a building", () => { + for (const p of model.slice(1, -1)) assert.ok(p.blocks.length > 0, p.name); +}); + +test("roads carry exports to PDF and Markdown to Git", () => { + for (const app of ["ElyDoc", "ElyTable", "ElyShow", "ElyMark"]) assert.ok(linked(app, "ElyPDF"), app); + assert.ok(linked("ElyMark", "ElyTree")); +}); diff --git a/site/video/record/lib.sh b/site/video/record/lib.sh index e58f6a6..2dcca71 100644 --- a/site/video/record/lib.sh +++ b/site/video/record/lib.sh @@ -63,17 +63,6 @@ wait_log() { return 1 } -# Waits until the AX tree shows text $1. -wait_ax() { - local i - for i in $(seq $((${2:-30} * 2))); do - "$bin/ax-values" "$app_pid" | grep -q -- "$1" && return 0 - sleep 0.5 - done - echo "AX never showed: $1" >&2 - return 1 -} - # Center "x y" of the first AX line matching $1. where() { local i at diff --git a/site/video/record/tree.sh b/site/video/record/tree.sh index f7bda7a..b6749e7 100644 --- a/site/video/record/tree.sh +++ b/site/video/record/tree.sh @@ -31,7 +31,7 @@ mark "History tab: graph" mouse click $((x + 145)) $((y + 85)) pause 1.2 mark "open the new commit" -mouse click $((x + 260)) $((y + 220)) +mouse click $((x + 260)) $((y + 156)) pause 1.0 mouse move $((x + 1000)) $((y + 700)) 0.8 pause 1.5