Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

test(browser): wait for radar layout before titlebar drag

tt-a1i8bfe4e88e11a
diff --git a/archify/test/semantic-radar.test.mjs b/archify/test/semantic-radar.test.mjs
index 8149d14c..16fe3ba7 100644
--- a/archify/test/semantic-radar.test.mjs
+++ b/archify/test/semantic-radar.test.mjs
@@ -507,10 +507,14 @@ test('Semantic Radar titlebar drag persists while surface drag still pans the di
const browser = new ChromeVisualBrowser(chromePath);
try {
const sessionId = await loadArtifact(browser, artifact, { width: 1440, height: 900 });
- const geometry = await evaluate(browser, sessionId, `(function () {
+ const geometry = await evaluate(browser, sessionId, `(async function () {
var container = document.querySelector('.diagram-container');
window.scrollTo(0, Math.max(0, container.offsetTop + container.offsetHeight - window.innerHeight + 8));
Archify.radar.open();
+ // Opening the panel can still schedule Reader/Chrome layout. Measure the
+ // titlebar only after those pending updates settle, before sending input.
+ await Archify.readerLayout.whenStable();
+ await Archify.viewerChromeLayout.whenStable();
var radar = document.getElementById('overview-map').getBoundingClientRect();
var head = document.querySelector('.overview-map-head').getBoundingClientRect();
var containerRect = container.getBoundingClientRect();
@@ -523,7 +527,7 @@ test('Semantic Radar titlebar drag persists while surface drag still pans the di
top: Math.max(24, containerRect.top + 20)
}
};
- })()`);
+ })()`, true);
const titleStart = {
x: geometry.head.left + 48,
y: geometry.head.top + geometry.head.height / 2,