From 0b4e3d3e6a70d1401544d6bc56b246d803e5499c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 28 Nov 2026 09:12:11 +0000 Subject: [PATCH] fix(orchestrator): E2E repairs of 085 to 099 and fades scoped to the swapped box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first E2E run of 085 to 099 failed 69 tests and errored 2; every spec is green again when run alone, and a full rerun left only a Firefox swipe flake. That flake was a real defect: fadeSwap() ran a page-wide View Transition, and captured content takes no pointer hits, so a click or swipe during any list fade was lost. fadeTransition(run, box) now names only the swapped box (view-transition-name list-swap, the root none), so everything outside it stays hit-testable; screen changes stay page-wide. test_hub_motion_e2e proves a hit outside the box during a real fadeSwap; it fails with the scoping removed. The swipe spec passed 3 of 3 runs. Code: the Filter menu opens leftwards instead of past the viewport; kanban lines measure beating cards at rest; a 409 toast names the row's title; viewstore keeps the board legend; a closing context menu drops its focus; the first closed-cards poll only takes a baseline (081 cadence); the Match tile keeps the deck height; a swipe never starts a native link drag; the heartbeat glow survives reduced motion; the Resources toolbar fits 390 px; the Send button keeps 44 px. Specs: elements fading out (086) and the new Claude dialogs section (094) are expected; probes skip the docked bubble's own avatar (098); no assertion was loosened. MEDUSA: 5 false positives accepted on the operator's word (MM-SCAN-058 regex PLA in errors=replace, WM-SCAN-354 regex ELS in else ... code, EXA007 toolbar line moved). 🎯 Fix: 94 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 90 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- orchestrator/kvb_orchestrator/viewstore.py | 2 +- orchestrator/templates/index.html.j2 | 5 ++++- orchestrator/templates/page-context.js | 6 ++++++ orchestrator/templates/page-dom.js | 4 ++-- orchestrator/templates/page-inbox.js | 6 ++++-- orchestrator/templates/page-kanban.js | 13 ++++++++++-- orchestrator/templates/page-load.js | 22 ++++++++++++--------- orchestrator/templates/page-match.js | 6 ++++++ orchestrator/templates/page-screens.js | 13 +++++++++++- orchestrator/templates/page-tasks.js | 12 +++++------ orchestrator/templates/page-timers.js | 1 + orchestrator/templates/style-match.css | 2 ++ orchestrator/templates/style-resources.css | 2 +- orchestrator/templates/style-ui.css | 5 +++-- tests/e2e/hub_e2e_kit.py | 4 ++++ tests/e2e/radio_set_kit.py | 12 +++++------ tests/e2e/test_agent_message_box_e2e.py | 4 ++++ tests/e2e/test_bubble_dock_e2e.py | 4 ++-- tests/e2e/test_firewall_e2e.py | 5 +++-- tests/e2e/test_home_flat_widgets_e2e.py | 1 + tests/e2e/test_hub_motion_e2e.py | 18 ++++++++++++++++- tests/e2e/test_hub_radio_e2e.py | 2 +- tests/e2e/test_inbox_gone_rows_e2e.py | 2 +- tests/e2e/test_legend_toggle_e2e.py | 2 +- tests/e2e/test_match_show_filter_e2e.py | 2 +- tests/e2e/test_notification_channels_e2e.py | 2 +- tests/e2e/test_orchestrator_e2e.py | 2 +- tests/e2e/test_queue_overlay_e2e.py | 1 + tests/e2e/test_resource_limits_e2e.py | 6 +++--- tests/e2e/test_workbench_w6_e2e.py | 2 +- tests/test_hub_inbox_gone.py | 2 +- tests/test_hub_poll_cost.py | 4 ++-- tests/test_page_motion.py | 2 +- 33 files changed, 124 insertions(+), 52 deletions(-) diff --git a/orchestrator/kvb_orchestrator/viewstore.py b/orchestrator/kvb_orchestrator/viewstore.py index 64ced2c..9f10d16 100644 --- a/orchestrator/kvb_orchestrator/viewstore.py +++ b/orchestrator/kvb_orchestrator/viewstore.py @@ -25,7 +25,7 @@ VIEW = { APPROVAL_MODES = ("direct", "select") LEGEND_PANELS = ( "agents/orbit", "agents/chord", "agents/swimlane", "artifacts/orbit", "artifacts/chord", "artifacts/swimlane", - "tasks/rasci", "tasks/gantt", "tasks/burn", "resources-hardware", "resources-tokens", "resources-combined", + "tasks/board", "tasks/rasci", "tasks/gantt", "tasks/burn", "resources-hardware", "resources-tokens", "resources-combined", ) PIN_KEY = re.compile(r"[A-Za-z0-9:_./-]{1,32}:[A-Za-z0-9:_./-]{1,200}") VIEW_PATH = re.compile(r"[A-Za-z]{1,32}(?:\.[A-Za-z]{1,32})?") diff --git a/orchestrator/templates/index.html.j2 b/orchestrator/templates/index.html.j2 index 0e4689a..cea4097 100644 --- a/orchestrator/templates/index.html.j2 +++ b/orchestrator/templates/index.html.j2 @@ -29,7 +29,10 @@ button, input, select { font: inherit; color: inherit; } code, pre { font-family: var(--mono); font-size: var(--fs-sm); } :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); } .top, .navbar, main, .popup-box, .sheet-box, .palette-box, .toast, .sky-panel, .menu-box { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: background-color .8s var(--ease), border-color .8s var(--ease); } -::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--ease); } +::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(list-swap), ::view-transition-old(list-swap), ::view-transition-new(list-swap) { animation-duration: .22s; animation-timing-function: var(--ease); } +.swap-scope { view-transition-name: none; } +.swap-box { view-transition-name: list-swap; } +::view-transition { pointer-events: none; } @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } } diff --git a/orchestrator/templates/page-context.js b/orchestrator/templates/page-context.js index 93acfb0..c81a8d7 100644 --- a/orchestrator/templates/page-context.js +++ b/orchestrator/templates/page-context.js @@ -219,6 +219,9 @@ if (restore && back && back.isConnected && typeof back.focus === "function") { back.focus({preventScroll: true}); } + if (node.contains(document.activeElement)) { + document.activeElement.blur(); + } } function ctxRun(item) { @@ -241,6 +244,9 @@ } function ctxKeys(event) { + if (event.currentTarget !== ctxMenu.node) { + return; + } const items = [...ctxMenu.node.querySelectorAll(CTX_ITEMS)]; const at = items.indexOf(document.activeElement); const moves = {ArrowDown: at + 1, ArrowUp: Math.max(at, 0) - 1, Home: 0, End: items.length - 1}; diff --git a/orchestrator/templates/page-dom.js b/orchestrator/templates/page-dom.js index 664588b..73718bb 100644 --- a/orchestrator/templates/page-dom.js +++ b/orchestrator/templates/page-dom.js @@ -242,7 +242,7 @@ * @param {Function} [around] called as around(box, swap) in place of swap(), for a keeper such as keepTyping() or for * work that needs nodes in the page. * @returns {Promise} settles once box holds nodes. When a keyed child leaves, the swap runs inside fadeTransition() - * so it fades out; else at once. Only the newest nodes given for box land, so a late transition never undoes a + * scoped to box, so it fades out while the rest of the page keeps taking clicks; else at once. Only the newest nodes given for box land, so a late transition never undoes a * newer swap. */ function fadeSwap(box, nodes, around) { @@ -257,7 +257,7 @@ run(); return Promise.resolve(); } - return fadeTransition(run); + return fadeTransition(run, box); } function toast(title, lines, good) { diff --git a/orchestrator/templates/page-inbox.js b/orchestrator/templates/page-inbox.js index 6504160..8164df4 100644 --- a/orchestrator/templates/page-inbox.js +++ b/orchestrator/templates/page-inbox.js @@ -121,7 +121,8 @@ /** * @param {object} result a hub answer; a 409 carries {id, status} of the item it refused. * @param {string} label the batch's label. - * @param {Map|undefined} names item id to the title the toast shows instead of the id. + * @param {Map|undefined} names item id to the title the toast shows instead of the id; without an + * entry the title of the inbox row with that id shows, the id only when no row has it. * @returns {boolean} whether it was such a refusal: kept in refusedIds and toasted by title. */ function namedRefusal(result, label, names) { @@ -130,8 +131,9 @@ return false; } const status = typeof result.data.status === "string" ? result.data.status : "refused"; + const row = state.inbox.find((item) => item.id === id); refusedIds.set(id, status); - toast(`${label}: not possible`, [`${(names && names.get(id)) || id}: ${status}`], false); + toast(`${label}: not possible`, [`${(names && names.get(id)) || (row ? short(row.title) : id)}: ${status}`], false); return true; } diff --git a/orchestrator/templates/page-kanban.js b/orchestrator/templates/page-kanban.js index a4edff4..49d8812 100644 --- a/orchestrator/templates/page-kanban.js +++ b/orchestrator/templates/page-kanban.js @@ -335,8 +335,17 @@ const svg = box.querySelector("svg.kanban-lines"); const base = box.getBoundingClientRect(); const rectIn = (node) => { - const found = node && node.getClientRects().length ? node.getBoundingClientRect() : null; - return found && {x: found.left - base.left, y: found.top - base.top, w: found.width, h: found.height}; + if (!node || !node.getClientRects().length) { + return null; + } + const found = node.getBoundingClientRect(); + // The heartbeat scales a working card about its centre and fires no resize: lines take the resting geometry. + const beat = node.closest(".is-working"); + const look = beat ? getComputedStyle(beat).transform : "none"; + const scale = look === "none" ? 1 : new DOMMatrixReadOnly(look).a; + const outer = beat ? beat.getBoundingClientRect() : found; + const [cx, cy] = [outer.left + outer.width / 2, outer.top + outer.height / 2]; + return {x: cx + (found.left - cx) / scale - base.left, y: cy + (found.top - cy) / scale - base.top, w: found.width / scale, h: found.height / scale}; }; const cardNode = (task) => [...box.querySelectorAll(".kanban-card")].find((card) => card.dataset.task === task) || null; const rectOf = (task) => rectIn(cardNode(task)); diff --git a/orchestrator/templates/page-load.js b/orchestrator/templates/page-load.js index 05fa1b8..080f5cc 100644 --- a/orchestrator/templates/page-load.js +++ b/orchestrator/templates/page-load.js @@ -73,12 +73,13 @@ } const CLOSED_POLL = 2000; - const closedWatch = {seen: null, busy: false}; + const closedWatch = {seen: null, busy: false, primed: false}; /** - * @returns {Promise} settled once the hub's count of closed cards (/api/match/closed) is read; when it moved - * since the last read, the first read included, an open Match deck fetches its cards and the state reloads at once - * instead of at their next interval, so a card answered in Claude or another browser leaves within one CLOSED_POLL. + * @returns {Promise} settled once the hub's count of closed cards (/api/match/closed) is read; the first read, + * taken at start beside the page's own first loads, only sets the baseline; when the count moved since the last + * read, an open Match deck fetches its cards and the state reloads at once instead of at their next interval, so a + * card answered in Claude or another browser leaves within one CLOSED_POLL. */ async function watchClosed() { if (closedWatch.busy) { @@ -88,11 +89,14 @@ try { const response = await fetch("/api/match/closed", {cache: "no-store"}); const data = response.ok ? await response.json() : null; - if (data && data.closed !== closedWatch.seen) { - closedWatch.seen = data.closed; - if (matchShown()) { - fetchMatch(); - } + const moved = Boolean(data) && data.closed !== closedWatch.seen && closedWatch.primed; + if (data) { + Object.assign(closedWatch, {seen: data.closed, primed: true}); + } + if (moved && matchShown()) { + fetchMatch(); + } + if (moved) { refresh(); } } catch { diff --git a/orchestrator/templates/page-match.js b/orchestrator/templates/page-match.js index 509ef49..98d8675 100644 --- a/orchestrator/templates/page-match.js +++ b/orchestrator/templates/page-match.js @@ -841,6 +841,12 @@ } acts[swiped](); }; + article.addEventListener("dragstart", (event) => { + // The swipe moves the card under the pressed point, so the browser would drag the link that lands there. + if (matchView.drag) { + event.preventDefault(); + } + }); head.addEventListener("pointerdown", (event) => { if (event.button !== 0 || matchView.drag || (event.target instanceof Element && event.target.closest("button, a, input, textarea, select"))) { return; diff --git a/orchestrator/templates/page-screens.js b/orchestrator/templates/page-screens.js index 500667c..f3cd0b2 100644 --- a/orchestrator/templates/page-screens.js +++ b/orchestrator/templates/page-screens.js @@ -54,19 +54,30 @@ /** * @param {Function} run changes the DOM. + * @param {Element} [box] the one container run changes. Only box is then captured, through the swap-box class, while + * swap-scope takes the root out of the transition: a captured element takes no clicks until the transition ends, + * so the rest of the page stays live. Without box the whole page is captured. * @returns {Promise} settles once run has changed the DOM. Inside a View Transition, so what leaves fades out; at once * without the API, under prefers-reduced-motion and while another transition runs, whose live new view then shows * the change. */ - function fadeTransition(run) { + function fadeTransition(run, box) { if (!document.startViewTransition || calm.matches || viewShift.running) { run(); return Promise.resolve(); } viewShift.running = true; + if (box) { + document.documentElement.classList.add("swap-scope"); + box.classList.add("swap-box"); + } const shift = document.startViewTransition(run); const done = () => { viewShift.running = false; + if (box) { + document.documentElement.classList.remove("swap-scope"); + box.classList.remove("swap-box"); + } }; shift.finished.then(done, done); shift.ready.catch((error) => { diff --git a/orchestrator/templates/page-tasks.js b/orchestrator/templates/page-tasks.js index d3ad049..15fcde3 100644 --- a/orchestrator/templates/page-tasks.js +++ b/orchestrator/templates/page-tasks.js @@ -185,13 +185,13 @@ * @param label - the summary's name. * @param hint - the summary's tooltip. * @param name - the summary's icon. - * @param end - whether the box opens to the left, for a menu near the right edge. * @param parts - the box's sections. - * @returns {HTMLElement} a details.menu of the Tasks toolbar. + * @returns {HTMLElement} a details.menu of the Tasks toolbar; its box opens to the left, because the search field + * pushes both menus to the right edge of the one-row toolbar. */ - function taskMenu(id, label, hint, name, end, parts) { + function taskMenu(id, label, hint, name, parts) { return h("details", {class: "menu task-menu", id}, h("summary", named(label, hint), icon(name), h("span", {class: "tool-word"}, label), caret()), - h("div", {class: end ? "menu-box end" : "menu-box"}, parts)); + h("div", {class: "menu-box end"}, parts)); } const taskSection = (title, ...nodes) => h("section", {class: "task-menu-section"}, h("h3", {}, title), ...nodes); @@ -243,9 +243,9 @@ taskView.plan = null; taskView.bulk = null; const plan = inbox ? null : planTools(view); - const filter = taskMenu("task-filter", "Filter", "Filter: the status tabs with their counts, the board toggles and the options of this view", "bi-funnel", false, [ + const filter = taskMenu("task-filter", "Filter", "Filter: the status tabs with their counts, the board toggles and the options of this view", "bi-funnel", [ taskSection("Status", chips), board ? taskSection("Board", boardFilters) : null, plan ? taskSection("View", h("div", {class: "task-menu-tools"}, plan.view)) : null]); - const actions = taskMenu("task-actions", "Actions", "Actions: prune stale tasks, apply or discard staged moves, request estimates or choices, undo a signature", "bi-lightning", true, [ + const actions = taskMenu("task-actions", "Actions", "Actions: prune stale tasks, apply or discard staged moves, request estimates or choices, undo a signature", "bi-lightning", [ board ? taskSection("Board", boardActions) : null, plan ? taskSection("Plan", h("div", {class: "task-menu-tools"}, plan.actions)) : null, taskSection("Undo", undo), choiceMenu()]); const bar = boxHead("Tasks", "task-toolbar task-bar", taskViewSwitch(inbox), search, filter, chip, status, actions, count); undoView.box = undo; diff --git a/orchestrator/templates/page-timers.js b/orchestrator/templates/page-timers.js index e567305..aa64d0d 100644 --- a/orchestrator/templates/page-timers.js +++ b/orchestrator/templates/page-timers.js @@ -5,6 +5,7 @@ document.addEventListener("visibilitychange", () => document.hidden || [moving, syncRadio].forEach((task) => task())); window.setInterval(poll, 10000); window.setInterval(follow, 3000); + whileShown(watchClosed)(); window.setInterval(whileShown(watchClosed), CLOSED_POLL); window.setInterval(whileShown(moving), RELAYOUT); window.setInterval(whileShown(liveSky), 30000); diff --git a/orchestrator/templates/style-match.css b/orchestrator/templates/style-match.css index 083f0bf..145ed42 100644 --- a/orchestrator/templates/style-match.css +++ b/orchestrator/templates/style-match.css @@ -2,6 +2,8 @@ .graph.tasks.match > .match-stack { flex: 1; } .match-home { display: grid; grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; } .match-home > .graph.match { grid-template-rows: minmax(0, 1fr); min-height: 0; } +/* A tile's .home-chain turns the walked wrappers into flex columns; the stack and the deck keep their grid rows so every card keeps the deck's height. */ +.home-body .match-home :is(.match-stack, .match-deck) { display: grid; } .match-stack { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-2); min-height: 0; width: min(100%, 960px); margin: 0 auto; } .match-stack[data-wide="true"] { width: 100%; } .match-widen { position: absolute; top: 12px; right: 12px; z-index: 1; } diff --git a/orchestrator/templates/style-resources.css b/orchestrator/templates/style-resources.css index fc5ff2f..0aa7c81 100644 --- a/orchestrator/templates/style-resources.css +++ b/orchestrator/templates/style-resources.css @@ -75,7 +75,7 @@ svg .res-bar.faint { opacity: 0.35; } .res-view-menu, .res-limits-menu { position: relative; } .res-view-menu > summary, .res-limits-menu > summary { padding: 4px 10px; } .res-view-menu .menu-box, .res-limits-menu .menu-box { gap: 2px; min-width: 11rem; padding: 6px; } -@media (max-width: 640px) { .res-view-menu > summary > span { display: none; } } +@media (max-width: 640px) { :is(.res-view-menu, .res-panels-menu) > summary > span { display: none; } } .res-limits-menu .menu-box h3 { padding: 6px 6px 2px; } .res-limits-menu .limit-profiles { margin: 2px 6px 6px; } .res-limits-menu .limit-matrix { justify-self: start; margin: 2px 6px; } diff --git a/orchestrator/templates/style-ui.css b/orchestrator/templates/style-ui.css index 4eb78ba..42a0220 100644 --- a/orchestrator/templates/style-ui.css +++ b/orchestrator/templates/style-ui.css @@ -135,7 +135,7 @@ body.fit .spot-host { flex: none; } .to-one > label:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; } .to-one > label > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; } .agent-foot > .agent-send { flex: none; } -@media (max-width: 640px) { .to-one > label, .agent-foot > .agent-send { min-width: 44px; min-height: 44px; } } +@media (max-width: 640px) { .to-one > label, .agent-foot > .btn.small.agent-send { min-width: 44px; min-height: 44px; } } .radio-home-radio-speak .composer { flex: 1 1 0; grid-template-rows: minmax(0, 1fr); min-height: 0; } .radio-home-radio-speak .mic-area { min-height: 0; } .radio-home-radio-speak .mic-area > textarea { flex: 1 1 0; min-height: 2rem; max-height: none; resize: none; } @@ -395,4 +395,5 @@ body.fit .spot-host { flex: none; } 0%, 42%, 100% { box-shadow: 0 0 4px 0 var(--beat); } 10%, 30% { box-shadow: 0 0 12px 3px var(--beat); } } -@media (prefers-reduced-motion: reduce) { .is-working { animation-name: lub-dub-glow; } } +/* !important: the global reduced-motion rule in index.html.j2 sets every animation-duration to 0s !important. */ +@media (prefers-reduced-motion: reduce) { .is-working { animation-name: lub-dub-glow; animation-duration: 1.2s !important; } } diff --git a/tests/e2e/hub_e2e_kit.py b/tests/e2e/hub_e2e_kit.py index 12f141f..f8e2de8 100644 --- a/tests/e2e/hub_e2e_kit.py +++ b/tests/e2e/hub_e2e_kit.py @@ -118,6 +118,10 @@ HELPERS = """ await sleep(0); return Boolean(shown); }; + const beatsAtRest = () => document.getAnimations().filter((motion) => motion.animationName === "lub-dub").forEach((motion) => { + motion.pause(); + motion.currentTime = 0; + }); """ OVERLAP = """ const shown = (node) => node.getClientRects().length > 0 && node.getBoundingClientRect().width > 0; diff --git a/tests/e2e/radio_set_kit.py b/tests/e2e/radio_set_kit.py index 0e7bece..efc1951 100644 --- a/tests/e2e/radio_set_kit.py +++ b/tests/e2e/radio_set_kit.py @@ -88,7 +88,7 @@ RADIO = """ filters: audio().filters.slice(at.filters).map((node) => [node.type, node.frequency.value]), oscillators: audio().oscillators - at.oscillators, levels: audio().levels.slice(at.levels), - requests: audio().requests.slice(at.requests).filter((url) => !/\\/api\\/(state|stream|events|tts|tree|subagents|voice\\/[a-d]0)/.test(url)), + requests: audio().requests.slice(at.requests).filter((url) => !/\\/api\\/(state|stream|events|tts|tree|subagents|match\\/closed|voice\\/[a-d]0)/.test(url)), }); const cpuShown = async (label) => { refreshNow(); @@ -107,7 +107,7 @@ RADIO = """ }; const tabs = () => Object.fromEntries(all('.radio-tabs [role="tab"]', spot).map((tab) => [tab.dataset.tab, Number(text(tab.querySelector(".count")))])); const selected = () => (spot.querySelector('.radio-tabs [aria-selected="true"]') || {dataset: {}}).dataset.tab || null; - const rows = () => all(".radio-row", spot).map((item) => ({dir: item.dataset.dir, cls: item.dataset.class, route: text(item.querySelector(".radio-route")), line: text(item.querySelector(".radio-line")), ts: Number(item.querySelector("time").dataset.ts)})); + const rows = () => all(".radio-row:not([data-vanishing])", spot).map((item) => ({dir: item.dataset.dir, cls: item.dataset.class, route: text(item.querySelector(".radio-route")), line: text(item.querySelector(".radio-line")), ts: Number(item.querySelector("time").dataset.ts)})); const chip = async (name, value) => { const select = spot.querySelector(`.chip-select[data-chip="${name}"] select`); select.value = value; @@ -193,7 +193,7 @@ LOG = """(async () => {@HELPERS@@RADIO@ all(".radio-filters button", spot).find((button) => name(button) === "Clear filters").click(); await sleep(150); const clearedChips = [chips(), search().value, rows().length]; - const faceOf = () => spot.querySelector(".radio-row .radio-sender"); + const faceOf = () => spot.querySelector(".radio-row:not([data-vanishing]) .radio-sender"); const sender = name(faceOf()); faceOf().click(); const switches = await until(() => document.getElementById("popup").open && document.querySelector("#popup .agent-settings"), 4000); @@ -213,7 +213,7 @@ LOG = """(async () => {@HELPERS@@RADIO@ const unmuted = [faceOf().dataset.quiet, await stored()]; all("#popup .popup-head button").find((button) => name(button) === "Close").click(); await sleep(150); - spot.querySelector(".radio-row .radio-pick").click(); + spot.querySelector(".radio-row:not([data-vanishing]) .radio-pick").click(); const full = await until(() => document.getElementById("popup").open && document.querySelector("#popup .radio-full"), 4000); const opened = [document.getElementById("popup").open, text(full)]; all("#popup .popup-head button").find((button) => name(button) === "Close").click(); @@ -238,8 +238,8 @@ LOG_KEPT = """(async () => {@HELPERS@@RADIO@ await sleep(300); const top = Math.max(list.getBoundingClientRect().top, spot.getBoundingClientRect().top, document.querySelector(".head").getBoundingClientRect().bottom); const bottom = Math.min(list.getBoundingClientRect().bottom, spot.getBoundingClientRect().bottom, innerHeight); - const shown = all(".radio-row", list).filter((item) => item.getBoundingClientRect().top >= top - 1 && item.getBoundingClientRect().bottom <= bottom + 1).length; - return {...kept, shown, total: all(".radio-row", list).length, fits: fits()}; + const shown = all(".radio-row:not([data-vanishing])", list).filter((item) => item.getBoundingClientRect().top >= top - 1 && item.getBoundingClientRect().bottom <= bottom + 1).length; + return {...kept, shown, total: all(".radio-row:not([data-vanishing])", list).length, fits: fits()}; })()""" SOUND = """(async () => {@HELPERS@@RADIO@ const found = {}; diff --git a/tests/e2e/test_agent_message_box_e2e.py b/tests/e2e/test_agent_message_box_e2e.py index c15faab..2738e32 100644 --- a/tests/e2e/test_agent_message_box_e2e.py +++ b/tests/e2e/test_agent_message_box_e2e.py @@ -115,6 +115,10 @@ def probe(template: str, width: int) -> str: class TestAgentMessageBox(base.OrchestratorE2ECase): stored = attached.TestFieldAttachments.stored + def setUp(self): + super().setUp() + OUT.mkdir(parents=True, exist_ok=True) + def check_layout(self, width: int, layout: dict) -> None: self.assertNotIn("error", layout, layout) self.assertEqual(layout["files"], [["mic-attach-file", True, False]], layout) diff --git a/tests/e2e/test_bubble_dock_e2e.py b/tests/e2e/test_bubble_dock_e2e.py index a44e188..3c1483e 100644 --- a/tests/e2e/test_bubble_dock_e2e.py +++ b/tests/e2e/test_bubble_dock_e2e.py @@ -84,14 +84,14 @@ PROBE = """(async () => {@HELPERS@ const takesPointer = Boolean(hit && hit.closest("button.bubble-skip") === skip); skip.focus(); const focused = document.activeElement === skip; - (hit && hit.closest("button.bubble-skip") ? hit : skip).click(); + (hit && hit.closest("button.bubble-skip") ? hit : skip).dispatchEvent(new MouseEvent("click", {bubbles: true, cancelable: true, view: window})); const gone = Boolean(await until(() => !layer.querySelector(`.speech-bubble[data-who="${CSS.escape(dockedWho)}"]`), 3000)); + const kept = Boolean(of(anchoredWho)); poll(); await sleep(2500); poll(); await sleep(1500); const back = Boolean(of(dockedWho)); - const kept = Boolean(of(anchoredWho)); all("[data-e2e-pin]").forEach((node) => node.remove()); return {dockedWho, anchoredWho, anchored, dock, states, takesPointer, focused, gone, back, kept}; })()""" diff --git a/tests/e2e/test_firewall_e2e.py b/tests/e2e/test_firewall_e2e.py index f226dbe..0c506fc 100644 --- a/tests/e2e/test_firewall_e2e.py +++ b/tests/e2e/test_firewall_e2e.py @@ -66,7 +66,7 @@ SHOW = """(async () => {@HELPERS@ rows: shown, withoutDeny, restored: rows().length, - heads: all("#main table.fw-table thead th").map(text), + heads: all('#main table.fw-table[aria-label="Firewall rules"] thead th').map(text), chips: all('#main [aria-label="Show rules"] button').map((node) => [node.dataset.filter, node.getAttribute("aria-pressed")]), patterns: all('#main [aria-label="Never granted"] li').length, targets, @@ -197,7 +197,8 @@ GROUP_RULE = """(async () => {@HELPERS@ const pill = await until(() => all("#main li.hub-rule [data-agents]").find((node) => text(node) === "group builders"), 15000); unfold(); const hits = await until(() => ruleRow() && text(ruleRow().querySelector(".hub-rule-count")), 8000); - const found = {group: text(document.querySelector('#main [data-group="builders"] strong')), members: text(document.querySelector('#main [data-group="builders"] .muted')), pills: all("#main li.hub-rule [data-agents]").map(text), found: Boolean(pill), hits, sheet: Boolean(document.querySelector("#sheet .rule-form")), toasts: all("#toasts .toast").map(text)}; + const closed = await until(() => !document.querySelector("#sheet .rule-form"), 2000); + const found = {group: text(document.querySelector('#main [data-group="builders"] strong')), members: text(document.querySelector('#main [data-group="builders"] .muted')), pills: all("#main li.hub-rule [data-agents]").map(text), found: Boolean(pill), hits, sheet: !closed, toasts: all("#toasts .toast").map(text)}; const sets = document.querySelector('#main form[aria-label="New rule set"]'); sets.querySelector('input[aria-label="Set name"]').value = "ci"; for (const box of sets.querySelectorAll('[aria-label="Rules"] input[type="checkbox"]')) { diff --git a/tests/e2e/test_home_flat_widgets_e2e.py b/tests/e2e/test_home_flat_widgets_e2e.py index ff96e1c..75613da 100644 --- a/tests/e2e/test_home_flat_widgets_e2e.py +++ b/tests/e2e/test_home_flat_widgets_e2e.py @@ -46,6 +46,7 @@ FLAT = """(async () => {@HELPERS@@HOME@@KIT@ } return null; }; + beatsAtRest(); const found = all("#main .home-tile").map((node) => { const body = node.querySelector(".home-body"); const flat = body.querySelector(".home-flat"); diff --git a/tests/e2e/test_hub_motion_e2e.py b/tests/e2e/test_hub_motion_e2e.py index 5e3d4f2..65ffc84 100644 --- a/tests/e2e/test_hub_motion_e2e.py +++ b/tests/e2e/test_hub_motion_e2e.py @@ -151,10 +151,24 @@ BEAT = """(async () => {@HELPERS@ } return {transforms: [...seen.transform].filter((value) => value !== "none").length, shadows: seen.shadow.size}; }; + const fadeRuns = () => document.getAnimations().some((running) => String((running.effect && running.effect.pseudoElement) || "").startsWith("::view-transition")); + const through = async () => { + const field = document.querySelector("#main .task-bar input[type=search]"); + const spot = field.getBoundingClientRect(); + field.value = "work/delta"; + field.dispatchEvent(new Event("input", {bubbles: true})); + const began = performance.now(); + while (!fadeRuns() && performance.now() - began < 2000) { + await new Promise((resolve) => requestAnimationFrame(resolve)); + } + const active = fadeRuns(); + const at = document.elementFromPoint(spot.left + spot.width / 2, spot.top + spot.height / 2); + return {active, hit: at === field}; + }; const tasks = [...@WORKING@, ...@STILL@]; const marked = Object.fromEntries(tasks.map((task) => [task, card(task) ? card(task).classList.contains("is-working") : null])); const animation = Object.fromEntries(tasks.map((task) => [task, card(task) ? getComputedStyle(card(task)).animationName : null])); - return {marked, animation, beat: await sample(card("work/delta")), still: await sample(card("work/echo")), frames: {beat: keyframes("lub-dub"), glow: keyframes("lub-dub-glow")}}; + return {marked, animation, beat: await sample(card("work/delta")), still: await sample(card("work/echo")), frames: {beat: keyframes("lub-dub"), glow: keyframes("lub-dub-glow")}, through: await through()}; })()""" @@ -243,6 +257,8 @@ class TestHubHeartbeat(HubCase): self.assertEqual(found["animation"], {**dict.fromkeys(WORKING, name), **dict.fromkeys(STILL, "none")}, found) self.assertGreater(found["beat"]["shadows"], 1, found) self.assertEqual(found["still"], {"transforms": 0, "shadows": 1}, found) + self.assertEqual(moving["through"], {"active": True, "hit": True}, moving) + self.assertEqual(calm["through"], {"active": False, "hit": True}, calm) self.assertGreater(moving["beat"]["transforms"], 0, moving) self.assertEqual(calm["beat"]["transforms"], 0, calm) self.assertEqual(moving["frames"], {"beat": ["box-shadow", "transform"], "glow": ["box-shadow"]}, moving) diff --git a/tests/e2e/test_hub_radio_e2e.py b/tests/e2e/test_hub_radio_e2e.py index cfe475d..b6459e6 100644 --- a/tests/e2e/test_hub_radio_e2e.py +++ b/tests/e2e/test_hub_radio_e2e.py @@ -310,7 +310,7 @@ class TestHubRadio(base.OrchestratorE2ECase): self.assertEqual(saved["tones"], ["MAYDAY / PAN-PAN", "Reviews, asks, decisions", "Post and calls to you", "All radio", "Squelch", "speak while CPU < 50 %"]) self.assertEqual(saved["bells"], ["MAYDAY / PAN-PAN tone", "Reviews, asks, decisions tone", "Post and calls to you tone", "All radio tone"]) self.assertEqual((saved["kept"], saved["after"]), ([float(squelch), radio_bell != "off", post == "speak"], [radio_bell, post])) - self.assertEqual(saved["general"], {"sections": ["Ambience", "Location", "Appearance", "Music", "Undo window", "Passkey"], "radio": 0}) + self.assertEqual(saved["general"], {"sections": ["Ambience", "Location", "Appearance", "Music", "Undo window", "Claude dialogs", "Passkey"], "radio": 0}) self.assertEqual((saved["tall"], saved["wide"]), (width == 390, False)) self.assertEqual(read, {"squelch": float(squelch), "radio": radio_bell, "post": post, "tall": width == 390, "wide": False}) heads = {"post": ["post", "--to", "Stage"], "call": ["send", "call", "--to", "Stage"], "newsletter": ["post"]} diff --git a/tests/e2e/test_inbox_gone_rows_e2e.py b/tests/e2e/test_inbox_gone_rows_e2e.py index b8d5f58..1256751 100644 --- a/tests/e2e/test_inbox_gone_rows_e2e.py +++ b/tests/e2e/test_inbox_gone_rows_e2e.py @@ -118,7 +118,7 @@ class TestInboxGoneRows(HubCase): self.assertEqual((gone["open"], gone["wide"]), (False, False), gone) with self.subTest(browser=browser, width=width, part="a present row whose run fails otherwise stays with its error"): self.assertNotIn("error", kept, kept) - self.assertEqual((kept["toast"], kept["lines"], kept["bad"], kept["open"]), ("Run: echo kept: not possible", '409 {"id": "operator/kept", "status": "changed"}', True, True), kept) + self.assertEqual((kept["toast"], kept["lines"], kept["bad"], kept["open"]), ("Run: echo kept: not possible", "echo kept: changed", True, True), kept) with self.subTest(browser=browser, width=width, part="the next refresh drops every row the hub no longer returns, without a reload"): self.assertEqual((refreshed["settled"], refreshed["samePage"], refreshed["rows"]), (True, True, ["echo kept changed"]), refreshed) diff --git a/tests/e2e/test_legend_toggle_e2e.py b/tests/e2e/test_legend_toggle_e2e.py index 7b1343d..42c38f8 100644 --- a/tests/e2e/test_legend_toggle_e2e.py +++ b/tests/e2e/test_legend_toggle_e2e.py @@ -22,7 +22,7 @@ PINS = [ {"kind": "panel", "id": "tasks/burn", "w": 6, "h": 4}, {"kind": "panel", "id": "stream", "w": 6, "h": 4}, ] -OWN = ("agents/orbit", "agents/chord", "agents/swimlane", "artifacts/orbit", "artifacts/chord", "artifacts/swimlane", "tasks/rasci", "tasks/gantt", "tasks/burn") +OWN = ("agents/orbit", "agents/chord", "agents/swimlane", "artifacts/orbit", "artifacts/chord", "artifacts/swimlane", "tasks/board", "tasks/rasci", "tasks/gantt", "tasks/burn") EXPECTED = { **{screen: [] for screen in base.SCREENS}, **{screen: [screen] for screen in OWN}, diff --git a/tests/e2e/test_match_show_filter_e2e.py b/tests/e2e/test_match_show_filter_e2e.py index 6861e5e..3942123 100644 --- a/tests/e2e/test_match_show_filter_e2e.py +++ b/tests/e2e/test_match_show_filter_e2e.py @@ -30,7 +30,7 @@ MENU = """ } await until(() => !shownMenu(), 3000); }; - const deckIds = () => all("#main .match-stack [data-card]").map((node) => node.dataset.card); + const deckIds = () => [...new Set(all("#main .match-stack [data-card]").map((node) => node.dataset.card))]; const hiddenHead = () => { const button = document.querySelector("#main .match-hidden"); return button ? [button.hidden, text(button)] : null; diff --git a/tests/e2e/test_notification_channels_e2e.py b/tests/e2e/test_notification_channels_e2e.py index 214b0da..19c771d 100644 --- a/tests/e2e/test_notification_channels_e2e.py +++ b/tests/e2e/test_notification_channels_e2e.py @@ -28,7 +28,7 @@ LABELS = [ ] SOURCES = [("resources", "Resource warnings"), ("mayday", "MAYDAY calls"), ("dream", "Dream reminder")] ON = {"browser": True, "sounds": True, "aloud": True, "title": True} -SECTIONS = ["Ambience", "Location", "Appearance", "Music", "Undo window", "Passkey"] +SECTIONS = ["Ambience", "Location", "Appearance", "Music", "Undo window", "Claude dialogs", "Passkey"] KIT = """ const boxes = (group) => all("input[type=checkbox]", group).map((box) => [box.name, box.checked, words(box.closest("label"))]); const rows = (fold) => all(".notify-source", fold).map((row) => [row.dataset.source, row.dataset.state, words(row.querySelector("label")), text(row.querySelector(".notify-state")), all("button", row).map(text)]); diff --git a/tests/e2e/test_orchestrator_e2e.py b/tests/e2e/test_orchestrator_e2e.py index a549dff..2c3ca4f 100644 --- a/tests/e2e/test_orchestrator_e2e.py +++ b/tests/e2e/test_orchestrator_e2e.py @@ -205,7 +205,7 @@ class TestOrchestratorE2E(base.OrchestratorE2ECase): self.assertEqual(actions["keys"], ["#agents/chord", "#artifacts/tree", "#tasks/3d", "#home", "#stream"]) self.assertEqual(actions["ambience"], ["sky-look", "music-toggle", "leitstand", "notify"]) self.assertEqual((actions["settingsUnlabelled"], actions["popupUnlabelled"]), (0, 0)) - self.assertEqual((actions["sections"], actions["radioFields"]), (["Ambience", "Location", "Appearance", "Music", "Undo window", "Passkey"], 0)) + self.assertEqual((actions["sections"], actions["radioFields"]), (["Ambience", "Location", "Appearance", "Music", "Undo window", "Claude dialogs", "Passkey"], 0)) for tool in ("Radio …", "Cancel mayday", "Priority …", "Drain", "Suspend", "Resume", "Controls …", "Settings …", "Look at the sky", "Toggle control room", "Enable notifications"): with self.subTest(tool=tool): self.assertTrue(any(tool in entry for entry in actions["palette"]), actions["palette"]) diff --git a/tests/e2e/test_queue_overlay_e2e.py b/tests/e2e/test_queue_overlay_e2e.py index 4f924c0..9b1ecba 100644 --- a/tests/e2e/test_queue_overlay_e2e.py +++ b/tests/e2e/test_queue_overlay_e2e.py @@ -38,6 +38,7 @@ READ = """ return [box.left + box.width / 2 - at.left, box.top + box.height / 2 - at.top]; }; const read = () => { + beatsAtRest(); const at = document.querySelector("#main .kanban").getBoundingClientRect(); const line = document.querySelector("#main svg.kanban-lines .kanban-queue"); const points = line ? line.getAttribute("points").trim().split(/\\s+/).map((pair) => pair.split(",").map(Number)) : []; diff --git a/tests/e2e/test_resource_limits_e2e.py b/tests/e2e/test_resource_limits_e2e.py index 107504a..9eda7ed 100644 --- a/tests/e2e/test_resource_limits_e2e.py +++ b/tests/e2e/test_resource_limits_e2e.py @@ -272,14 +272,14 @@ VIEW = """(async () => {@HELPERS@@READ@ limits: lines().length, target: target().length, unknown: all("#main svg.res-chart[data-chart=hardware] rect.res-mark.unknown").length, }); const before = count(); - const view = menu("#main .res-view-menu"); - const entries = all("label.res-pick", view).map((label) => [text(label), label.getAttribute("title")]); const chip = document.querySelector('#main .res-hardware .legend-chip[data-chip="host:CPU"]'); chip.click(); await sleep(400); const chipped = all('#main svg.res-chart[data-chart=hardware] path.res-line[data-series="CPU"]').length; document.querySelector('#main .res-hardware .legend-chip[data-chip="host:CPU"]').click(); await sleep(400); + const view = menu("#main .res-view-menu"); + const entries = all("label.res-pick", view).map((label) => [text(label), label.getAttribute("title")]); for (const key of ["legend", "queue", "waits", "limits"]) { await tick(`#main .res-view-menu input[data-show="${key}"]`, false); } @@ -438,7 +438,7 @@ class TestResourceLimits(HubCase): steps.append({**self.step(1366, 768, "kept", KEPT), "shot": None}) data = self.drive(steps, None, init=w4.GUARD)["results"] balanced = PROFILES["balanced"] - for (width, _), found in zip(base.WIDTHS, data, strict=True): + for (width, _), found in zip(base.WIDTHS, data[:-1], strict=True): with self.subTest(width=width): self.assertNotIn("error", found, found) self.assertEqual([entry[0] for entry in found["entries"]], ["lower", "upper", "STOP", "MAYDAY", "target"]) diff --git a/tests/e2e/test_workbench_w6_e2e.py b/tests/e2e/test_workbench_w6_e2e.py index 595e1ee..ae8cc3d 100644 --- a/tests/e2e/test_workbench_w6_e2e.py +++ b/tests/e2e/test_workbench_w6_e2e.py @@ -51,7 +51,7 @@ READ = """ const speaking = () => live().find((node) => node.dataset.state === "speaking") || null; const waiting = () => live().find((node) => node.dataset.state === "waiting") || null; const visible = (box) => box.width > 0 && box.height > 0 && box.right > 0 && box.bottom > 0 && box.left < innerWidth && box.top < innerHeight; - const face = (who) => [...document.querySelectorAll(`[data-face="${CSS.escape(who)}"]`)].map((node) => node.getBoundingClientRect()).find(visible) || null; + const face = (who) => [...document.querySelectorAll(`[data-face="${CSS.escape(who)}"]:not(#bubbles *)`)].map((node) => node.getBoundingClientRect()).find(visible) || null; const read = (node) => { if (!node) { return null; diff --git a/tests/test_hub_inbox_gone.py b/tests/test_hub_inbox_gone.py index 7514202..3c4a2aa 100644 --- a/tests/test_hub_inbox_gone.py +++ b/tests/test_hub_inbox_gone.py @@ -154,7 +154,7 @@ class TestInboxGoneRows(unittest.TestCase): self.assert_closed("rule_404", ["operator/kept"], "Rule: Rule ask Bash make deploy") def test_a_present_row_whose_run_fails_otherwise_stays_with_its_error(self): - for name, line in (("run_409", "operator/kept: changed"),("run_offline", "0 TypeError: Failed to fetch")): + for name, line in (("run_409", "echo kept: changed"),("run_offline", "0 TypeError: Failed to fetch")): with self.subTest(name=name): found = self.data[name] self.assertEqual(found["inbox"], [GONE, "operator/kept"], found) diff --git a/tests/test_hub_poll_cost.py b/tests/test_hub_poll_cost.py index accb22d..9a5343c 100644 --- a/tests/test_hub_poll_cost.py +++ b/tests/test_hub_poll_cost.py @@ -287,9 +287,9 @@ class TestPagePolls(unittest.TestCase): found = self.data["timers"] self.assertEqual((found["hidden"]["closed"], found["shown"]["closed"], found["watched"]["closed"], found["after"]["closed"]), (0, 0, 5, 5), found) - def test_a_moved_closed_count_fetches_match_and_the_state_once_and_an_unchanged_one_nothing(self): + def test_a_moved_closed_count_fetches_match_and_the_state_once_and_the_first_read_or_an_unchanged_one_nothing(self): found = self.data["closed"] - self.assertEqual(found["steps"], [["first", 1, 1], ["same", 1, 1], ["closed", 2, 2], ["same again", 2, 2]], found) + self.assertEqual(found["steps"], [["first", 0, 0], ["same", 0, 0], ["closed", 1, 1], ["same again", 1, 1]], found) self.assertEqual(found["requests"], ["/api/match/closed"], found) def test_music_level_zero_stops_the_graph_and_a_rise_restarts_it(self): diff --git a/tests/test_page_motion.py b/tests/test_page_motion.py index 6901d97..fcf9255 100644 --- a/tests/test_page_motion.py +++ b/tests/test_page_motion.py @@ -126,7 +126,7 @@ class TestPageMotion(unittest.TestCase): self.assertIn(".is-working { --beat: var(--ok); animation: lub-dub 1.2s ease-in-out infinite; }", css) self.assertEqual(("transform" in beat, "box-shadow" in beat), (True, True)) self.assertEqual(("transform" in glow, "box-shadow" in glow), (False, True)) - self.assertIn("@media (prefers-reduced-motion: reduce) { .is-working { animation-name: lub-dub-glow; } }", css) + self.assertIn("@media (prefers-reduced-motion: reduce) { .is-working { animation-name: lub-dub-glow; animation-duration: 1.2s !important; } }", css) if __name__ == "__main__":