commit 863bcf24e7611530f546a5c438871e041647b7bc
parent 76d39c06ebd833ccee1ddec4d19225b2c896dd38
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 03:01:19 -0400
umtool: the palette says when it listens; e2e waits for it and polls the lit fill
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/umtool/components/shell/JumpPalette.tsx b/umtool/components/shell/JumpPalette.tsx
@@ -70,6 +70,8 @@ export default function JumpPalette() {
const [at, setAt] = useState(0);
const [pieces, setPieces] = useState<PieceRow[] | null>(null);
const [error, setError] = useState<string | null>(null);
+ // Set once the chord is listened for, so a test (or a script) can wait for it.
+ const [ready, setReady] = useState(false);
const show = useCallback(() => {
setQ("");
@@ -90,6 +92,7 @@ export default function JumpPalette() {
const onJump = () => show();
document.addEventListener("keydown", onKey);
window.addEventListener(JUMP_EVENT, onJump);
+ setReady(true);
return () => {
document.removeEventListener("keydown", onKey);
window.removeEventListener(JUMP_EVENT, onJump);
@@ -163,6 +166,7 @@ export default function JumpPalette() {
<dialog
ref={dialog}
data-jump=""
+ data-ready={ready ? "" : undefined}
aria-label="Jump to"
onClose={() => setOpen(false)}
className="ui-dialog mx-auto mb-auto mt-[12vh] w-[min(640px,calc(100vw-32px))] rounded-[3px] border border-seam-2 bg-panel p-0 text-text shadow-2xl"
diff --git a/umtool/e2e/inbox.spec.ts b/umtool/e2e/inbox.spec.ts
@@ -75,13 +75,14 @@ test("j lights the next card, and only the lit card's action wears Signal", asyn
probe.remove();
return c;
});
- expect(await bg(0)).toBe(signal);
+ // Polled: the fill eases in (the button's colour transition).
+ await expect.poll(() => bg(0)).toBe(signal);
expect(await bg(1)).not.toBe(signal);
await page.locator("body").press("j");
await expect(lines.nth(1)).toHaveAttribute("data-lit", "");
await expect(lines.nth(1)).toBeFocused();
- expect(await bg(1)).toBe(signal);
- expect(await bg(0)).not.toBe(signal);
+ await expect.poll(() => bg(1)).toBe(signal);
+ await expect.poll(() => bg(0)).not.toBe(signal);
});
test("Park hides a piece's calls, Undo brings them back; Show hidden lists them with Reactivate", async ({ page, request }) => {
diff --git a/umtool/e2e/shell.spec.ts b/umtool/e2e/shell.spec.ts
@@ -63,10 +63,13 @@ test("a song pile lights Tools and the song group, and its menu opens in the rai
// ── ⌘K ─────────────────────────────────────────────────────────────────────
const palette = (page: Page) => page.locator("dialog[data-jump]");
+/** The chord is listened for once the palette has mounted. */
+const ready = (page: Page) => expect(page.locator("dialog[data-jump][data-ready]")).toBeAttached();
test("⌘K opens the palette on a bench too; typing narrows it, Enter goes", async ({ page }) => {
await page.goto(urls.clipBenchHref("reports/report-fixture", "c01"));
await expect(rail(page)).toHaveCount(0);
+ await ready(page);
await page.keyboard.press("Control+k");
await expect(palette(page)).toBeVisible();
await expect(palette(page).locator("[data-jump-input]")).toBeFocused();
@@ -80,6 +83,7 @@ test("⌘K opens the palette on a bench too; typing narrows it, Enter goes", asy
test("the palette jumps to a piece, moves with the arrows, closes on Escape, and fits 1366×768", async ({ page }) => {
await page.setViewportSize({ width: 1366, height: 768 });
await page.goto(urls.homeHref());
+ await ready(page);
await rail(page).locator("[data-rail-section=jump]").click();
await expect(palette(page)).toBeVisible();
const box = await palette(page).boundingBox();
@@ -104,6 +108,7 @@ test("the palette jumps to a piece, moves with the arrows, closes on Escape, and
test("a create action from the palette", async ({ page }) => {
await page.goto(urls.workHref());
+ await ready(page);
await page.keyboard.press("Control+k");
await page.keyboard.type("new project");
await expect(palette(page).locator("[role=option][aria-selected=true]")).toHaveAttribute("data-jump-item", "new-project");
diff --git a/umtool/e2e/work.spec.ts b/umtool/e2e/work.spec.ts
@@ -56,6 +56,7 @@ test("the facets filter, compose, and count what they would show", async ({ page
// The search, under the facets it was typed with; `/` puts the cursor there.
await page.goto(urls.workHref());
+ await expect(page.locator("[data-lit-list]").first()).toHaveAttribute("data-hydrated", "");
await page.locator("body").press("/");
await expect(page.locator("[data-work-search]")).toBeFocused();
await page.keyboard.type("report-fixture");
@@ -68,7 +69,7 @@ test("the old lists' keys land on the same set", async ({ page }) => {
// /browse?kind=<a project kind> → Work, and the kind is a facet chip.
await page.goto("/browse?kind=report-video");
await expect(page).toHaveURL(/\/work\?kind=report-video$/);
- await expect(page.locator("[data-facet=kind] [aria-current=true]")).toHaveText(/^report video \d+$/);
+ await expect(page.locator("[data-facet=kind] [aria-current=true]")).toHaveText(/^report video\s*\d+$/);
await expect(page.locator(`${rows}[data-piece='${REPORT}']`)).toBeVisible();
// ...and /browse's state, a key with no chip group, is a chip you can take off.
await page.goto("/browse?state=draft");