commit 2aaa03c35202fc6a5fad51015fe00044a3ca1187
parent 0982eeb0cc28f523c2f8646a29c4bedee59458e3
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 06:18:16 -0400
umtool: the Next card's streamed twin — n runs the visible action, the fallback is data-next-pending; onscreen.spec reads the teaser's timeline row on the Cut
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
5 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/umtool/components/piece/NextCard.tsx b/umtool/components/piece/NextCard.tsx
@@ -13,9 +13,9 @@ import type { LifecycleState } from "@/lib/lifecycle";
// Async: the Inbox is read whole (lib/inbox) and then narrowed, so the page
// streams this in under a <Suspense> rather than waiting on it.
-export function NextCardShell({ children }: { children: React.ReactNode }) {
+export function NextCardShell({ pending = false, children }: { pending?: boolean; children: React.ReactNode }) {
return (
- <Card lit data-next="" className="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-[18px] gap-y-1 px-4 py-3.5">
+ <Card lit data-next={pending ? undefined : ""} data-next-pending={pending ? "" : undefined} className="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-[18px] gap-y-1 px-4 py-3.5">
<span className="micro col-span-full">Next</span>
{children}
</Card>
diff --git a/umtool/components/piece/PieceKeys.tsx b/umtool/components/piece/PieceKeys.tsx
@@ -35,7 +35,10 @@ export default function PieceKeys({ tabs }: { tabs: string[] }) {
return;
}
if (e.key === "n") {
- const act = document.querySelector<HTMLElement>("[data-next-action] > a, [data-next-action] > button");
+ // The visible one: while React streams the card in, a copy waits in a hidden <div>.
+ const act = [...document.querySelectorAll<HTMLElement>("[data-next-action] > a, [data-next-action] > button")].find(
+ (el) => !el.closest("[hidden]"),
+ );
if (!act || (act instanceof HTMLButtonElement && act.disabled)) return;
e.preventDefault();
act.click();
diff --git a/umtool/components/projects/report/OverviewTab.tsx b/umtool/components/projects/report/OverviewTab.tsx
@@ -40,7 +40,7 @@ export default async function OverviewTab({ project, detail, frame }: ReportTabP
<>
<Suspense
fallback={
- <NextCardShell>
+ <NextCardShell pending>
<span className="text-[12.5px] text-muted">Reading the Inbox…</span>
</NextCardShell>
}
@@ -77,7 +77,7 @@ export default async function OverviewTab({ project, detail, frame }: ReportTabP
</section>
)}
{decisions.length === 0 && (
- <p data-project={project.id} className="text-[12.5px] text-muted">
+ <p data-project-empty="" className="text-[12.5px] text-muted">
No decisions on this project.
</p>
)}
diff --git a/umtool/e2e/onscreen.spec.ts b/umtool/e2e/onscreen.spec.ts
@@ -273,7 +273,6 @@ test("the preview is the composition: it reports ready, and typing reaches it be
const teaserTitle = "Next Season — The Big Build in the Valley — Spring 2027 ?";
await expect(frame.locator('[data-seg="t01"]')).toHaveCount(1);
expect(await row(page, "t01").getByTestId("onscreen-title").getAttribute("placeholder")).toBe(teaserTitle);
- await expect(page.locator('li[data-entry="t01"][data-kind="teaser"]')).toContainText(teaserTitle);
// Typing is patched into the frame by postMessage: nothing is saved.
await fillSure(row(page, "c02").getByTestId("onscreen-title"), "Typed, not saved");
@@ -290,6 +289,10 @@ test("the preview is the composition: it reports ready, and typing reaches it be
await request.post("/api/report/chrome/preview", { data: { project: PROJECT } })
).json()) as { schedule: { total: number } };
expect(max).toBeCloseTo(pv.schedule.total, 3);
+
+ // The same teaser on the report page's timeline (the piece page's Cut tab).
+ await page.goto(urls.section(PROJECT, "timeline"));
+ await expect(page.locator('li[data-entry="t01"][data-kind="teaser"]')).toContainText(teaserTitle);
});
test("a true still is the render browser's PNG of the deck region", async ({ page, request }) => {
diff --git a/umtool/e2e/piece.spec.ts b/umtool/e2e/piece.spec.ts
@@ -41,7 +41,7 @@ test("the frame: title, trail, stepper at Video, the Next card, seven tabs with
// The Overview: the Next card, the project's decisions, its stats -- and none
// of the other tabs' sections.
- await expect(page.locator("[data-next]")).toBeVisible();
+ await expect(page.locator("[data-next]:visible")).toBeVisible();
await expect(page.locator(`[data-project="${PROJECT}"]`)).toBeVisible();
await expect(page.locator("[data-piece-stats]")).toContainText("4 clips");
await expect(page.locator("[data-entry][data-kind]")).toHaveCount(0);
@@ -57,9 +57,9 @@ test("the Next card is the piece's top Inbox call, and its one action goes where
expect(top, "the fixture's report has a call waiting").toBeTruthy();
await page.goto(urls.projectHref(PROJECT));
- const next = page.locator("[data-next]");
+ const next = page.locator("[data-next]:visible");
await expect(next.locator("[data-next-kind]")).toHaveAttribute("data-next-kind", top!.kind);
- const action = next.locator("[data-next-action] > a");
+ const action = next.locator("[data-next-action] > a:visible");
await expect(action).toHaveText(top!.action.label);
await expect(action).toHaveAttribute("href", top!.action.href);
await action.click();
@@ -120,7 +120,7 @@ test("the lifecycle chip: Park, then Reactivate, each a round trip through the s
expect(await life()).toBe("parked");
// Parked, the piece's calls are hidden: the Next card offers the way back.
await expect(page.locator("[data-next-kind=lifecycle]")).toContainText("Parked");
- await expect(page.locator("[data-next-action] > button")).toHaveText("Reactivate");
+ await expect(page.locator("[data-next-action] > button:visible")).toHaveText("Reactivate");
const chip2 = page.locator("[data-lifecycle-chip]");
await chip2.getByRole("button", { name: "Lifecycle: Parked" }).click();
@@ -153,7 +153,7 @@ test("keys: 1–7 open the tabs, n runs the Next card's action; typing in a fiel
await expect(tab(page, "overview")).toHaveAttribute("aria-current", "page");
await keysReady(page);
- const href = await page.locator("[data-next-action] > a").getAttribute("href");
+ const href = await page.locator("[data-next-action] > a:visible").getAttribute("href");
await page.keyboard.press("n");
await expect(page).toHaveURL(new RegExp(`${href!.replace(/[?]/g, "\\?")}$`));
});
@@ -171,7 +171,7 @@ test("an article's video: the stepper and the lifecycle are the article's, and t
test("fits 1366×768: the head, the tabs and the Next card's action without a horizontal scroll", async ({ page }) => {
await page.setViewportSize({ width: 1366, height: 768 });
await page.goto(urls.projectHref(PROJECT));
- await expect(page.locator("[data-next-action] > a")).toBeInViewport();
+ await expect(page.locator("[data-next-action] > a:visible")).toBeInViewport();
await expect(tab(page, "history")).toBeInViewport();
const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
expect(overflow).toBeLessThanOrEqual(0);