Archilyzer · Source

archilyzer

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

commit 21b27b2ea89b00656f5b9fcf77c0cdbd18519eda
parent 58ff3d09e49ce358a48beb1dae3d70e9c576c628
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 26 Oct 2026 14:52:38 -0400

Posts feed: a screenshot alone in the column fills the card's width (feedShotLone), up to the column's height; the card under it counts only if it stays on screen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Meditor/CHANGELOG.md | 1+
Mumtool/report-to-video/chrome-feed.mjs | 42++++++++++++++++++++++++++++++++++++++++--
Mumtool/report-to-video/chrome-feed.test.mjs | 49++++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 87 insertions(+), 5 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **A post screenshot alone in the posts feed fills the card's width.** The feed only let a tall screenshot grow into the room beside the card under it, and it kept that room even when the card under it was about to be pushed out of the column, so the Huck video's 21 October "new kind of seizure" post stood alone at 345 px wide in a 556 px card with the column empty under it. A screenshot whose card arrives alone, or pushes the one under it out, now takes the card's full width, its height following the picture, up to the column's height (larger than the screenshot itself if the width needs it). With a card under it that stays on screen, the feed draws exactly as before, and a feed with no screenshots builds the same page, so its cached render is reused. - **A twin of a finished report-video take renders in a fraction of the time.** A full build of the Huck cut took about 1 h 45 m, and its uncensored twin — the same cut with `render.blur` off — took as long again, because every build encoded all 66 clips again (about 8 minutes), which in turn redid every crossfade batch, and captured the on-screen chrome again (about 47 minutes) once the first build had pruned its frames. Now a clip's segment is encoded again only when something that makes its picture or sound changed (its cut, snap, room, blur, framing, captions, loudness, encode settings or source file); otherwise the one on disk is reused untouched, and so are the crossfade batches over it. `umtool take <project> --id <id> --from <other take> …` starts a take from another take's render: it hard-links that take's clip segments, chrome frames and crossfade batches in (no copies, and the other take's files never change) and renders, rebuilding only what differs — for the uncensored twin, the blurred clip and the batch it sits in, then the final overlay. Make the first take with `--keep-frames` so its chrome frames are still there for the twin (they are 1–3 GB a layer; without it they are pruned after the render as before). `--from` refuses a take that does not exist, the take itself, or a take never rendered. Needs a restart of umtool for the Takes page's jobs; the CLI has it at once. - **A report video's fact-check counter can stay off screen until it first counts.** The deck's tally drew every verdict's cell from the first frame, so in the Huck cut the "Huck's Blend pitches" cell read 0 for about 23 of its 29 minutes. With `render.chrome.factcheck.tally.showAt: "first"` a cell is hidden until the stamp that gives it its first count lands; then it pops in already reading that count, flashes, and stays to the end. `{ "PARTLY": "first" }` sets it for one verdict's cell only. The default, `"always"`, is the tally as before. A hidden cell keeps its place in the row, and the finale's totals still show every verdict. Set it in the On-screen tab's fact-check labels (**pop in**, per verdict), with `umtool look <project> factcheck.tally.showAt=first` (or `factcheck.tally.showAt.PARTLY=first`; `factcheck.tally.showAt=` clears it), or in a take (`--set render.chrome.factcheck.tally.showAt=first`). An unknown value is refused by name. The clip editor's live preview and the Play view show the same deck page as the render, so the cell pops in at the same moment there. Needs a restart of umtool and a rebuild of the video. - **A report video's finale timeline no longer prints words over words.** In the Huck cut's finale the claim checks' words all stood on one line over the rail (`“less than ten” a year`, `19 seizures on camera`, `12 in a day · 4 in a week`, both pill-test goalposts), the `12 IN A DAY`/`4 IN A WEEK` labels ran into the markers' flags, and the turned dates under the rail overlapped. Now the claim checks take turns (`deck.finale.claims`: `rotate`, the default — one claim at a time for an even share of the finale's time, at least 6 s each, with a short crossfade; `all` stacks them), every claim's words, span label and marker label is laid in its own place in rows over the rail, with its stick kept inside its bracket and clear of the words under it, and a crowded rail says each date once and fans the turned labels out on thin leaders so no two meet. The timeline takes the height its rows need (`deck.finale.timelineShare`: `auto`, up to just over half the frame, its words set larger when there is room; or a share 0.38–0.6), and the clip, the totals and the stats shrink to fit under it. A finale without claim checks and with room for its labels renders as before. Re-render a take to see it. diff --git a/umtool/report-to-video/chrome-feed.mjs b/umtool/report-to-video/chrome-feed.mjs @@ -224,6 +224,40 @@ export function feedShotRoom({ heights, shots, column, gap = 16 }) { } /** + * feedShotRoom, and the room a card is left ALONE in: the card under it + * counts only if it stays on screen once this one lands. feedCues pushes it + * down by this card's height (at the cap) and the gap; when that already puts + * it past the column's bottom it leaves anyway, and the picture takes the + * whole column -- the card's full inner width, its height following the + * picture's aspect (upscaled if need be), capped at the column's height. The + * first card is alone too. With a card under it that stays, the room is + * exactly feedShotRoom's. PURE and SELF-CONTAINED (embedded like feedCues). + * + * Only a page with a screenshot carries it (in place of feedShotRoom, which is + * a no-op without one), so a page without one is byte-for-byte what it was and + * its cached render still hits. + * + * @returns {{ imgs: Array<number|null>, heights: number[] }} + */ +export function feedShotLone({ heights, shots, column, gap = 16 }) { + const out = heights.slice(); + const imgs = heights.map(() => null); + for (let j = 0; j < out.length; j += 1) { + const s = shots[j]; + if (!s || !(s.full > s.drawn + 1)) continue; + const chrome = (heights[j] || 0) - s.drawn; + const stays = j > 0 && (heights[j] || 0) + gap + out[j - 1] <= column; + const beside = stays ? out[j - 1] + gap : 0; + const room = Math.floor(column - beside - chrome); + const img = Math.min(Math.round(s.full), room); + if (img <= s.drawn) continue; + imgs[j] = img; + out[j] = chrome + img; + } + return { imgs, heights: out }; +} + +/** * Who the feed is, for its header: the one author's name and platform when * every post is theirs, else "Posts" and every platform there is. */ @@ -267,6 +301,10 @@ export function feedHtml(schedule, render, opts = {}) { const left = deck.posts.position === "top-left"; const c = lay.card; const who = feedWho(posts); + // A picture alone in the column takes all of it (feedShotLone); a page + // without a picture keeps feedShotRoom's text, so its bytes -- and the + // render cache keyed on them -- are what they were. + const anyShot = posts.some((p) => shotSrcs[p.id]); const panel = deck.background === "panel"; // The column's ground meets the deck's top edge in the deck's own colour, @@ -435,7 +473,7 @@ export function feedHtml(schedule, render, opts = {}) { const byK = {}; for (const el of document.querySelectorAll("[data-k]")) byK[el.dataset.k] = el; ${embedFn("feedCues", feedCues)} - ${embedFn("feedShotRoom", feedShotRoom)} + ${anyShot ? embedFn("feedShotLone", feedShotLone) : embedFn("feedShotRoom", feedShotRoom)} const params = new URLSearchParams(location.search); // A window plays the cut's [from, from + dur]; the page is seeked in its own seconds. @@ -485,7 +523,7 @@ export function feedHtml(schedule, render, opts = {}) { const full = (img.parentElement.clientWidth - 2 * F.shotPad) * img.naturalHeight / img.naturalWidth; return { drawn: img.offsetHeight, full }; }); - const room = feedShotRoom({ heights: cards.map((c) => c.offsetHeight), shots, column: F.column, gap: F.motion.gap }); + const room = ${anyShot ? "feedShotLone" : "feedShotRoom"}({ heights: cards.map((c) => c.offsetHeight), shots, column: F.column, gap: F.motion.gap }); room.imgs.forEach((h, j) => { if (h != null) cards[j].querySelector("img.shot").style.maxHeight = h + "px"; }); const heights = cards.map((c) => c.offsetHeight); document.documentElement.dataset.shots = room.imgs.map((h) => h ?? "").join(","); diff --git a/umtool/report-to-video/chrome-feed.test.mjs b/umtool/report-to-video/chrome-feed.test.mjs @@ -11,7 +11,7 @@ import { tmpdir } from "node:os"; import path from "node:path"; import test from "node:test"; -import { FEED_MOTION, feedCues, feedHtml, feedLayout, feedShotRoom, feedWho } from "./chrome-feed.mjs"; +import { FEED_MOTION, feedCues, feedHtml, feedLayout, feedShotLone, feedShotRoom, feedWho } from "./chrome-feed.mjs"; import { deckChoreography, deckGeometry, deckSchedule, estimateSchedule, feedGeometry, feedOn, postHolds, postSchedule, postsGeometry, postWindows, validateChrome, validatePosts, @@ -463,11 +463,54 @@ test("feedShotRoom: a tall screenshot grows into the room beside the card under assert.deepEqual(two.imgs, [680, null], "the first takes the empty column; the second has no room past its cap"); }); +test("feedShotLone: a tall picture alone in the column fills the card's width, capped at the column's height", () => { + // The first card, a picture drawn at 290 of a full 470 (chrome 20), column 760: its full-width height. + assert.deepEqual(feedShotLone({ heights: [310], shots: [{ drawn: 290, full: 470 }], column: 760 }).imgs, [470]); + // Upscaled past its natural size if the width asks for it, but never past the column (760 - 20 chrome). + const tall = feedShotLone({ heights: [310], shots: [{ drawn: 290, full: 1400 }], column: 760 }); + assert.deepEqual(tall.imgs, [740]); + assert.deepEqual(tall.heights, [760]); + // The card under it leaves anyway: 310 + 16 + 600 > 760, so feedCues pushes it out as this one + // lands -- the column is this card's, not the 760 - 616 - 20 = 124 feedShotRoom left (no growth). + const alone = { heights: [600, 310], shots: [null, { drawn: 290, full: 470 }], column: 760, gap: 16 }; + assert.deepEqual(feedShotRoom(alone).imgs, [null, null]); + assert.deepEqual(feedShotLone(alone).imgs, [null, 470]); + assert.ok(310 + 16 + 600 > 760, "the card under it is the one feedCues pushes out"); + const plan = feedCues({ posts: [{ id: "a", in: 1 }, { id: "b", in: 5 }], heights: feedShotLone(alone).heights, column: 760 }); + assert.deepEqual(plan.gone, [5, null], "the grown one is alone on screen once it lands"); + // A run of them: each pushes the last out, and each takes the column. + const run = feedShotLone({ heights: [310, 310, 310], shots: [{ drawn: 290, full: 900 }, { drawn: 290, full: 900 }, { drawn: 290, full: 470 }], column: 760 }); + assert.deepEqual(run.imgs, [740, 740, 470]); +}); + +test("feedShotLone: with a card under it that stays, the room is exactly feedShotRoom's", () => { + for (const args of [ + { heights: [200, 310], shots: [null, { drawn: 290, full: 900 }], column: 700, gap: 16 }, + { heights: [200, 310, 280], shots: [null, { drawn: 290, full: 290 }, { drawn: 270, full: 900 }], column: 700 }, + { heights: [150, 120, 310, 140], shots: [null, null, { drawn: 290, full: 520 }, null], column: 760 }, + { heights: [120, 310, 130, 310], shots: [null, { drawn: 290, full: 380 }, null, { drawn: 290, full: 330 }], column: 760 }, + ]) { + assert.deepEqual(feedShotLone(args), feedShotRoom(args), JSON.stringify(args)); + } +}); + +test("the page: one without a screenshot keeps feedShotRoom (its bytes unchanged); one with a screenshot carries feedShotLone", () => { + const plain = page(POSTS).html; + assert.match(plain, /const feedShotRoom = /); + assert.match(plain, /const room = feedShotRoom\(\{ heights/); + assert.doesNotMatch(plain, /feedShotLone/); + const posts = POSTS.map((p) => (p.id === "b" ? { ...p, shot: "shots/b.webp" } : p)); + const shot = page(posts, { shotSrcs: { b: "assets/shot00.webp" } }).html; + assert.match(shot, /const feedShotLone = /); + assert.match(shot, /const room = feedShotLone\(\{ heights/); + assert.doesNotMatch(shot, /feedShotRoom = /); +}); + test("the page: the screenshot rule rides in the page and sizes the pictures before the plan", () => { const posts = POSTS.map((p) => (p.id === "b" ? { ...p, shot: "shots/b.webp" } : p)); const { html } = page(posts, { shotSrcs: { b: "assets/shot00.webp" } }); - assert.match(html, /const feedShotRoom = /); - const grow = html.indexOf("feedShotRoom({"); + assert.match(html, /const feedShotLone = /); + const grow = html.indexOf("feedShotLone({"); const plan = html.indexOf("feedCues({", grow); assert.ok(grow > 0 && plan > grow, "pictures are sized before the stack is planned from the heights"); assert.match(html, /"shotPad":10/);