From ccc80f17c1dbe32e2fed8cc2667516a91e676dc9 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 23 Nov 2026 11:19:23 +0000 Subject: [PATCH] fix(hub): resize the 3D canvas with its box and repair five stale e2e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 3D graph took its size once from the box, so a later scrollbar cut it at 390; a ResizeObserver now follows the box and is disconnected on dispose. The e2e follow 78d4e4a (match swipe's ids method shadowed the case's request counter, now card_ids), af3555e (three reveal buttons), 94bf0b4 (legend toggle in the Home tile head), a4f7017 (the runner needs SHELL for its login shell) and 50363b1 (rules live in their own Controls tab). 🎯 Fix: 85 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 82 🚦 Gate: ⛔ fix 85 % < 90 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- orchestrator/templates/page-graph3d.js | 8 +++++++- tests/e2e/hub_e2e_views.py | 1 + tests/e2e/test_home_tile_open_e2e.py | 5 +++-- tests/e2e/test_hub_inbox_e2e.py | 2 +- tests/e2e/test_match_swipe_e2e.py | 16 ++++++++-------- tests/e2e/test_reveal_withheld_e2e.py | 6 +++--- 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/orchestrator/templates/page-graph3d.js b/orchestrator/templates/page-graph3d.js index 15a2eb1..601d5b3 100644 --- a/orchestrator/templates/page-graph3d.js +++ b/orchestrator/templates/page-graph3d.js @@ -11,7 +11,7 @@ const DEPTH_GAP = 90; const TIME_DEPTH = 640; const TOP = {operator: 6, chair: 4, session: 2.5}; - const g3 = {lib: null, three: null, THREE: null, graph: null, host: null, tab: "", sig: "", planes: [], colors: null, failed: "", picked: null, fit: false, badges: new Map(), faces: new Set(), textures: new Map(), pulse: 0}; + const g3 = {lib: null, three: null, THREE: null, graph: null, sizer: null, host: null, tab: "", sig: "", planes: [], colors: null, failed: "", picked: null, fit: false, badges: new Map(), faces: new Set(), textures: new Map(), pulse: 0}; const layoutsOf = (tab) => (tab === "tasks" ? LAYOUTS.filter(([id]) => id !== "spawn") : LAYOUTS); const layoutOf = (tab) => (layoutsOf(tab).some(([id]) => id === space.views.graph.axis) ? space.views.graph.axis : "none"); @@ -398,6 +398,8 @@ if (!g3.graph) { try { g3.graph = Graph({controlType: "orbit"})(box); + g3.sizer = new ResizeObserver(() => g3.graph && g3.graph.width(box.clientWidth).height(box.clientHeight)); + g3.sizer.observe(box); } catch (error) { host.replaceChildren(emptyState("3D unavailable", `This browser offers no WebGL: ${error.message || error}`)); g3.host = null; @@ -438,6 +440,10 @@ g3.graph._destructor(); } } + if (g3.sizer) { + g3.sizer.disconnect(); + g3.sizer = null; + } window.cancelAnimationFrame(g3.pulse); g3.pulse = 0; g3.graph = null; diff --git a/tests/e2e/hub_e2e_views.py b/tests/e2e/hub_e2e_views.py index 2041091..abd6cf0 100644 --- a/tests/e2e/hub_e2e_views.py +++ b/tests/e2e/hub_e2e_views.py @@ -209,6 +209,7 @@ RULES_OVERLAP = """(async () => {@HELPERS@@CLASHES@ if (open) { open.click(); } + (await until(() => document.getElementById("controls-tab-rules"), 8000)).click(); const rules = await until(() => document.querySelector("#main .rule-form"), 8000); const kind = rules.querySelector("select"); const found = {}; diff --git a/tests/e2e/test_home_tile_open_e2e.py b/tests/e2e/test_home_tile_open_e2e.py index c5ef645..407fea6 100644 --- a/tests/e2e/test_home_tile_open_e2e.py +++ b/tests/e2e/test_home_tile_open_e2e.py @@ -123,7 +123,8 @@ HEADERS = """(async () => {@HELPERS@@HOME@@KIT@ return { key: node.dataset.pin, w: Number(node.dataset.w), gone: node.classList.contains("gone"), overflow: head.scrollWidth > head.clientWidth + 1, outside: shown.filter((child) => child.getBoundingClientRect().left < box.left - 0.5 || child.getBoundingClientRect().right > box.right + 0.5).map((child) => child.className), - order: shown.map((child) => [...child.classList].find((name) => name.startsWith("home-"))), + order: shown.map((child) => [...child.classList].find((name) => name.startsWith("home-") || name === "legend-toggle")), + legend: Boolean(head.querySelector(".legend-toggle")), ellipsis: [getComputedStyle(title).textOverflow, getComputedStyle(title).whiteSpace, title.scrollWidth > title.clientWidth], open: open.hidden ? null : {href: open.getAttribute("href"), title: open.getAttribute("title"), label: open.getAttribute("aria-label"), tag: open.tagName, focused, tabIndex: open.tabIndex, size: rect(open), unpin: rect(head.querySelector(".home-unpin")), glyph: open.querySelector("use").getAttribute("href")}, }; @@ -233,7 +234,7 @@ class TestHomeTileOpen(HubCase): self.assertEqual(head["order"], ["home-grip", "home-title", "home-unpin"], head) continue self.assertFalse(head["gone"], head) - self.assertEqual(head["order"], ["home-grip", "home-title", "home-open", "home-unpin"], head) + self.assertEqual(head["order"], ["home-grip", "home-title", *(["legend-toggle"] if head["legend"] else []), "home-open", "home-unpin"], head) found = head["open"] self.assertEqual((found["tag"], found["label"], found["focused"], found["tabIndex"], found["glyph"]), ("A", "Open", True, 0, "#bi-arrows-angle-expand"), found) self.assertTrue(found["title"].startswith("Open: show ") and found["title"].endswith(" in full view"), found) diff --git a/tests/e2e/test_hub_inbox_e2e.py b/tests/e2e/test_hub_inbox_e2e.py index 3e8f8d6..18a1d7b 100644 --- a/tests/e2e/test_hub_inbox_e2e.py +++ b/tests/e2e/test_hub_inbox_e2e.py @@ -64,7 +64,7 @@ class TestHubInbox(base.OrchestratorE2ECase): def run_jobs() -> None: if any(job["status"] == "queued" for job in self.httpd.hub.jobs.listed()): - subprocess.run([sys.executable, str(RUNNER), "--port", str(self.port), "--interval", "0.1", *trust, "--once"], capture_output=True, timeout=120, check=False) + subprocess.run([sys.executable, str(RUNNER), "--port", str(self.port), "--interval", "0.1", *trust, "--once"], capture_output=True, timeout=120, check=False, env={**os.environ, "SHELL": str(self.shell)}) self.beside(run_jobs) private = "".join(line for line in signer.pem.read_text(encoding="utf-8").splitlines() if not line.startswith("-----")) diff --git a/tests/e2e/test_match_swipe_e2e.py b/tests/e2e/test_match_swipe_e2e.py index c499388..d0abba5 100644 --- a/tests/e2e/test_match_swipe_e2e.py +++ b/tests/e2e/test_match_swipe_e2e.py @@ -132,16 +132,16 @@ class TestMatchSwipe(HubCase): super().setUp() self.cards() - def ids(self) -> dict[str, str]: + def card_ids(self) -> dict[str, str]: return {"COMMIT": f"review:{self.commit}", "COMMAND": "operator:operator/issue", "STALE": f"review:{self.stale}"} def measured(self, driver: str, binary: str) -> dict[int, list[dict]]: - steps = [{"width": width, "height": height, "url": f"{self.base}?{width}-measure#tasks/match", "wait": 1500, "probe": probe(MEASURE, **self.ids()), "shot": None} for width, height in base.WIDTHS] + steps = [{"width": width, "height": height, "url": f"{self.base}?{width}-measure#tasks/match", "wait": 1500, "probe": probe(MEASURE, **self.card_ids()), "shot": None} for width, height in base.WIDTHS] data = self.drive(steps, None, driver, binary) found = {} for result, (width, _) in zip(data["results"], base.WIDTHS, strict=True): self.assertNotIn("error", result, result) - self.assertEqual([point["front"] for point in result["points"]], [self.ids()[name] for name in ("COMMIT", "COMMAND", "STALE", "COMMIT")], result) + self.assertEqual([point["front"] for point in result["points"]], [self.card_ids()[name] for name in ("COMMIT", "COMMAND", "STALE", "COMMIT")], result) self.assertEqual(result["tally"], "1", result) found[width] = result["points"] return found @@ -155,17 +155,17 @@ class TestMatchSwipe(HubCase): shot = str(OUT / f"{browser}-{width}") at = {"width": width, "height": height} steps += [ - {**at, "url": f"{self.base}?{width}-swipe#tasks/match", "wait": 1500, "probe": probe(START, X=commit["x"], Y=commit["y"], **self.ids()), "shot": None}, - {**at, "url": None, "wait": 0, "drag": [[commit["x"], commit["y"]], [commit["x"], max(commit["y"] - LIFT, 2)]], "probe": probe(LATER, X=command["x"], Y=command["y"], **self.ids()), "shot": None}, - {**at, "url": None, "wait": 0, "drag": sideways(command, width, -1), "probe": probe(REJECT, X=stale["x"], Y=stale["y"], **self.ids()), "shot": None}, - {**at, "url": None, "wait": 0, "drag": sideways(stale, width, 1), "probe": probe(REFUSED, X=again["x"], Y=again["y"], **self.ids()), "shot": None}, + {**at, "url": f"{self.base}?{width}-swipe#tasks/match", "wait": 1500, "probe": probe(START, X=commit["x"], Y=commit["y"], **self.card_ids()), "shot": None}, + {**at, "url": None, "wait": 0, "drag": [[commit["x"], commit["y"]], [commit["x"], max(commit["y"] - LIFT, 2)]], "probe": probe(LATER, X=command["x"], Y=command["y"], **self.card_ids()), "shot": None}, + {**at, "url": None, "wait": 0, "drag": sideways(command, width, -1), "probe": probe(REJECT, X=stale["x"], Y=stale["y"], **self.card_ids()), "shot": None}, + {**at, "url": None, "wait": 0, "drag": sideways(stale, width, 1), "probe": probe(REFUSED, X=again["x"], Y=again["y"], **self.card_ids()), "shot": None}, {**at, "url": None, "wait": 0, "drag": sideways(again, width, 1), "probe": probe(ACCEPT), "shot": f"{shot}-swiped-decisions.png"}, ] return steps def check(self, data: dict) -> None: self.assertEqual([error for error in data["errors"] if "/favicon.ico" not in error], []) - ids = self.ids() + ids = self.card_ids() results = iter(data["results"]) for width, _ in base.WIDTHS: start, later, reject, refused, accept = (next(results) for _ in range(5)) diff --git a/tests/e2e/test_reveal_withheld_e2e.py b/tests/e2e/test_reveal_withheld_e2e.py index 9f3d7b4..a42001e 100644 --- a/tests/e2e/test_reveal_withheld_e2e.py +++ b/tests/e2e/test_reveal_withheld_e2e.py @@ -110,7 +110,7 @@ class TestRevealWithheld(base.OrchestratorE2ECase): def check(self, data: dict, browser: str, signs: bool) -> None: self.assertEqual([error for error in data["errors"] if "(style-src-elem)" not in error and "/favicon.ico" not in error], []) - hidden = {"hidden": ["masked", "content withheld", None], "buttons": ["Reveal", "Reveal"], "masked": True, "clear": []} + hidden = {"hidden": ["masked", "content withheld", None], "buttons": ["Reveal all 2", "Reveal", "Reveal"], "masked": True, "clear": []} results = iter(data["results"]) for width, _ in WIDTHS: ids = self.sets[width] @@ -118,7 +118,7 @@ class TestRevealWithheld(base.OrchestratorE2ECase): with self.subTest(browser=browser, width=width): self.assertNotIn("error", show, show) self.assertEqual(show["one"], hidden, show) - self.assertEqual(show["all"], {**hidden, "buttons": ["Reveal all 2", "Reveal", "Reveal"]}, show) + self.assertEqual(show["all"], hidden, show) self.assertEqual(show["leaked"], [], show) one_id, all_id = (ids[name].split(":", 1)[1] for name in ("ONE", "ALL")) self.assertEqual(one["posted"], [[f"review/{one_id}/reveal/sign", ["app.py"]], *([[f"review/{one_id}/reveal", ["app.py"]]] if signs else [])], one) @@ -127,7 +127,7 @@ class TestRevealWithheld(base.OrchestratorE2ECase): self.assertEqual(one["after"], {"hidden": ["revealed", "content withheld", None], "buttons": ["Reveal"], "masked": False, "clear": ["plain-example"]}, one) self.assertEqual(every["after"], {"hidden": ["revealed", "revealed", None], "buttons": [], "masked": False, "clear": list(WORDS)}, every) else: - self.assertEqual((one["after"], every["after"]), (hidden, {**hidden, "buttons": ["Reveal all 2", "Reveal", "Reveal"]})) + self.assertEqual((one["after"], every["after"]), (hidden, hidden)) self.assertEqual((one["kept"], every["kept"]), ([], [])) self.assertFalse(any(found["wide"] for found in (show, one, every)), width)