fix(hub): resize the 3D canvas with its box and repair five stale e2e
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 follow78d4e4a(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) and50363b1(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 <noreply@anthropic.com>
This commit is contained in:
1 parent
d6e8b4a923
commit
ccc80f17c1
6 files changed
+23
-15
No files matched your search
@@ -11,7 +11,7 @@
|
|||||||
const DEPTH_GAP = 90;
|
const DEPTH_GAP = 90;
|
||||||
const TIME_DEPTH = 640;
|
const TIME_DEPTH = 640;
|
||||||
const TOP = {operator: 6, chair: 4, session: 2.5};
|
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 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");
|
const layoutOf = (tab) => (layoutsOf(tab).some(([id]) => id === space.views.graph.axis) ? space.views.graph.axis : "none");
|
||||||
@@ -398,6 +398,8 @@
|
|||||||
if (!g3.graph) {
|
if (!g3.graph) {
|
||||||
try {
|
try {
|
||||||
g3.graph = Graph({controlType: "orbit"})(box);
|
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) {
|
} catch (error) {
|
||||||
host.replaceChildren(emptyState("3D unavailable", `This browser offers no WebGL: ${error.message || error}`));
|
host.replaceChildren(emptyState("3D unavailable", `This browser offers no WebGL: ${error.message || error}`));
|
||||||
g3.host = null;
|
g3.host = null;
|
||||||
@@ -438,6 +440,10 @@
|
|||||||
g3.graph._destructor();
|
g3.graph._destructor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (g3.sizer) {
|
||||||
|
g3.sizer.disconnect();
|
||||||
|
g3.sizer = null;
|
||||||
|
}
|
||||||
window.cancelAnimationFrame(g3.pulse);
|
window.cancelAnimationFrame(g3.pulse);
|
||||||
g3.pulse = 0;
|
g3.pulse = 0;
|
||||||
g3.graph = null;
|
g3.graph = null;
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ RULES_OVERLAP = """(async () => {@HELPERS@@CLASHES@
|
|||||||
if (open) {
|
if (open) {
|
||||||
open.click();
|
open.click();
|
||||||
}
|
}
|
||||||
|
(await until(() => document.getElementById("controls-tab-rules"), 8000)).click();
|
||||||
const rules = await until(() => document.querySelector("#main .rule-form"), 8000);
|
const rules = await until(() => document.querySelector("#main .rule-form"), 8000);
|
||||||
const kind = rules.querySelector("select");
|
const kind = rules.querySelector("select");
|
||||||
const found = {};
|
const found = {};
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ HEADERS = """(async () => {@HELPERS@@HOME@@KIT@
|
|||||||
return {
|
return {
|
||||||
key: node.dataset.pin, w: Number(node.dataset.w), gone: node.classList.contains("gone"), overflow: head.scrollWidth > head.clientWidth + 1,
|
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),
|
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],
|
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")},
|
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)
|
self.assertEqual(head["order"], ["home-grip", "home-title", "home-unpin"], head)
|
||||||
continue
|
continue
|
||||||
self.assertFalse(head["gone"], head)
|
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"]
|
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.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)
|
self.assertTrue(found["title"].startswith("Open: show ") and found["title"].endswith(" in full view"), found)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class TestHubInbox(base.OrchestratorE2ECase):
|
|||||||
|
|
||||||
def run_jobs() -> None:
|
def run_jobs() -> None:
|
||||||
if any(job["status"] == "queued" for job in self.httpd.hub.jobs.listed()):
|
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)
|
self.beside(run_jobs)
|
||||||
private = "".join(line for line in signer.pem.read_text(encoding="utf-8").splitlines() if not line.startswith("-----"))
|
private = "".join(line for line in signer.pem.read_text(encoding="utf-8").splitlines() if not line.startswith("-----"))
|
||||||
|
|||||||
@@ -132,16 +132,16 @@ class TestMatchSwipe(HubCase):
|
|||||||
super().setUp()
|
super().setUp()
|
||||||
self.cards()
|
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}"}
|
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]]:
|
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)
|
data = self.drive(steps, None, driver, binary)
|
||||||
found = {}
|
found = {}
|
||||||
for result, (width, _) in zip(data["results"], base.WIDTHS, strict=True):
|
for result, (width, _) in zip(data["results"], base.WIDTHS, strict=True):
|
||||||
self.assertNotIn("error", result, result)
|
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)
|
self.assertEqual(result["tally"], "1", result)
|
||||||
found[width] = result["points"]
|
found[width] = result["points"]
|
||||||
return found
|
return found
|
||||||
@@ -155,17 +155,17 @@ class TestMatchSwipe(HubCase):
|
|||||||
shot = str(OUT / f"{browser}-{width}")
|
shot = str(OUT / f"{browser}-{width}")
|
||||||
at = {"width": width, "height": height}
|
at = {"width": width, "height": height}
|
||||||
steps += [
|
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": 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.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.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.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"},
|
{**at, "url": None, "wait": 0, "drag": sideways(again, width, 1), "probe": probe(ACCEPT), "shot": f"{shot}-swiped-decisions.png"},
|
||||||
]
|
]
|
||||||
return steps
|
return steps
|
||||||
|
|
||||||
def check(self, data: dict) -> None:
|
def check(self, data: dict) -> None:
|
||||||
self.assertEqual([error for error in data["errors"] if "/favicon.ico" not in error], [])
|
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"])
|
results = iter(data["results"])
|
||||||
for width, _ in base.WIDTHS:
|
for width, _ in base.WIDTHS:
|
||||||
start, later, reject, refused, accept = (next(results) for _ in range(5))
|
start, later, reject, refused, accept = (next(results) for _ in range(5))
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class TestRevealWithheld(base.OrchestratorE2ECase):
|
|||||||
|
|
||||||
def check(self, data: dict, browser: str, signs: bool) -> None:
|
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], [])
|
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"])
|
results = iter(data["results"])
|
||||||
for width, _ in WIDTHS:
|
for width, _ in WIDTHS:
|
||||||
ids = self.sets[width]
|
ids = self.sets[width]
|
||||||
@@ -118,7 +118,7 @@ class TestRevealWithheld(base.OrchestratorE2ECase):
|
|||||||
with self.subTest(browser=browser, width=width):
|
with self.subTest(browser=browser, width=width):
|
||||||
self.assertNotIn("error", show, show)
|
self.assertNotIn("error", show, show)
|
||||||
self.assertEqual(show["one"], hidden, 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)
|
self.assertEqual(show["leaked"], [], show)
|
||||||
one_id, all_id = (ids[name].split(":", 1)[1] for name in ("ONE", "ALL"))
|
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)
|
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(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)
|
self.assertEqual(every["after"], {"hidden": ["revealed", "revealed", None], "buttons": [], "masked": False, "clear": list(WORDS)}, every)
|
||||||
else:
|
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.assertEqual((one["kept"], every["kept"]), ([], []))
|
||||||
self.assertFalse(any(found["wide"] for found in (show, one, every)), width)
|
self.assertFalse(any(found["wide"] for found in (show, one, every)), width)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user