fix(orchestrator): E2E repairs of 085 to 099 and fades scoped to the swapped box

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 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-BirkenbachandClaude Opus 5.5 committed 2026-11-28 09:12:11 +00:00
1 parent 38788b54a5
commit 0b4e3d3e6a
33 files changed
+124 -52

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ VIEW = {
APPROVAL_MODES = ("direct", "select") APPROVAL_MODES = ("direct", "select")
LEGEND_PANELS = ( LEGEND_PANELS = (
"agents/orbit", "agents/chord", "agents/swimlane", "artifacts/orbit", "artifacts/chord", "artifacts/swimlane", "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}") 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})?") VIEW_PATH = re.compile(r"[A-Za-z]{1,32}(?:\.[A-Za-z]{1,32})?")
+4 -1
View File
@@ -29,7 +29,10 @@ button, input, select { font: inherit; color: inherit; }
code, pre { font-family: var(--mono); font-size: var(--fs-sm); } 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); } :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); } .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) { @media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
} }
+6
View File
@@ -219,6 +219,9 @@
if (restore && back && back.isConnected && typeof back.focus === "function") { if (restore && back && back.isConnected && typeof back.focus === "function") {
back.focus({preventScroll: true}); back.focus({preventScroll: true});
} }
if (node.contains(document.activeElement)) {
document.activeElement.blur();
}
} }
function ctxRun(item) { function ctxRun(item) {
@@ -241,6 +244,9 @@
} }
function ctxKeys(event) { function ctxKeys(event) {
if (event.currentTarget !== ctxMenu.node) {
return;
}
const items = [...ctxMenu.node.querySelectorAll(CTX_ITEMS)]; const items = [...ctxMenu.node.querySelectorAll(CTX_ITEMS)];
const at = items.indexOf(document.activeElement); const at = items.indexOf(document.activeElement);
const moves = {ArrowDown: at + 1, ArrowUp: Math.max(at, 0) - 1, Home: 0, End: items.length - 1}; const moves = {ArrowDown: at + 1, ArrowUp: Math.max(at, 0) - 1, Home: 0, End: items.length - 1};
+2 -2
View File
@@ -242,7 +242,7 @@
* @param {Function} [around] called as around(box, swap) in place of swap(), for a keeper such as keepTyping() or for * @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. * work that needs nodes in the page.
* @returns {Promise} settles once box holds nodes. When a keyed child leaves, the swap runs inside fadeTransition() * @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. * newer swap.
*/ */
function fadeSwap(box, nodes, around) { function fadeSwap(box, nodes, around) {
@@ -257,7 +257,7 @@
run(); run();
return Promise.resolve(); return Promise.resolve();
} }
return fadeTransition(run); return fadeTransition(run, box);
} }
function toast(title, lines, good) { function toast(title, lines, good) {
+4 -2
View File
@@ -121,7 +121,8 @@
/** /**
* @param {object} result a hub answer; a 409 carries {id, status} of the item it refused. * @param {object} result a hub answer; a 409 carries {id, status} of the item it refused.
* @param {string} label the batch's label. * @param {string} label the batch's label.
* @param {Map<string, string>|undefined} names item id to the title the toast shows instead of the id. * @param {Map<string, string>|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. * @returns {boolean} whether it was such a refusal: kept in refusedIds and toasted by title.
*/ */
function namedRefusal(result, label, names) { function namedRefusal(result, label, names) {
@@ -130,8 +131,9 @@
return false; return false;
} }
const status = typeof result.data.status === "string" ? result.data.status : "refused"; const status = typeof result.data.status === "string" ? result.data.status : "refused";
const row = state.inbox.find((item) => item.id === id);
refusedIds.set(id, status); 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; return true;
} }
+11 -2
View File
@@ -335,8 +335,17 @@
const svg = box.querySelector("svg.kanban-lines"); const svg = box.querySelector("svg.kanban-lines");
const base = box.getBoundingClientRect(); const base = box.getBoundingClientRect();
const rectIn = (node) => { const rectIn = (node) => {
const found = node && node.getClientRects().length ? node.getBoundingClientRect() : null; if (!node || !node.getClientRects().length) {
return found && {x: found.left - base.left, y: found.top - base.top, w: found.width, h: found.height}; 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 cardNode = (task) => [...box.querySelectorAll(".kanban-card")].find((card) => card.dataset.task === task) || null;
const rectOf = (task) => rectIn(cardNode(task)); const rectOf = (task) => rectIn(cardNode(task));
+13 -9
View File
@@ -73,12 +73,13 @@
} }
const CLOSED_POLL = 2000; const CLOSED_POLL = 2000;
const closedWatch = {seen: null, busy: false}; const closedWatch = {seen: null, busy: false, primed: false};
/** /**
* @returns {Promise<void>} settled once the hub's count of closed cards (/api/match/closed) is read; when it moved * @returns {Promise<void>} settled once the hub's count of closed cards (/api/match/closed) is read; the first read,
* since the last read, the first read included, an open Match deck fetches its cards and the state reloads at once * taken at start beside the page's own first loads, only sets the baseline; when the count moved since the last
* instead of at their next interval, so a card answered in Claude or another browser leaves within one CLOSED_POLL. * 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() { async function watchClosed() {
if (closedWatch.busy) { if (closedWatch.busy) {
@@ -88,11 +89,14 @@
try { try {
const response = await fetch("/api/match/closed", {cache: "no-store"}); const response = await fetch("/api/match/closed", {cache: "no-store"});
const data = response.ok ? await response.json() : null; const data = response.ok ? await response.json() : null;
if (data && data.closed !== closedWatch.seen) { const moved = Boolean(data) && data.closed !== closedWatch.seen && closedWatch.primed;
closedWatch.seen = data.closed; if (data) {
if (matchShown()) { Object.assign(closedWatch, {seen: data.closed, primed: true});
fetchMatch(); }
} if (moved && matchShown()) {
fetchMatch();
}
if (moved) {
refresh(); refresh();
} }
} catch { } catch {
+6
View File
@@ -841,6 +841,12 @@
} }
acts[swiped](); 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) => { head.addEventListener("pointerdown", (event) => {
if (event.button !== 0 || matchView.drag || (event.target instanceof Element && event.target.closest("button, a, input, textarea, select"))) { if (event.button !== 0 || matchView.drag || (event.target instanceof Element && event.target.closest("button, a, input, textarea, select"))) {
return; return;
+12 -1
View File
@@ -54,19 +54,30 @@
/** /**
* @param {Function} run changes the DOM. * @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 * @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 * without the API, under prefers-reduced-motion and while another transition runs, whose live new view then shows
* the change. * the change.
*/ */
function fadeTransition(run) { function fadeTransition(run, box) {
if (!document.startViewTransition || calm.matches || viewShift.running) { if (!document.startViewTransition || calm.matches || viewShift.running) {
run(); run();
return Promise.resolve(); return Promise.resolve();
} }
viewShift.running = true; viewShift.running = true;
if (box) {
document.documentElement.classList.add("swap-scope");
box.classList.add("swap-box");
}
const shift = document.startViewTransition(run); const shift = document.startViewTransition(run);
const done = () => { const done = () => {
viewShift.running = false; viewShift.running = false;
if (box) {
document.documentElement.classList.remove("swap-scope");
box.classList.remove("swap-box");
}
}; };
shift.finished.then(done, done); shift.finished.then(done, done);
shift.ready.catch((error) => { shift.ready.catch((error) => {
+6 -6
View File
@@ -185,13 +185,13 @@
* @param label - the summary's name. * @param label - the summary's name.
* @param hint - the summary's tooltip. * @param hint - the summary's tooltip.
* @param name - the summary's icon. * @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. * @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()), 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); const taskSection = (title, ...nodes) => h("section", {class: "task-menu-section"}, h("h3", {}, title), ...nodes);
@@ -243,9 +243,9 @@
taskView.plan = null; taskView.plan = null;
taskView.bulk = null; taskView.bulk = null;
const plan = inbox ? null : planTools(view); 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]); 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()]); 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); const bar = boxHead("Tasks", "task-toolbar task-bar", taskViewSwitch(inbox), search, filter, chip, status, actions, count);
undoView.box = undo; undoView.box = undo;
+1
View File
@@ -5,6 +5,7 @@
document.addEventListener("visibilitychange", () => document.hidden || [moving, syncRadio].forEach((task) => task())); document.addEventListener("visibilitychange", () => document.hidden || [moving, syncRadio].forEach((task) => task()));
window.setInterval(poll, 10000); window.setInterval(poll, 10000);
window.setInterval(follow, 3000); window.setInterval(follow, 3000);
whileShown(watchClosed)();
window.setInterval(whileShown(watchClosed), CLOSED_POLL); window.setInterval(whileShown(watchClosed), CLOSED_POLL);
window.setInterval(whileShown(moving), RELAYOUT); window.setInterval(whileShown(moving), RELAYOUT);
window.setInterval(whileShown(liveSky), 30000); window.setInterval(whileShown(liveSky), 30000);
+2
View File
@@ -2,6 +2,8 @@
.graph.tasks.match > .match-stack { flex: 1; } .graph.tasks.match > .match-stack { flex: 1; }
.match-home { display: grid; grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; } .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; } .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 { 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-stack[data-wide="true"] { width: 100%; }
.match-widen { position: absolute; top: 12px; right: 12px; z-index: 1; } .match-widen { position: absolute; top: 12px; right: 12px; z-index: 1; }
+1 -1
View File
@@ -75,7 +75,7 @@ svg .res-bar.faint { opacity: 0.35; }
.res-view-menu, .res-limits-menu { position: relative; } .res-view-menu, .res-limits-menu { position: relative; }
.res-view-menu > summary, .res-limits-menu > summary { padding: 4px 10px; } .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; } .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 .menu-box h3 { padding: 6px 6px 2px; }
.res-limits-menu .limit-profiles { margin: 2px 6px 6px; } .res-limits-menu .limit-profiles { margin: 2px 6px 6px; }
.res-limits-menu .limit-matrix { justify-self: start; margin: 2px 6px; } .res-limits-menu .limit-matrix { justify-self: start; margin: 2px 6px; }
+3 -2
View File
@@ -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: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; } .to-one > label > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.agent-foot > .agent-send { flex: none; } .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 .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 { min-height: 0; }
.radio-home-radio-speak .mic-area > textarea { flex: 1 1 0; min-height: 2rem; max-height: none; resize: none; } .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); } 0%, 42%, 100% { box-shadow: 0 0 4px 0 var(--beat); }
10%, 30% { box-shadow: 0 0 12px 3px 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; } }
+4
View File
@@ -118,6 +118,10 @@ HELPERS = """
await sleep(0); await sleep(0);
return Boolean(shown); return Boolean(shown);
}; };
const beatsAtRest = () => document.getAnimations().filter((motion) => motion.animationName === "lub-dub").forEach((motion) => {
motion.pause();
motion.currentTime = 0;
});
""" """
OVERLAP = """ OVERLAP = """
const shown = (node) => node.getClientRects().length > 0 && node.getBoundingClientRect().width > 0; const shown = (node) => node.getClientRects().length > 0 && node.getBoundingClientRect().width > 0;
+6 -6
View File
@@ -88,7 +88,7 @@ RADIO = """
filters: audio().filters.slice(at.filters).map((node) => [node.type, node.frequency.value]), filters: audio().filters.slice(at.filters).map((node) => [node.type, node.frequency.value]),
oscillators: audio().oscillators - at.oscillators, oscillators: audio().oscillators - at.oscillators,
levels: audio().levels.slice(at.levels), 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) => { const cpuShown = async (label) => {
refreshNow(); 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 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 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 chip = async (name, value) => {
const select = spot.querySelector(`.chip-select[data-chip="${name}"] select`); const select = spot.querySelector(`.chip-select[data-chip="${name}"] select`);
select.value = value; select.value = value;
@@ -193,7 +193,7 @@ LOG = """(async () => {@HELPERS@@RADIO@
all(".radio-filters button", spot).find((button) => name(button) === "Clear filters").click(); all(".radio-filters button", spot).find((button) => name(button) === "Clear filters").click();
await sleep(150); await sleep(150);
const clearedChips = [chips(), search().value, rows().length]; 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()); const sender = name(faceOf());
faceOf().click(); faceOf().click();
const switches = await until(() => document.getElementById("popup").open && document.querySelector("#popup .agent-settings"), 4000); 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()]; const unmuted = [faceOf().dataset.quiet, await stored()];
all("#popup .popup-head button").find((button) => name(button) === "Close").click(); all("#popup .popup-head button").find((button) => name(button) === "Close").click();
await sleep(150); 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 full = await until(() => document.getElementById("popup").open && document.querySelector("#popup .radio-full"), 4000);
const opened = [document.getElementById("popup").open, text(full)]; const opened = [document.getElementById("popup").open, text(full)];
all("#popup .popup-head button").find((button) => name(button) === "Close").click(); all("#popup .popup-head button").find((button) => name(button) === "Close").click();
@@ -238,8 +238,8 @@ LOG_KEPT = """(async () => {@HELPERS@@RADIO@
await sleep(300); await sleep(300);
const top = Math.max(list.getBoundingClientRect().top, spot.getBoundingClientRect().top, document.querySelector(".head").getBoundingClientRect().bottom); 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 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; 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", list).length, fits: fits()}; return {...kept, shown, total: all(".radio-row:not([data-vanishing])", list).length, fits: fits()};
})()""" })()"""
SOUND = """(async () => {@HELPERS@@RADIO@ SOUND = """(async () => {@HELPERS@@RADIO@
const found = {}; const found = {};
+4
View File
@@ -115,6 +115,10 @@ def probe(template: str, width: int) -> str:
class TestAgentMessageBox(base.OrchestratorE2ECase): class TestAgentMessageBox(base.OrchestratorE2ECase):
stored = attached.TestFieldAttachments.stored 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: def check_layout(self, width: int, layout: dict) -> None:
self.assertNotIn("error", layout, layout) self.assertNotIn("error", layout, layout)
self.assertEqual(layout["files"], [["mic-attach-file", True, False]], layout) self.assertEqual(layout["files"], [["mic-attach-file", True, False]], layout)
+2 -2
View File
@@ -84,14 +84,14 @@ PROBE = """(async () => {@HELPERS@
const takesPointer = Boolean(hit && hit.closest("button.bubble-skip") === skip); const takesPointer = Boolean(hit && hit.closest("button.bubble-skip") === skip);
skip.focus(); skip.focus();
const focused = document.activeElement === skip; 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 gone = Boolean(await until(() => !layer.querySelector(`.speech-bubble[data-who="${CSS.escape(dockedWho)}"]`), 3000));
const kept = Boolean(of(anchoredWho));
poll(); poll();
await sleep(2500); await sleep(2500);
poll(); poll();
await sleep(1500); await sleep(1500);
const back = Boolean(of(dockedWho)); const back = Boolean(of(dockedWho));
const kept = Boolean(of(anchoredWho));
all("[data-e2e-pin]").forEach((node) => node.remove()); all("[data-e2e-pin]").forEach((node) => node.remove());
return {dockedWho, anchoredWho, anchored, dock, states, takesPointer, focused, gone, back, kept}; return {dockedWho, anchoredWho, anchored, dock, states, takesPointer, focused, gone, back, kept};
})()""" })()"""
+3 -2
View File
@@ -66,7 +66,7 @@ SHOW = """(async () => {@HELPERS@
rows: shown, rows: shown,
withoutDeny, withoutDeny,
restored: rows().length, 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")]), 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, patterns: all('#main [aria-label="Never granted"] li').length,
targets, 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); const pill = await until(() => all("#main li.hub-rule [data-agents]").find((node) => text(node) === "group builders"), 15000);
unfold(); unfold();
const hits = await until(() => ruleRow() && text(ruleRow().querySelector(".hub-rule-count")), 8000); 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"]'); const sets = document.querySelector('#main form[aria-label="New rule set"]');
sets.querySelector('input[aria-label="Set name"]').value = "ci"; sets.querySelector('input[aria-label="Set name"]').value = "ci";
for (const box of sets.querySelectorAll('[aria-label="Rules"] input[type="checkbox"]')) { for (const box of sets.querySelectorAll('[aria-label="Rules"] input[type="checkbox"]')) {
+1
View File
@@ -46,6 +46,7 @@ FLAT = """(async () => {@HELPERS@@HOME@@KIT@
} }
return null; return null;
}; };
beatsAtRest();
const found = all("#main .home-tile").map((node) => { const found = all("#main .home-tile").map((node) => {
const body = node.querySelector(".home-body"); const body = node.querySelector(".home-body");
const flat = body.querySelector(".home-flat"); const flat = body.querySelector(".home-flat");
+17 -1
View File
@@ -151,10 +151,24 @@ BEAT = """(async () => {@HELPERS@
} }
return {transforms: [...seen.transform].filter((value) => value !== "none").length, shadows: seen.shadow.size}; 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 tasks = [...@WORKING@, ...@STILL@];
const marked = Object.fromEntries(tasks.map((task) => [task, card(task) ? card(task).classList.contains("is-working") : null])); 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])); 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.assertEqual(found["animation"], {**dict.fromkeys(WORKING, name), **dict.fromkeys(STILL, "none")}, found)
self.assertGreater(found["beat"]["shadows"], 1, found) self.assertGreater(found["beat"]["shadows"], 1, found)
self.assertEqual(found["still"], {"transforms": 0, "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.assertGreater(moving["beat"]["transforms"], 0, moving)
self.assertEqual(calm["beat"]["transforms"], 0, calm) self.assertEqual(calm["beat"]["transforms"], 0, calm)
self.assertEqual(moving["frames"], {"beat": ["box-shadow", "transform"], "glow": ["box-shadow"]}, moving) self.assertEqual(moving["frames"], {"beat": ["box-shadow", "transform"], "glow": ["box-shadow"]}, moving)
+1 -1
View File
@@ -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["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["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["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((saved["tall"], saved["wide"]), (width == 390, False))
self.assertEqual(read, {"squelch": float(squelch), "radio": radio_bell, "post": post, "tall": width == 390, "wide": 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"]} heads = {"post": ["post", "--to", "Stage"], "call": ["send", "call", "--to", "Stage"], "newsletter": ["post"]}
+1 -1
View File
@@ -118,7 +118,7 @@ class TestInboxGoneRows(HubCase):
self.assertEqual((gone["open"], gone["wide"]), (False, False), gone) 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"): 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.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"): 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) self.assertEqual((refreshed["settled"], refreshed["samePage"], refreshed["rows"]), (True, True, ["echo kept changed"]), refreshed)
+1 -1
View File
@@ -22,7 +22,7 @@ PINS = [
{"kind": "panel", "id": "tasks/burn", "w": 6, "h": 4}, {"kind": "panel", "id": "tasks/burn", "w": 6, "h": 4},
{"kind": "panel", "id": "stream", "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 = { EXPECTED = {
**{screen: [] for screen in base.SCREENS}, **{screen: [] for screen in base.SCREENS},
**{screen: [screen] for screen in OWN}, **{screen: [screen] for screen in OWN},
+1 -1
View File
@@ -30,7 +30,7 @@ MENU = """
} }
await until(() => !shownMenu(), 3000); 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 hiddenHead = () => {
const button = document.querySelector("#main .match-hidden"); const button = document.querySelector("#main .match-hidden");
return button ? [button.hidden, text(button)] : null; return button ? [button.hidden, text(button)] : null;
+1 -1
View File
@@ -28,7 +28,7 @@ LABELS = [
] ]
SOURCES = [("resources", "Resource warnings"), ("mayday", "MAYDAY calls"), ("dream", "Dream reminder")] SOURCES = [("resources", "Resource warnings"), ("mayday", "MAYDAY calls"), ("dream", "Dream reminder")]
ON = {"browser": True, "sounds": True, "aloud": True, "title": True} 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 = """ KIT = """
const boxes = (group) => all("input[type=checkbox]", group).map((box) => [box.name, box.checked, words(box.closest("label"))]); 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)]); 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)]);
+1 -1
View File
@@ -205,7 +205,7 @@ class TestOrchestratorE2E(base.OrchestratorE2ECase):
self.assertEqual(actions["keys"], ["#agents/chord", "#artifacts/tree", "#tasks/3d", "#home", "#stream"]) 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["ambience"], ["sky-look", "music-toggle", "leitstand", "notify"])
self.assertEqual((actions["settingsUnlabelled"], actions["popupUnlabelled"]), (0, 0)) 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"): 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): with self.subTest(tool=tool):
self.assertTrue(any(tool in entry for entry in actions["palette"]), actions["palette"]) self.assertTrue(any(tool in entry for entry in actions["palette"]), actions["palette"])
+1
View File
@@ -38,6 +38,7 @@ READ = """
return [box.left + box.width / 2 - at.left, box.top + box.height / 2 - at.top]; return [box.left + box.width / 2 - at.left, box.top + box.height / 2 - at.top];
}; };
const read = () => { const read = () => {
beatsAtRest();
const at = document.querySelector("#main .kanban").getBoundingClientRect(); const at = document.querySelector("#main .kanban").getBoundingClientRect();
const line = document.querySelector("#main svg.kanban-lines .kanban-queue"); 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)) : []; const points = line ? line.getAttribute("points").trim().split(/\\s+/).map((pair) => pair.split(",").map(Number)) : [];
+3 -3
View File
@@ -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, limits: lines().length, target: target().length, unknown: all("#main svg.res-chart[data-chart=hardware] rect.res-mark.unknown").length,
}); });
const before = count(); 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"]'); const chip = document.querySelector('#main .res-hardware .legend-chip[data-chip="host:CPU"]');
chip.click(); chip.click();
await sleep(400); await sleep(400);
const chipped = all('#main svg.res-chart[data-chart=hardware] path.res-line[data-series="CPU"]').length; 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(); document.querySelector('#main .res-hardware .legend-chip[data-chip="host:CPU"]').click();
await sleep(400); 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"]) { for (const key of ["legend", "queue", "waits", "limits"]) {
await tick(`#main .res-view-menu input[data-show="${key}"]`, false); 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}) steps.append({**self.step(1366, 768, "kept", KEPT), "shot": None})
data = self.drive(steps, None, init=w4.GUARD)["results"] data = self.drive(steps, None, init=w4.GUARD)["results"]
balanced = PROFILES["balanced"] 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): with self.subTest(width=width):
self.assertNotIn("error", found, found) self.assertNotIn("error", found, found)
self.assertEqual([entry[0] for entry in found["entries"]], ["lower", "upper", "STOP", "MAYDAY", "target"]) self.assertEqual([entry[0] for entry in found["entries"]], ["lower", "upper", "STOP", "MAYDAY", "target"])
+1 -1
View File
@@ -51,7 +51,7 @@ READ = """
const speaking = () => live().find((node) => node.dataset.state === "speaking") || null; const speaking = () => live().find((node) => node.dataset.state === "speaking") || null;
const waiting = () => live().find((node) => node.dataset.state === "waiting") || 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 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) => { const read = (node) => {
if (!node) { if (!node) {
return null; return null;
+1 -1
View File
@@ -154,7 +154,7 @@ class TestInboxGoneRows(unittest.TestCase):
self.assert_closed("rule_404", ["operator/kept"], "Rule: Rule ask Bash make deploy") 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): 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): with self.subTest(name=name):
found = self.data[name] found = self.data[name]
self.assertEqual(found["inbox"], [GONE, "operator/kept"], found) self.assertEqual(found["inbox"], [GONE, "operator/kept"], found)
+2 -2
View File
@@ -287,9 +287,9 @@ class TestPagePolls(unittest.TestCase):
found = self.data["timers"] found = self.data["timers"]
self.assertEqual((found["hidden"]["closed"], found["shown"]["closed"], found["watched"]["closed"], found["after"]["closed"]), (0, 0, 5, 5), found) 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"] 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) self.assertEqual(found["requests"], ["/api/match/closed"], found)
def test_music_level_zero_stops_the_graph_and_a_rise_restarts_it(self): def test_music_level_zero_stops_the_graph_and_a_rise_restarts_it(self):
+1 -1
View File
@@ -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.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 beat, "box-shadow" in beat), (True, True))
self.assertEqual(("transform" in glow, "box-shadow" in glow), (False, 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__": if __name__ == "__main__":