[Bug]: Lifecycles without meta.viewBox fail visual-check: the 980x660 default is below the reader's 1.55 wide ratio
Filed as a blank issue, so the fields below follow .github/ISSUE_TEMPLATE/bug-report.yml rather than being entered through it.
Archify version or commit: 2.16.0 (release archify.zip, SHA-256 4c59fa6557a2385beaaef8c7219cc414573acc9f0c30a932d5053b0b20689a46), and main at 9e35d2b0b39b155553ba9fcfe0b4f2a5198dd993
Installation method: Downloaded archify.zip (the v2.16.0 release asset); also reproduced from a Git clone of main
Diagram type: Lifecycle
Exact command
node bin/archify.mjs deliver lifecycle lifecycle-default-canvas.json out/lifecycle-default-canvas.html --quality showcase --json
node bin/archify.mjs visual-check out/lifecycle-default-canvas.html --jsonMinimal redacted JSON reproduction
Three states on the main rail, no meta.viewBox, no cards. This is the exact file; its SHA-256 matches specification.sha256 in the receipt below.
{
"schema_version": 1,
"diagram_type": "lifecycle",
"meta": { "title": "Default lifecycle canvas", "quality_profile": "showcase" },
"lanes": [{ "id": "main", "label": "Phases" }],
"states": [
{ "id": "queued", "type": "start", "label": "Queued", "lane": "main", "col": 0 },
{ "id": "running", "type": "active", "label": "Running", "lane": "main", "col": 1 },
{ "id": "finished", "type": "success", "label": "Finished", "lane": "main", "col": 2 }
],
"transitions": [
{ "id": "start", "from": "queued", "to": "running" },
{ "id": "finish", "from": "running", "to": "finished" }
]
}Validation receipt or exact error
deliver passes. This receipt is from main; v2.16.0 gives the same validation result.
{
"schemaVersion": 1,
"ok": true,
"command": "deliver",
"type": "lifecycle",
"input": "<dir>/lifecycle-default-canvas.json",
"output": "<dir>/lifecycle-default-canvas.html",
"specification": {
"sha256": "70b8b3ba3f809eaa16f41f4c8f41cd55382f57dfbe7f9dd47d3bbaf651e95b0f",
"bytes": 616
},
"artifact": {
"sha256": "7c1bb5bd886cc46b0553ccebbe26aa0edb9548e24c4559a6063661e31b6033c5",
"bytes": 795281
},
"validation": {
"checksPassed": 9,
"checkCount": 9,
"compositionProfile": "showcase",
"compositionStatus": "pass",
"errors": 0,
"warnings": 0
}
}visual-check then fails. Light-theme containment rows from its receipt, identical on v2.16.0 and main:
| Viewport | scrollHeight | readerWidth | Result |
|---|---|---|---|
| 1440x900 | 1038 | 1376 | overflow |
| 1600x1000 | 1158 | 1440 | overflow |
| 1920x1080 | 1158 | 1440 | overflow |
| 2048x1320 | 1320 | 1440 | pass |
First of its four diagnostics (the three light viewports above and 1440x900 dark):
{
"code": "viewer/viewport-overflow",
"severity": "error",
"message": "The rendered artifact overflows the 1440x900 light viewport.",
"subject": {
"artifact": "<dir>/lifecycle-default-canvas.html",
"viewport": {
"width": 1440,
"height": 900,
"theme": "light"
}
},
"evidence": {
"innerWidth": 1440,
"innerHeight": 900,
"scrollWidth": 1440,
"scrollHeight": 1038,
"overflowX": false,
"overflowY": true
},
"supportedFixes": [
"contain the rendered layout within 1440x900, then rerun visual-check"
]
}Expected behavior
A lifecycle that relies on the documented default canvas and passes deliver --quality showcase also passes visual-check containment at the desktop viewports. If the default cannot fit, validate or deliver says so before the browser check.
Actual behavior
Delivery passes 9/9 with no warnings, then visual-check fails at three of the four desktop viewports. The reader width never adapts: readerWidth stays at 1376 or 1440, so at 1440x900 the page is 1038px tall.
The canvas ratio alone decides the result. The same file with "viewBox": [1030, 660] added (same height, ratio 1.56) passes at all four viewports, and readerWidth adapts to 1210 at 1440x900.
Cause, as far as I can trace it on main:
archify/renderers/lifecycle/render-lifecycle.mjs:49falls back to[980, 660]whenmeta.viewBoxis absent, a width-to-height ratio of 1.485.viewer/reader-layout.js:15setsWIDE_RATIO = 1.55, andeligible()at line 40 requiresratio >= WIDE_RATIObefore the adaptive reader may narrow the page. Below that ratio the reader keeps its full width and the page overflows.archify/renderers/lifecycle/README.md:71documents[980, 660]as the default. NeitherSKILL.mdnorreferences/authoring-contract.mdsays that a lifecycle needs a wider canvas, so an author who omitsmeta.viewBoxlands here.
Relation to #324: PR #325 fixed the packaged lifecycle example by giving it an explicit viewBox: [1030, 630] and, as its description says, left renderer, schema, validator and Viewer behavior unchanged. The example passes now, but any lifecycle that relies on the default still fails. #356 and #468 discuss height budgets and viewBox guidance more generally.
Possible fixes, for the maintainers to weigh:
- Change the lifecycle default canvas to a ratio of at least 1.55, for example the example's
[1030, 630], and update the README row. - Let the adaptive reader engage for narrower diagrams when the page would otherwise overflow.
- At least have
validateanddeliverwarn when a lifecycle's resolved canvas ratio is belowWIDE_RATIO, so the failure does not first appear invisual-check.
Supporting visual evidence
Two light-theme captures at 1440x900 are attached at the end of this report, in this order:
- Before: the file above, with
meta.viewBoxomitted. The legend is cut off at the bottom edge of the viewport. - After: the same file with only
"viewBox": [1030, 660]added. The whole page fits and the reader width adapts.
The full visual-check JSON is available on request.
Environment
- Ubuntu 24.04 on WSL2 (Linux 6.18), Node.js v24.15.0
- Chrome for Testing 151.0.7922.34 (Playwright's build), set through
ARCHIFY_CHROME - Found while authoring with Claude Code (Claude Opus 5.5); the reproduction above does not depend on the client.
Final checks
- I searched existing issues for the same problem. #324 and #325 are the closest; see above.
- I removed access tokens, credentials, private repository contents, and personal or customer data.
Source: tt-a1i/archify