Archilyzer · Source

archilyzer

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

commit 3deb510156fc2af3334287b2c1e91b11ef93ec5f
parent 1479b91dfbe9f545ab713207a7a46f392efce4e8
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun, 25 Oct 2026 21:42:04 -0400

Posts feed: a tall screenshot grows into the room beside the card under it (feedShotRoom), up to its full-width height, instead of shrinking to a thumbnail

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

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

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **A tall post screenshot in the posts feed grows into the room the column has, instead of shrinking to a thumbnail.** A screenshot was capped at the height of a card of words and drawn smaller to fit it, so a post with a picture (the Huck video's "Hucks home!!!!!! God Is Good!!!") came out a narrow strip beside empty space. Now a picture cut by that cap grows, up to its own full-width height, into the room left in the column beside the card under it — that card stays on screen; only cards further down scroll out as before. A post that fits, and a card of words, are drawn as they were. Needs a restart of umtool and a rebuild of the video. - **Every wait before the archive asks a site now varies a little, and only ever upward.** A job every 20.0 s, a page every 3.0 s or a sync at the same minute each day is a machine's beat, so each such wait is now stretched by up to a quarter of itself at random, and never shortened: every pacing number stays a minimum (Rumble's 120 s, X's 5 min, the sleep between downloads). It covers the gap between two downloads and between two jobs on one platform, yt-dlp's `--sleep-requests` and `--sleep-subtitles` (drawn once per yt-dlp run, and shown in its logged command line), the archive.org, Wayback and web-fetch gaps, the rate-limit cooldowns and the platform hold's probe, the download lane's metadata-scan batches (60 to 75 titles) and its rests, Save Page Now's and the Kick recorder's polls, and each channel's sync interval (later by at most 30 minutes, the same on every tick until it syncs, and shown so on /operations/sync). The share is **Jitter on every wait before a request** on /settings (`pacing.jitter`, default 25 %; 0 turns it off). Three waits that already varied could come out SHORTER than their minimum and no longer do: the platform cooldown (±10 %), archive.org's back-off (±20 %) and a forum's page pause (as little as 0.85 of it, under its own 5 s floor). It now lands between the pause and 1.8 times it. Four loops that asked a site with no gap at all now wait between requests: a Bluesky feed's pages (3–6 s), a Nitter timeline's pages (4 s and up), the availability check's per-video probes (3 s and up) and umtool's network clip fetches in a build with no editor (one at a time per platform, 30 s apart, Rumble 120 s). Needs a restart of the editor and of umtool. - **The download lane's metadata scan reads 60 titles at a time and lets the downloads run in between.** A filtered channel's scan holds its platform's download queue while it runs, and the lane used to scan the whole backlog in one go: on 2026-10-25 the scan of h3-podcast's 1,163 unread titles, which started the moment the channel's download pause was lifted, held YouTube from 03:20 to 06:36 and nothing downloaded. The lane now scans 60 titles (about 10 minutes on YouTube), gives that platform 20 minutes of downloads, then scans the next 60, and its log says so: "1103 listed videos left to scan for h3-podcast; the next batch after 20 minutes of downloads." A scan that a platform stopped (a soft block, a rate limit) is still not retried until the next restart. **Run** on the metadata-scan operation still scans the whole backlog. Needs a restart of the editor. - **Download missing skips the videos the metadata scan read as members-only or private.** The download lane already skipped them; a Download missing run only skipped the ones a failed download had recorded, so on 2026-10-25 a run on h3-podcast tried each of the 277 members-only videos the scan had found that night four times (with and without cookies) and downloaded nothing. The run's log counts them: "Excluded 279 from this run (members_only=279, deleted=0, private=0; 277 as the metadata scan read them)." A video the scan reads again later comes back by itself. Needs a restart of the editor. diff --git a/umtool/report-to-video/chrome-feed.mjs b/umtool/report-to-video/chrome-feed.mjs @@ -191,6 +191,39 @@ export function feedCues({ } /** + * How tall each screenshot may be drawn, like a flex row: a picture capped at + * a card of words (`.shot`'s max-height) grows into the room the column has + * left beside the card under it -- the one already up when it lands, which + * stays on screen -- up to its own full-width height. Cards further down are + * pushed out as they always are. PURE and SELF-CONTAINED (embedded like + * feedCues), in card order, oldest first; a grown card is the one under the + * next card's arrival, so each is sized against the final height of the last. + * + * `heights` are the cards' heights as measured at the cap; `shots[j]` is null + * (words, or a picture that fits) or `{ drawn, full }`: the picture's height + * at the cap and at the card's full width. Returns the picture heights to + * draw (`imgs`, null to leave a card as it is) and the cards' new heights. + * + * @returns {{ imgs: Array<number|null>, heights: number[] }} + */ +export function feedShotRoom({ 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 beside = j > 0 ? 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. */ @@ -280,6 +313,7 @@ export function feedHtml(schedule, render, opts = {}) { lineH: c.lineH, textSize: c.textSize, metaSize: c.metaSize, + shotPad: c.pad - 6, startsHidden: !!schedule.segments?.[0]?.hideDeck, // Off the frame's own side edge, a little past it. slideX: left ? -(W + 24) : W + 24, @@ -358,7 +392,8 @@ export function feedHtml(schedule, render, opts = {}) { .para + .para { margin-top: ${Math.round(c.lineH * 0.34)}px; } .para.gone { display: none; } /* A post's screenshot in place of its words: as wide as the words would - be, no taller than a full card of them. */ + be, no taller than a full card of them -- unless the column has room + beside the card under it, which a tall one grows into (feedShotRoom). */ .shot-body { padding: ${c.pad - 6}px; } .shot { display: block; width: 100%; height: auto; max-height: ${Math.round(c.metaSize * 1.3) + 6 + c.maxLines * c.lineH + 2 * c.pad}px; @@ -400,6 +435,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)} const params = new URLSearchParams(location.search); // A window plays the cut's [from, from + dur]; the page is seeked in its own seconds. @@ -441,7 +477,18 @@ export function feedHtml(schedule, render, opts = {}) { ]).catch(() => {}).then(() => { const cards = F.ids.map((_, j) => byK["c" + j]); cards.forEach(clampText); + // A tall screenshot takes the room the card under it leaves (feedShotRoom): + // its full-width height is its picture's aspect at the body's width. + const shots = cards.map((c) => { + const img = c.querySelector("img.shot"); + if (!img || !img.naturalWidth) return null; + 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 }); + 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(","); const M = F.motion; const plan = feedCues({ posts: F.posts, heights, column: F.column, visibility: F.visibility, startsHidden: F.startsHidden, 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, feedWho } from "./chrome-feed.mjs"; +import { FEED_MOTION, feedCues, feedHtml, feedLayout, feedShotRoom, feedWho } from "./chrome-feed.mjs"; import { deckChoreography, deckGeometry, deckSchedule, estimateSchedule, feedGeometry, feedOn, postHolds, postSchedule, postsGeometry, postWindows, validateChrome, validatePosts, @@ -444,3 +444,31 @@ test("the page: a post with a screenshot draws it in place of its words, its QR assert.match(card, /<img src="assets\/qr0\d\.png"/); assert.equal((html.match(/class="para"/g) ?? []).length, 3, "the other three keep their words"); }); + +test("feedShotRoom: a tall screenshot grows into the room beside the card under it, up to its full height", () => { + // Card 0 words (200), card 1 a picture drawn at 290 of a full 900 (card chrome 20), column 700. + const r = feedShotRoom({ heights: [200, 310], shots: [null, { drawn: 290, full: 900 }], column: 700, gap: 16 }); + // Room: 700 - (200 + 16) beside - 20 chrome = 464 for the picture; the card under it stays on screen. + assert.deepEqual(r.imgs, [null, 464]); + assert.deepEqual(r.heights, [200, 484]); + assert.ok(r.heights[0] + 16 + r.heights[1] <= 700, "both cards fit the column"); + // Alone in the column: the whole column, but never past its own full-width height. + assert.deepEqual(feedShotRoom({ heights: [310], shots: [{ drawn: 290, full: 600 }], column: 700 }).imgs, [600]); + // A picture that fits, a card of words, or no room beyond the cap: left as they are. + const same = feedShotRoom({ heights: [200, 310, 300], shots: [null, { drawn: 290, full: 290 }, { drawn: 290, full: 900 }], column: 600 }); + assert.deepEqual(same.imgs, [null, null, null]); + assert.deepEqual(same.heights, [200, 310, 300]); + // Sized against the last card's FINAL height: two tall ones in a row share the column, the newer one getting what is left. + const two = feedShotRoom({ heights: [310, 310], shots: [{ drawn: 290, full: 800 }, { drawn: 290, full: 800 }], column: 700 }); + assert.deepEqual(two.imgs, [680, null], "the first takes the empty column; the second has no room past its cap"); +}); + +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({"); + 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/); +});