commit d0d2048155fcf4133ebb18055ff5832188eae57a
parent b172b40453da3e2b79edeeacef775b38f2cd3f93
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 10 Nov 2026 10:44:21 -0500
umtool: workspace -- a block's address seeks the viewer to it; a keyboard move reads its place itself; the strip's blocks a little wider
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/umtool/components/projects/workspace/BlockStrip.tsx b/umtool/components/projects/workspace/BlockStrip.tsx
@@ -44,7 +44,7 @@ const TINT: Record<string, string> = {
/** Pixels per second of the strip, and the narrowest a block is drawn. */
const PX_PER_S = 9;
-const MIN_W = 64;
+const MIN_W = 76;
const MAX_W = 260;
export default function BlockStrip({
@@ -146,9 +146,9 @@ export default function BlockStrip({
<span className="ml-auto shrink-0 text-[10px] uppercase tracking-[0.06em] text-muted">{TYPE_WORD[b.type] ?? b.type}</span>
</span>
<span className="truncate text-[11px] leading-tight text-text-2">{b.heading || " "}</span>
- <span className="flex items-baseline gap-1 font-mono text-[10.5px] text-muted">
+ <span className="flex min-w-0 items-baseline gap-1 overflow-hidden whitespace-nowrap font-mono text-[10.5px] text-muted">
{b.seconds ? `${b.seconds.toFixed(1)} s` : b.rejected ? "skipped" : ""}
- {b.missing && <span className="text-[var(--color-dirty)]">no media</span>}
+ {b.missing && <span className="truncate text-[var(--color-dirty)]">no media</span>}
</span>
</button>
);
diff --git a/umtool/components/projects/workspace/Workspace.tsx b/umtool/components/projects/workspace/Workspace.tsx
@@ -208,6 +208,15 @@ export default function Workspace({ view: served, initialBlock = null, introWrit
},
[itemOf, engine, planRef],
);
+ // `?block=` (an address, a reload): the viewer goes to that block once the plan has it, once.
+ const placed = useRef(false);
+ useEffect(() => {
+ if (placed.current || !selected || selected === ADD) return;
+ const p = itemOf.get(selected);
+ if (!p) return;
+ placed.current = true;
+ engine.seekTo(startOf(planRef.current, p.i));
+ }, [itemOf, selected, engine, planRef]);
const step = useCallback(
(d: 1 | -1) => {
if (!blocks.length) return;
@@ -227,12 +236,16 @@ export default function Workspace({ view: served, initialBlock = null, introWrit
[write],
);
const moveSelected = useCallback(
- (d: 1 | -1) => {
+ async (d: 1 | -1) => {
const b = blocks.find((x) => x.id === selected);
- if (!b || b.at === null || undo.busy) return;
- void move(b.id, b.at, b.at + d);
+ if (!b || b.type === "intro" || undo.busy) return;
+ // Its place in the manifest's timeline, read now if the strip has not had it yet.
+ const ids = tl.current.ids.length ? tl.current.ids : (await loadTimeline()).ids;
+ const at = ids.indexOf(b.id);
+ if (at < 0) return;
+ await move(b.id, at, at + d);
},
- [blocks, selected, move, undo.busy],
+ [blocks, selected, move, undo.busy, loadTimeline],
);
// ---- edit in place (E): the clip bench over the workspace, Back returns here ----------
@@ -279,8 +292,8 @@ export default function Workspace({ view: served, initialBlock = null, introWrit
}
if (mod) return;
if (ev.altKey) {
- if (k === "ArrowLeft") moveSelected(-1);
- else if (k === "ArrowRight") moveSelected(1);
+ if (k === "ArrowLeft") void moveSelected(-1);
+ else if (k === "ArrowRight") void moveSelected(1);
else return;
ev.preventDefault();
return;
@@ -410,7 +423,11 @@ export default function Workspace({ view: served, initialBlock = null, introWrit
<span className="ml-auto flex flex-wrap items-center gap-x-2 text-[11.5px] text-muted">
{core.composeState === "composing" && <span>composing the chrome…</span>}
{core.composeState === "no-deck" && <span>{view.basic ? "basic: the footage alone" : "no on-screen deck"}</span>}
- {core.composeState === "error" && <span className="text-reject-text">the chrome did not compose: {core.composeError}</span>}
+ {core.composeState === "error" && (
+ <span className="max-w-[46ch] truncate text-reject-text" title={`the chrome did not compose: ${core.composeError}`} data-ws-compose-error="">
+ the chrome did not compose: {core.composeError}
+ </span>
+ )}
{ui.waiting && <span data-ws-waiting="">loading…</span>}
</span>
</div>
diff --git a/umtool/e2e/workspace.spec.ts b/umtool/e2e/workspace.spec.ts
@@ -102,6 +102,8 @@ test("a post block: the L6 post item panel and the post bench in the inspector",
await page.goto(urls.workspaceHref(P, { block: "p-5" }));
await expect(page.locator('[data-ws-block="p-5"]')).toHaveAttribute("aria-selected", "true");
await expect(page.locator("[data-ws-inspector]")).toHaveAttribute("data-ws-inspector", "post");
+ // The address's block is where the viewer is, too.
+ await expect(viewer(page)).toHaveAttribute("data-play-item", "p-5", { timeout: 20_000 });
await expect(page.locator('[data-ws-inspector] [data-inspector="post-item"]')).toBeVisible({ timeout: 20_000 });
await expect(page.locator('[data-ws-inspector] [data-post-bench-shape="inspector"]')).toBeVisible({ timeout: 20_000 });
await page.screenshot({ path: path.join(process.env.WS_SHOTS ?? path.join(DIR, ".."), "ws-post.png") }).catch(() => {});
@@ -115,8 +117,10 @@ test("a post block: the L6 post item panel and the post bench in the inspector",
test("two blocks reordered by keys: one move in the draft, the take untouched", async ({ page }) => {
const take = takeText();
await page.goto(urls.workspaceHref(P));
+ await expect(page.locator('[data-ws-block="c02"]')).toHaveAttribute("data-ws-block-at", "1");
await page.locator('[data-ws-block="c02"]').click();
await page.keyboard.press("Alt+ArrowRight");
+ await expect(page.locator("[data-ws-undo-said]")).toContainText("Moved c02");
await expect.poll(order, { timeout: 15_000 }).toBe("c01 p-5 c02 k01 c03 c04");
await expect.poll(() => blockIds(page)).toEqual(["c01", "p-5", "c02", "k01", "c03", "c04"]);
await expect(page.locator('[data-ws-block="c02"]')).toHaveAttribute("aria-selected", "true");