Skip to content

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

test(reader): reserve real space for synthetic fixture labels

tt-a1i155ab755abf4
diff --git a/archify/test/fixtures/reader-readability/synthetic-wide.architecture.json b/archify/test/fixtures/reader-readability/synthetic-wide.architecture.json
index 15a10737..cb296a73 100644
--- a/archify/test/fixtures/reader-readability/synthetic-wide.architecture.json
+++ b/archify/test/fixtures/reader-readability/synthetic-wide.architecture.json
@@ -55,7 +55,7 @@
"label": "Client caller",
"sublabel": "external request",
"pos": [
- 40,
+ 10,
270
],
"size": [
@@ -167,7 +167,7 @@
"label": "Work worker",
"sublabel": "queued to complete",
"pos": [
- 1115,
+ 1195,
370
],
"size": [
@@ -181,7 +181,7 @@
"label": "Result formatter",
"sublabel": "text transform",
"pos": [
- 1115,
+ 1195,
170
],
"size": [
diff --git a/archify/test/reader-readability-maintained-browser.test.mjs b/archify/test/reader-readability-maintained-browser.test.mjs
index 386cb5cc..18f6fbfe 100644
--- a/archify/test/reader-readability-maintained-browser.test.mjs
+++ b/archify/test/reader-readability-maintained-browser.test.mjs
@@ -13,6 +13,8 @@ const chromePath = chromeConfigured ? findChrome() : null;
if (chromeConfigured && !chromePath) {
throw new Error(`ARCHIFY_CHROME does not resolve to an executable browser: ${process.env.ARCHIFY_CHROME}`);
}
+// Full edge labels have real room: caller/listener gap 90px and
+// queue/worker gap 105px. Readability must not rely on detached label masks.
const fixtureJson = path.join(root, 'test/fixtures/reader-readability/synthetic-wide.architecture.json');
test('declared wide synthetic reader preserves geometry and reaches edge/node readability', {
@@ -31,12 +33,12 @@ test('declared wide synthetic reader preserves geometry and reaches edge/node re
const svgEnd = artifactSource.indexOf('</svg>', svgStart) + '</svg>'.length;
assert.ok(svgStart >= 0 && svgEnd > svgStart, 'generated artifact must contain a canonical SVG');
const canonicalSvg = artifactSource.slice(svgStart, svgEnd);
- assert.match(canonicalSvg, /viewBox="0 0 1348 706"/);
+ assert.match(canonicalSvg, /viewBox="0 0 1428 706"/);
const tallArtifact = path.join(scratch, 'synthetic-wide-tall.html');
// With the fixture's 9px minimum label, 2300x1600 yields 1946.67px of
// reader width, below the 1984px viewport reserve but above the 1920px
// new-wide cap. This keeps the explicit legacy-width guard meaningful.
- fs.writeFileSync(tallArtifact, artifactSource.replace('viewBox="0 0 1348 706"', 'viewBox="0 0 2300 1600"'));
+ fs.writeFileSync(tallArtifact, artifactSource.replace('viewBox="0 0 1428 706"', 'viewBox="0 0 2300 1600"'));
const browser = new ChromeVisualBrowser(chromePath);
try {
@@ -141,7 +143,7 @@ test('declared wide synthetic reader preserves geometry and reaches edge/node re
assert.ok(Number.isFinite(state.chromeIntersectionArea));
assert.ok(state.chromeStageIntersectionArea <= 0, JSON.stringify(state));
assert.ok(state.chromeIntersectionArea <= 0, JSON.stringify(state));
- assert.equal(state.geometry[0], '0 0 1348 706');
+ assert.equal(state.geometry[0], '0 0 1428 706');
if (state.overflowY) assert.equal(state.overflow, 'authored', JSON.stringify(state));
if (width === 1440) assert.ok(state.receipt.width >= 1294, JSON.stringify(state));
await stable();