commit fb56252b86759192defc551b3f17b4e1bd9924b1
parent c037a972fdde1b263d70ee1968cfe3ef67381577
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 4 Nov 2026 01:13:50 -0500
umtool: a threaded card with no attachments is as tall as its conversation and centred (never taller than its box), not a full-height card with the posts at its top; the thread-reads spec reads where Play opened rather than the exact second
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/umtool/e2e/thread-reads.spec.ts b/umtool/e2e/thread-reads.spec.ts
@@ -70,7 +70,8 @@ async function playAt(page: Page, at: number) {
await expect(player).toHaveAttribute("data-post-thread", "2", { timeout: 15_000 });
const frame = page.frameLocator('[data-post-card-frame="read"]');
await expect(frame.locator("body")).toHaveAttribute("data-post-thread", "2", { timeout: 15_000 });
- await expect(player).toHaveAttribute("data-post-s", String(at));
+ // Play opens there (give or take its first tick).
+ await expect.poll(async () => Math.abs(Number(await player.getAttribute("data-post-s")) - at)).toBeLessThan(0.3);
return { player, frame };
}
diff --git a/umtool/report-to-video/post-item.mjs b/umtool/report-to-video/post-item.mjs
@@ -931,7 +931,7 @@ export function postCardHtml(entry, { width, height, palette = {}, fonts = {}, p
`<div class="tslot" data-thread-slot="post"><div class="tile tpost" data-thread-tile="post">${repost}${lead}${head}<div class="twords" style="font-size:${psize}px">${wordsHtml(own, blurred, "post", hlOf("post"), blk("post"))}</div>${quotedTile}${counts ? `<div class="counts" data-post-counts="">${counts}</div>` : ""}</div></div>`,
);
return {
- html: `<div class="card thread" data-post-card="${esc(entry.id)}" data-post-thread="${tiles.length}" style="left:${box.x}px;top:${box.y}px;height:${box.height}px;width:${box.width}px"><div class="words" data-post-words="" style="font-size:${size}px"><div class="wflow" data-post-flow="">${tileHtml.join("")}</div><div class="wfade" data-post-fade="top"></div><div class="wfade" data-post-fade="bottom"></div></div></div>`,
+ html: `<div class="card thread" data-post-card="${esc(entry.id)}" data-post-thread="${tiles.length}"${L.mode === "text" ? ' data-thread-fit=""' : ""} style="left:${box.x}px;top:${box.y}px;height:${box.height}px;width:${box.width}px"><div class="words" data-post-words="" style="font-size:${size}px"><div class="wflow" data-post-flow="">${tileHtml.join("")}</div><div class="wfade" data-post-fade="top"></div><div class="wfade" data-post-fade="bottom"></div></div></div>`,
css: cutCss.length ? `\n${cutCss.join(", ")} { display: none; }` : "",
};
};
@@ -1009,6 +1009,14 @@ ${BAR_CSS(pal.fg)}
var min = ${minSize};
function fit() {
if (w) { var s = parseFloat(w.style.fontSize); while (w.scrollHeight > w.clientHeight + 1 && s > min) { s -= 1; w.style.fontSize = s + 'px'; } }
+ // A threaded card alone (no attachments): as tall as its conversation at full size, centred -- never taller than its box.
+ var c = document.querySelector('.card.thread[data-thread-fit]');
+ if (c && w) {
+ var f = c.querySelector('.wflow');
+ var h0 = c.offsetHeight;
+ var h = Math.min(h0, Math.ceil(f.scrollHeight + (h0 - w.clientHeight)));
+ if (h < h0) { c.style.top = (parseFloat(c.style.top) + Math.floor((h0 - h) / 2)) + 'px'; c.style.height = h + 'px'; }
+ }
document.body.setAttribute('data-post-ready', '1');
}
if (document.fonts && document.fonts.ready) document.fonts.ready.then(fit); else fit();