Skip to content

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

fix(workflow): enforce stacked group containment

sunsunsun7a3074206ee6
diff --git a/archify.zip b/archify.zip
index 4d746906..7df7d98c 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/assets/template.html b/archify/assets/template.html
index 28c151c1..29bec4c0 100644
--- a/archify/assets/template.html
+++ b/archify/assets/template.html
@@ -10859,7 +10859,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10919,7 +10919,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index e56dd1bb..4907b39b 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -10970,7 +10970,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11030,7 +11030,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index 141719b5..60e55be7 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -10919,7 +10919,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10979,7 +10979,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index d3e2c1e3..46a581ea 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -10985,7 +10985,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11045,7 +11045,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index d6d45a50..a20e4a67 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -10934,7 +10934,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10994,7 +10994,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index 0fb6bb9a..b981e450 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -10976,7 +10976,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11036,7 +11036,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/archify/renderers/workflow/workflow-compiler.mjs b/archify/renderers/workflow/workflow-compiler.mjs
index 5ba9e3a1..8e4def38 100644
--- a/archify/renderers/workflow/workflow-compiler.mjs
+++ b/archify/renderers/workflow/workflow-compiler.mjs
@@ -74,6 +74,7 @@ const READABLE_CANDIDATE_COST_PRIORITY = Object.freeze([
const MAX_READABLE_LAYOUT_FEEDBACK_ROUNDS = 3;
const GROUP_FRAME_TOP_INSET = 8;
const GROUP_FRAME_BOTTOM_INSET = 4;
+const LEGACY_GROUP_FRAME_BOTTOM_INSET = 8;
const GROUP_LABEL_BASELINE_OFFSET = -2;
const GROUP_LABEL_MASK_ASCENT = 10;
const GROUP_LABEL_MASK_H = 14;
@@ -510,10 +511,15 @@ function createReadableLayout(workflow, layoutFeedback = {}) {
if (!authoredHeightLaneIds.has(lane.id)) return laneH;
const ownVerticalExtent = verticalExtent(lane.id);
const measuredHeight = 30 + Math.max(74, Math.ceil(ownVerticalExtent.maximum * 2 + 8));
- const height = Math.max(authoredLaneHeight(lane), measuredHeight);
- for (const contributor of ownVerticalExtent.contributors) heightContributors.add(contributor);
- if (authoredLaneHeight(lane) > measuredHeight) {
- heightContributors.add(`lane ${lane.id || lane.label} authored minimum height ${authoredLaneHeight(lane)}px`);
+ const authoredHeight = authoredLaneHeight(lane);
+ const height = Math.max(authoredHeight, measuredHeight);
+ if (measuredHeight > authoredHeight + 0.0001) {
+ for (const contributor of ownVerticalExtent.contributors) heightContributors.add(contributor);
+ } else if (authoredHeight > measuredHeight + 0.0001) {
+ heightContributors.add(`lane ${lane.id || lane.label} authored minimum height ${authoredHeight}px`);
+ } else if (height > 104) {
+ for (const contributor of ownVerticalExtent.contributors) heightContributors.add(contributor);
+ heightContributors.add(`lane ${lane.id || lane.label} authored minimum height ${authoredHeight}px`);
}
return height;
});
@@ -604,6 +610,17 @@ function compilerFailure(contract, diagnostics, error = diagnostics.map(({ messa
};
}
+function workflowSchemaSupportedFixes(diagnostic) {
+ const path = diagnostic?.subject?.path;
+ const limit = diagnostic?.evidence?.limit;
+ if (diagnostic?.code === 'schema/minimum'
+ && /^\/lanes\/\d+\/height$/.test(path || '')
+ && Number.isFinite(limit)) {
+ return [`set ${path} to at least ${limit}`];
+ }
+ return [];
+}
+
function workflowEdgeName(edge) {
return edge.id || `${edge.from}->${edge.to}`;
}
@@ -810,7 +827,7 @@ function compileWorkflowInternal({
inputDiagnostics = Array.isArray(error?.archifyDiagnostics)
? error.archifyDiagnostics.map((diagnostic) => ({
...diagnostic,
- supportedFixes: [],
+ supportedFixes: workflowSchemaSupportedFixes(diagnostic),
}))
: [{
code: 'workflow/input-contract',
@@ -915,9 +932,18 @@ function groupFrameHeight(group) {
return laneHeight(group.lane) - layout.laneTitleH
- GROUP_FRAME_TOP_INSET - GROUP_FRAME_BOTTOM_INSET;
}
- const lane = asArray(workflow.lanes)[laneIndex.get(group.lane)];
- const bottomInset = Number.isFinite(lane?.height) ? GROUP_FRAME_BOTTOM_INSET : 8;
- return laneHeight(group.lane) - layout.laneTitleH - GROUP_FRAME_TOP_INSET - bottomInset;
+ return laneHeight(group.lane) - layout.laneTitleH
+ - GROUP_FRAME_TOP_INSET - LEGACY_GROUP_FRAME_BOTTOM_INSET;
+}
+
+function groupFrameRect(group) {
+ const span = groupSpan(group);
+ return {
+ x: span.x,
+ y: laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET,
+ width: span.width,
+ height: groupFrameHeight(group),
+ };
}
function laneGroupHeaderH(idOrIndex) {
@@ -1020,15 +1046,12 @@ function workflowCompositionFrames() {
}
}
for (const [index, group] of asArray(workflow.groups).entries()) {
- const span = groupSpan(group);
+ const frame = groupFrameRect(group);
frames.push({
id: `group-${index}`,
label: group.label,
kind: 'group',
- x: span.x,
- y: laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET,
- width: span.width,
- height: groupFrameHeight(group),
+ ...frame,
radius: 9,
});
}
@@ -1066,13 +1089,12 @@ function workflowSceneLabelObstacles() {
if (!laneIndex.has(group.lane)
|| !Number.isInteger(group.fromCol) || !Number.isInteger(group.toCol)
|| group.fromCol < 0 || group.toCol >= layout.colXs.length || group.fromCol > group.toCol) continue;
- const span = groupSpan(group);
- const frameY = laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET;
- const labelBaseline = frameY + GROUP_LABEL_BASELINE_OFFSET;
+ const frame = groupFrameRect(group);
+ const labelBaseline = frame.y + GROUP_LABEL_BASELINE_OFFSET;
obstacles.push({
kind: 'group-label',
id: group.id ?? null,
- x: span.x + 10,
+ x: frame.x + 10,
y: labelBaseline - GROUP_LABEL_MASK_ASCENT,
width: textUnits(group.label) * 5.6,
height: GROUP_LABEL_MASK_H,
@@ -1104,6 +1126,72 @@ function nodeStep(node) {
}).ok);
}
+ function validateGroupFrameContainment() {
+ for (const group of asArray(workflow.groups)) {
+ const lanePosition = laneIndex.get(group.lane);
+ if (!Number.isInteger(lanePosition)
+ || !Number.isInteger(group.fromCol) || !Number.isInteger(group.toCol)
+ || group.fromCol < 0 || group.toCol >= layout.colXs.length
+ || group.fromCol > group.toCol) continue;
+ const lane = workflow.lanes[lanePosition];
+ const hasCustomLegacyHeight = Number.isFinite(lane?.height) && lane.height !== 104;
+ if (workflow.schema_version === 1 && !hasCustomLegacyHeight) continue;
+
+ const frame = groupFrameRect(group);
+ const violations = [...nodes.values()].flatMap((node) => {
+ if (node.lane !== group.lane || node.col < group.fromCol || node.col > group.toCol
+ || !isFinitePoint(node.x, node.y, node.width, node.height)) return [];
+ const topPx = Math.max(0, frame.y - node.y);
+ const bottomPx = Math.max(0, node.y + node.height - (frame.y + frame.height));
+ const maximumPx = Math.max(topPx, bottomPx);
+ return maximumPx > 0.0001 ? [{ node, topPx, bottomPx, maximumPx }] : [];
+ }).sort((left, right) => right.maximumPx - left.maximumPx
+ || stableCompare(left.node.id, right.node.id));
+ if (!violations.length) continue;
+
+ const violation = violations[0];
+ const currentHeight = laneHeight(lanePosition);
+ const candidateHeight = Math.max(
+ 104,
+ Math.ceil(currentHeight + violation.maximumPx * 2),
+ );
+ const sourceLaneIndex = sourceIndexes.lanes.get(lane) ?? lanePosition;
+ const supportedFixes = acceptsFix((document) => {
+ document.lanes[lanePosition].height = candidateHeight;
+ }) ? [`set /lanes/${sourceLaneIndex}/height to verified minimum ${candidateHeight}px`] : [];
+ const message = `Workflow node "${violation.node.id}" extends outside group "${group.id}" in lane "${lane.id}".`;
+ throwDiagnosticError(message, [{
+ code: 'workflow/group-containment',
+ severity: 'error',
+ message,
+ subject: {
+ diagramType: 'workflow',
+ lane: lane.id,
+ group: group.id,
+ node: violation.node.id,
+ path: `/lanes/${sourceLaneIndex}/height`,
+ },
+ evidence: {
+ groupRect: {
+ x: frame.x, y: frame.y, width: frame.width, height: frame.height,
+ },
+ nodeRect: {
+ x: violation.node.x,
+ y: violation.node.y,
+ width: violation.node.width,
+ height: violation.node.height,
+ },
+ overflow: {
+ topPx: violation.topPx,
+ bottomPx: violation.bottomPx,
+ },
+ authoredLaneHeightPx: authoredLaneHeight(lane),
+ },
+ supportedFixes,
+ }]);
+ }
+ }
+
function verifiedLegacyAlternative(edge, from, to, requiredClearance) {
const occupied = [...nodes.values()].filter((node) => node.lane === to.lane && node.id !== to.id);
const candidates = layout.colXs.map((center, col) => ({ center, col }))
@@ -2262,6 +2350,7 @@ function validateWorkflow() {
}
enforceLegacyColumnCapacity();
+ validateGroupFrameContainment();
const laneIds = new Set(workflow.lanes.map((lane) => lane.id));
if (laneIds.size !== workflow.lanes.length) {
@@ -4084,18 +4173,12 @@ function measuredContentBounds() {
for (const group of asArray(workflow.groups)) {
if (!laneIndex.has(group.lane) || !Number.isInteger(group.fromCol) || !Number.isInteger(group.toCol)
|| group.fromCol < 0 || group.toCol >= layout.colXs.length || group.fromCol > group.toCol) continue;
- const span = groupSpan(group);
- includeRect({
- x: span.x,
- y: laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET,
- width: span.width,
- height: groupFrameHeight(group),
- }, `group ${group.id}`);
+ const frame = groupFrameRect(group);
+ includeRect(frame, `group ${group.id}`);
if (workflow.schema_version === 2) {
- const frameY = laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET;
- const labelBaseline = frameY + GROUP_LABEL_BASELINE_OFFSET;
+ const labelBaseline = frame.y + GROUP_LABEL_BASELINE_OFFSET;
includeRect({
- x: span.x + 10,
+ x: frame.x + 10,
y: labelBaseline - GROUP_LABEL_MASK_ASCENT,
width: textUnits(group.label) * 5.6,
height: GROUP_LABEL_MASK_H,
@@ -4207,14 +4290,14 @@ function renderPhase(phase) {
}
function renderGroup(group, index) {
- const span = groupSpan(group);
- const y = laneTop(group.lane) + layout.laneTitleH + GROUP_FRAME_TOP_INSET;
- const height = groupFrameHeight(group);
+ const frame = groupFrameRect(group);
const cls = group.variant === 'security' ? 'c-security-group' : 'c-lane';
const textClass = variantAccent(group.variant);
- const labelY = workflow.schema_version === 2 ? y + GROUP_LABEL_BASELINE_OFFSET : y + 14;
- return ` <rect data-graph-role="structural-frame" data-composition-frame-kind="group" data-composition-frame-id="group-${index}" x="${span.x}" y="${y}" width="${span.width}" height="${height}" rx="9" class="${cls}" stroke-width="1"/>
- <text x="${span.x + 10}" y="${labelY}" class="${textClass}" font-size="7" font-weight="600">${esc(group.label)}</text>`;
+ const labelY = workflow.schema_version === 2
+ ? frame.y + GROUP_LABEL_BASELINE_OFFSET
+ : frame.y + 14;
+ return ` <rect data-graph-role="structural-frame" data-composition-frame-kind="group" data-composition-frame-id="group-${index}" x="${frame.x}" y="${frame.y}" width="${frame.width}" height="${frame.height}" rx="9" class="${cls}" stroke-width="1"/>
+ <text x="${frame.x + 10}" y="${labelY}" class="${textClass}" font-size="7" font-weight="600">${esc(group.label)}</text>`;
}
function renderNode(node) {
diff --git a/archify/test/adaptive-reader-layout.test.mjs b/archify/test/adaptive-reader-layout.test.mjs
index 6a8fa7a1..6e6aefc9 100644
--- a/archify/test/adaptive-reader-layout.test.mjs
+++ b/archify/test/adaptive-reader-layout.test.mjs
@@ -22,7 +22,7 @@ const reader = template.slice(
template.indexOf('Archify.view = (function ()'),
);
-test('wide desktop diagrams use one height-budgeted reader shell instead of breakpoint jumps', () => {
+test('desktop diagrams use one height-budgeted reader shell instead of breakpoint jumps', () => {
assert.match(template, /max-width: var\(--archify-reader-width, 1440px\)/);
assert.doesNotMatch(template, /@media \(min-width: 1680px\)[\s\S]{0,180}\.container/);
assert.doesNotMatch(template, /@media \(min-width: 1920px\)[\s\S]{0,180}\.container/);
@@ -30,6 +30,7 @@ test('wide desktop diagrams use one height-budgeted reader shell instead of brea
assert.match(reader, /var MAX_READER_WIDTH = 1920/);
assert.match(reader, /var availableSvgHeight = Math\.max\(1, window\.innerHeight - fixedHeight\)/);
assert.match(reader, /var desiredWidth = availableSvgHeight \* ratio \+ chrome\.diagramX/);
+ assert.match(reader, /var minWidth = Math\.min\(MIN_READER_WIDTH, sourceWidth, viewportCap\)/);
assert.match(reader, /html\.style\.setProperty\('--archify-reader-width', rounded \+ 'px'\)/);
});
@@ -55,6 +56,8 @@ test('desktop readability source floor is the inverse of the projected-size gate
});
test('adaptive width preserves canonical SVG geometry and yields to specialized viewer modes', () => {
+ assert.match(reader, /shell && diagram && svg && ratio > 0/);
+ assert.doesNotMatch(reader, /shell && diagram && svg && ratio >= WIDE_RATIO/);
assert.match(reader, /window\.innerWidth >= MIN_DESKTOP_WIDTH/);
assert.match(reader, /html\.getAttribute\('data-embed'\) !== 'true'/);
assert.match(reader, /html\.getAttribute\('data-present'\) !== 'true'/);
diff --git a/archify/test/desktop-reader-browser.test.mjs b/archify/test/desktop-reader-browser.test.mjs
index 867a7cb4..88b9a032 100644
--- a/archify/test/desktop-reader-browser.test.mjs
+++ b/archify/test/desktop-reader-browser.test.mjs
@@ -56,3 +56,51 @@ test('production showcase is readable in the real 1440 by 900 adaptive reader',
fs.rmSync(tmp, { recursive: true, force: true });
}
});
+
+test('a tall stacked workflow stays in the first desktop screen without shrinking below its SVG width', {
+ skip: chromePath ? false : 'Set ARCHIFY_CHROME to run the real browser regression.',
+}, async () => {
+ const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'archify-stacked-reader-'));
+ const input = path.join(tmp, 'stacked.workflow.json');
+ const artifact = path.join(tmp, 'stacked.html');
+ try {
+ fs.writeFileSync(input, JSON.stringify({
+ schema_version: 2,
+ diagram_type: 'workflow',
+ meta: { title: 'Stacked stages', legend: { mode: 'hidden' } },
+ lanes: [{ id: 'cage', label: 'One cage', height: 104 }],
+ groups: [{
+ id: 'group', label: 'Cage', lane: 'cage', fromCol: 1, toCol: 3, variant: 'security',
+ }],
+ nodes: [0, 90, 180].map((yOffset, index) => ({
+ id: `stage-${index}`,
+ lane: 'cage',
+ col: 2,
+ type: 'security',
+ label: `Stage ${index + 1}`,
+ yOffset,
+ })),
+ edges: [],
+ }));
+ execFileSync(process.execPath, [
+ path.join(skillRoot, 'bin', 'archify.mjs'),
+ 'render',
+ 'workflow',
+ input,
+ artifact,
+ ], { cwd: skillRoot, encoding: 'utf8' });
+
+ const result = await runVisualCheck({ artifactPath: artifact, chromePath });
+ assert.equal(result.exitCode, 0, JSON.stringify(result.receipt, null, 2));
+ const desktop = result.receipt.containment.viewports.find(({ width, height }) => (
+ width === DESKTOP_READABILITY_VIEWPORT.width
+ && height === DESKTOP_READABILITY_VIEWPORT.height
+ ));
+ assert.ok(desktop, JSON.stringify(result.receipt, null, 2));
+ assert.ok(desktop.diagramWidth >= 768, JSON.stringify(desktop));
+ assert.ok(desktop.scrollHeight <= desktop.innerHeight, JSON.stringify(desktop));
+ assert.equal(desktop.readabilityOk, true, JSON.stringify(desktop));
+ } finally {
+ fs.rmSync(tmp, { recursive: true, force: true });
+ }
+});
diff --git a/archify/test/workflow-compiler.test.mjs b/archify/test/workflow-compiler.test.mjs
index 3138914b..f60c81c0 100644
--- a/archify/test/workflow-compiler.test.mjs
+++ b/archify/test/workflow-compiler.test.mjs
@@ -229,6 +229,53 @@ function adjacentWorkflow({
return workflow;
}
+function stackedGroupWorkflow({
+ schemaVersion = 1,
+ laneHeight,
+ offsets = [0, 90, 180],
+ includeWorkerLane = false,
+} = {}) {
+ return {
+ schema_version: schemaVersion,
+ diagram_type: 'workflow',
+ meta: {
+ title: 'Stacked cage',
+ legend: { mode: 'hidden' },
+ ...(schemaVersion === 1 ? { viewBox: [720, 640] } : {}),
+ },
+ lanes: [
+ {
+ id: 'cage',
+ label: 'One cage',
+ ...(laneHeight === undefined ? {} : { height: laneHeight }),
+ },
+ ...(includeWorkerLane ? [{ id: 'worker', label: 'Worker' }] : []),
+ ],
+ groups: [{
+ id: 'group',
+ label: 'Cage',
+ lane: 'cage',
+ fromCol: 1,
+ toCol: 3,
+ variant: 'security',
+ }],
+ nodes: [
+ ...offsets.map((yOffset, index) => ({
+ id: String.fromCharCode('a'.charCodeAt(0) + index),
+ lane: 'cage',
+ col: 2,
+ type: 'security',
+ label: `Stage ${String.fromCharCode('A'.charCodeAt(0) + index)}`,
+ yOffset,
+ })),
+ ...(includeWorkerLane ? [{
+ id: 'worker', lane: 'worker', col: 2, type: 'backend', label: 'Worker',
+ }] : []),
+ ],
+ edges: [],
+ };
+}
+
function assertReadableAdjacentResult(result, { label, widths = [92, 92] } = {}) {
assert.equal(result.receipt.contract, 'readable-v2');
assert.deepEqual(result.receipt.viewBox, svgViewBox(result.svg).slice(2));
@@ -321,58 +368,74 @@ test('fixed-v1 keeps valid phase and group spans independent of label measuremen
);
});
-test('issue #250: an explicit v1 lane height contains vertically stacked group stages', () => {
- const workflow = {
- schema_version: 1,
- diagram_type: 'workflow',
- meta: { title: 'Stacked cage', viewBox: [720, 640], legend: { mode: 'hidden' } },
- lanes: [{ id: 'cage', label: 'One cage', height: 450 }],
- groups: [{ id: 'group', label: 'Cage', lane: 'cage', fromCol: 1, toCol: 3, variant: 'security' }],
- nodes: [
- { id: 'a', lane: 'cage', col: 2, type: 'security', label: 'Stage A', yOffset: 0 },
- { id: 'b', lane: 'cage', col: 2, type: 'security', label: 'Stage B', yOffset: 90 },
- { id: 'c', lane: 'cage', col: 2, type: 'security', label: 'Stage C', yOffset: 180 },
- ],
- edges: [
- { id: 'a-b', from: 'a', to: 'b', fromSide: 'bottom', toSide: 'top' },
- { id: 'b-c', from: 'b', to: 'c', fromSide: 'bottom', toSide: 'top' },
- ],
- };
+test('fixed-v1 treats an explicit default lane height exactly like the omitted default', () => {
+ const omitted = stackedGroupWorkflow({ offsets: [0] });
+ const explicit = clone(omitted);
+ explicit.lanes[0].height = 104;
- const result = compileSuccessfully(workflow);
- assert.equal(result.receipt.contract, 'fixed-v1');
- const group = groupFrameRect(result.svg);
- assert.equal(laneFrameRect(result.svg).height, 450);
- for (const id of ['a', 'b', 'c']) assertRectInsideRect(nodeRect(result.svg, id), group, `stacked node ${id}`);
+ const omittedResult = compileSuccessfully(omitted);
+ const explicitResult = compileSuccessfully(explicit);
+ assert.equal(explicitResult.svg, omittedResult.svg);
+ assert.deepEqual(explicitResult.receipt, omittedResult.receipt);
+ assert.equal(groupFrameRect(explicitResult.svg).height, 58);
});
+for (const { name, offsets } of [
+ { name: 'bottom', offsets: [0, 90, 180] },
+ { name: 'top', offsets: [-180, -90, 0] },
+]) {
+ test(`issue #250: fixed-v1 rejects a custom lane height that lets a node escape the group ${name}`, () => {
+ const result = compileWorkflow({
+ workflow: stackedGroupWorkflow({ laneHeight: 442, offsets }),
+ });
+
+ assert.equal(result.ok, false);
+ assert.equal(result.svg, undefined);
+ assert.equal(result.diagnostics.length, 1, JSON.stringify(result.diagnostics, null, 2));
+ const [diagnostic] = result.diagnostics;
+ assert.equal(diagnostic.code, 'workflow/group-containment');
+ assert.equal(diagnostic.subject.path, '/lanes/0/height');
+ assert.equal(diagnostic.subject.group, 'group');
+ assert.equal(diagnostic.evidence.authoredLaneHeightPx, 442);
+ assert.ok(
+ diagnostic.evidence.overflow.topPx > 0 || diagnostic.evidence.overflow.bottomPx > 0,
+ JSON.stringify(diagnostic.evidence, null, 2),
+ );
+ assert.deepEqual(diagnostic.supportedFixes, [
+ 'set /lanes/0/height to verified minimum 458px',
+ ]);
+ });
+
+ test(`issue #250: fixed-v1 exact-fit height contains a vertical stack at the group ${name}`, () => {
+ const result = compileSuccessfully(stackedGroupWorkflow({ laneHeight: 458, offsets }));
+ assert.equal(result.receipt.contract, 'fixed-v1');
+ const group = groupFrameRect(result.svg);
+ assert.equal(laneFrameRect(result.svg).height, 458);
+ for (const id of ['a', 'b', 'c']) {
+ assertRectInsideRect(nodeRect(result.svg, id), group, `stacked node ${id}`);
+ }
+ });
+}
+
test('issue #250: readable-v2 expands only the lane containing a vertical stack', () => {
- const workflow = {
- schema_version: 2,
- diagram_type: 'workflow',
- meta: { title: 'Per-lane stacked cage', legend: { mode: 'hidden' } },
- lanes: [
- { id: 'cage', label: 'One cage', height: 500 },
- { id: 'worker', label: 'Worker' },
- ],
- groups: [{ id: 'group', label: 'Cage', lane: 'cage', fromCol: 1, toCol: 3, variant: 'security' }],
- nodes: [
- { id: 'a', lane: 'cage', col: 2, type: 'security', label: 'Stage A', yOffset: 0 },
- { id: 'b', lane: 'cage', col: 2, type: 'security', label: 'Stage B', yOffset: 90 },
- { id: 'c', lane: 'cage', col: 2, type: 'security', label: 'Stage C', yOffset: 180 },
- { id: 'worker', lane: 'worker', col: 2, type: 'backend', label: 'Worker' },
- ],
- edges: [],
- };
+ const workflow = stackedGroupWorkflow({
+ schemaVersion: 2,
+ laneHeight: 104,
+ includeWorkerLane: true,
+ });
const result = compileSuccessfully(workflow);
assert.equal(result.receipt.contract, 'readable-v2');
const cage = laneFrameRect(result.svg, 0);
const worker = laneFrameRect(result.svg, 1);
- assert.equal(cage.height, 500, 'authored minimum height must control the stacked lane');
+ assert.ok(cage.height > 104, 'the vertical stack must auto-grow its lane beyond the authored minimum');
assert.equal(worker.height, 104, 'unrelated lane must keep the baseline height');
const group = groupFrameRect(result.svg);
- for (const id of ['a', 'b', 'c']) assertRectInsideRect(nodeRect(result.svg, id), group, `stacked node ${id}`);
+ for (const id of ['a', 'b', 'c']) {
+ const node = nodeRect(result.svg, id);
+ assertRectInsideRect(node, group, `stacked node ${id}`);
+ assertRectInsideViewBox(node, svgViewBox(result.svg), `stacked node ${id}`);
+ }
});
test('workflow lane.height is schema-validated as a 104px minimum', () => {
@@ -381,6 +444,9 @@ test('workflow lane.height is schema-validated as a 104px minimum', () => {
const result = compileWorkflow({ workflow });
assert.equal(result.ok, false);
assert.match(result.error, /lanes\/0\/height/);
+ assert.deepEqual(result.diagnostics[0].supportedFixes, [
+ 'set /lanes/0/height to at least 104',
+ ]);
});
test('fixed-v1 reports one causal column-capacity diagnostic for issue #126', () => {
@@ -824,6 +890,41 @@ test('explicit viewBox height capacity names the authored tall node without nami
);
});
+test('explicit viewBox height capacity names a causal lane minimum without blaming its ordinary node', () => {
+ const result = compileWorkflow({
+ workflow: {
+ schema_version: 2,
+ diagram_type: 'workflow',
+ meta: {
+ title: 'Authored lane height capacity',
+ legend: { mode: 'hidden' },
+ viewBox: [1200, 280],
+ },
+ lanes: [{ id: 'main', label: 'Main', height: 500 }],
+ nodes: [{
+ id: 'ordinary', lane: 'main', col: 0, type: 'backend', label: 'Ordinary',
+ }],
+ edges: [],
+ },
+ qualityProfile: 'showcase',
+ });
+
+ assert.equal(result.ok, false);
+ const diagnostic = result.diagnostics.find(({ code }) => code === 'workflow/viewbox-capacity');
+ assert.ok(diagnostic, JSON.stringify(result.diagnostics, null, 2));
+ assert.ok(
+ diagnostic.evidence.contributors.includes('lane main authored minimum height 500px'),
+ JSON.stringify(diagnostic.evidence.contributors),
+ );
+ assert.equal(
+ diagnostic.evidence.contributors.some((contributor) => (
+ /node ordinary\b/i.test(contributor) && /height 52px/i.test(contributor)
+ )),
+ false,
+ `an ordinary node is not causal for the 500px lane: ${JSON.stringify(diagnostic.evidence.contributors)}`,
+ );
+});
+
test('readable-v2 measures asymmetric custom widths and CJK edge labels', () => {
const cases = [
{ widths: [32, 92], label: '同步', nodeLabels: ['甲', '乙'] },
diff --git a/docs/assets/archify-live-proof.gif b/docs/assets/archify-live-proof.gif
index c4482fde..054758c0 100644
Binary files a/docs/assets/archify-live-proof.gif and b/docs/assets/archify-live-proof.gif differ
diff --git a/docs/assets/archify-live-proof.json b/docs/assets/archify-live-proof.json
index 9239205b..366ca1c6 100644
--- a/docs/assets/archify-live-proof.json
+++ b/docs/assets/archify-live-proof.json
@@ -7,13 +7,13 @@
"fps": 10,
"frameCount": 54,
"durationSeconds": 5.4,
- "bytes": 1542193,
- "sha256": "e0fe704e5d230c0478bc5a48b7668815b5790eed496da87ce7a5f8e5b2416c28",
+ "bytes": 1720151,
+ "sha256": "1f1e9d1f9ab4dcdb165f63198864b46596ca0b432ddf5b01a3b69517754ca0cc",
"scenes": [
{
"id": "signal-flow",
"artifact": "docs/gallery/artifacts/agent-tool-call.workflow.html",
- "artifactSha256": "e083cfe2d35701472374910e922ebdf8b30fdd3d5547d0e2cabd05094d033c66",
+ "artifactSha256": "62cba5873a30e131d0407c6ac3761ab07c5e33bf1190acfa7ec095b02c7c9db8",
"view": "happy-path",
"eyebrow": "WORKFLOW · SIGNAL FLOW",
"title": "Agent Tool Call",
@@ -22,7 +22,7 @@
{
"id": "blueprint",
"artifact": "docs/gallery/artifacts/production-deployment.architecture.html",
- "artifactSha256": "dbf6d1b3cffa610f2e538cca3b9aa1c65eb45f580154f316d97c157d90916faa",
+ "artifactSha256": "4fe21218427901b98c3d5fdf3e02f46b0d661f706fe0a4d2d204f773bfcc74b1",
"view": "request-boundary",
"eyebrow": "ARCHITECTURE · BLUEPRINT",
"title": "Production Deployment",
@@ -31,7 +31,7 @@
{
"id": "classic",
"artifact": "docs/gallery/artifacts/cache-miss.sequence.html",
- "artifactSha256": "6bf688c8577049973ace979ac73292eda0cc8f349934c6ba4452720853ced84c",
+ "artifactSha256": "462036eee61a4dc7bc622afc22038e93738f55c2a47c04f7f50e1863d7c684d9",
"view": "cache-fallback",
"eyebrow": "SEQUENCE · CLASSIC",
"title": "Cache Miss Request",
diff --git a/docs/gallery.html b/docs/gallery.html
index 7c2e6aa3..b9972501 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -298,7 +298,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="e083cfe2d35701472374910e922ebdf8b30fdd3d5547d0e2cabd05094d033c66">e083cfe2d357</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="62cba5873a30e131d0407c6ac3761ab07c5e33bf1190acfa7ec095b02c7c9db8">62cba5873a30</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html?present=1&amp;play=1#view=happy-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -328,7 +328,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="dbf6d1b3cffa610f2e538cca3b9aa1c65eb45f580154f316d97c157d90916faa">dbf6d1b3cffa</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="4fe21218427901b98c3d5fdf3e02f46b0d661f706fe0a4d2d204f773bfcc74b1">4fe212184279</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html?present=1&amp;play=1#view=request-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -357,7 +357,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="6bf688c8577049973ace979ac73292eda0cc8f349934c6ba4452720853ced84c">6bf688c85770</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="462036eee61a4dc7bc622afc22038e93738f55c2a47c04f7f50e1863d7c684d9">462036eee61a</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html?present=1&amp;play=1#view=cache-fallback" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -386,7 +386,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="358289f1aee93c3bf1075ce95372325ea415c0178f76ce62c868bdc3683cc5f4">358289f1aee9</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5097a37523223246afd0efb3006424fd28449ae78d3fe3e7095b35a8307aa694">5097a3752322</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html?present=1&amp;play=1#view=approval-to-production" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -415,7 +415,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d50feba56cbba1bf62a19b45f142bc1f964bf6831730a79d2760aadcf106542a">d50feba56cbb</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9b0a84d190e2fb328db39e7c1ac17b0a7be5e0172ff51091a4e0e37a55af9d9e">9b0a84d190e2</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html?present=1&amp;play=1#view=mitigate-and-verify" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -444,7 +444,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d66d70595448044a92d032738e2437980d2160462f974a1de8cfa82c5e148d54">d66d70595448</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ae8cf9c105d065b89e5276d43ab9a8d695e745bf1ec374f8313339f6ab41398f">ae8cf9c105d0</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html?present=1&amp;play=1#view=consent-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -473,7 +473,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c4d7cb0eaecfeff4d713b8f3b36b916840d6530f08e9b698ded308effd3ff59b">c4d7cb0eaecf</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="ea5bea440e2e548f816f9fc10462ebc2100206ebb0205b47354a54973c698082">ea5bea440e2e</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html?present=1&amp;play=1#view=work-and-retry" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -502,7 +502,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="cab32bd06250fdc18f7d25e7562407af9b2e2a37f9ca65c6a852716f7faf1892">cab32bd06250</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="21161a483d44d4c15412801bdaa9e5b94703ba128a299c338278894070f9201b">21161a483d44</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html?present=1&amp;play=1#view=order-transit" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -531,7 +531,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d15306112803fe6ac1050c6fd5d943545a5bc6a72a0407cd0751d0d8794f6429">d15306112803</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="f93704ccc7942c3c28f22e97b1851c0013b2067f487f08720660107fa9a5e7d9">f93704ccc794</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html?present=1&amp;play=1#view=main-lifecycle" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -560,7 +560,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2b41af0f84ff5cdbe21f0d672d1d9825eab246b3e7fbaa0237c49042bf28547d">2b41af0f84ff</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="10ec812d3cefcfbd1785220ac100760db19fbcbb17e251c18df4504d9ce7eae9">10ec812d3cef</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html?present=1&amp;play=1#view=rollback-outcomes" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -589,7 +589,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="26784b847623e79727e44eb5fabfbedc2c47289bf877703eee78787a3eb5bee5">26784b847623</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="3c819aed6f26477e51b4d2d453d4d8f82c7c430b3bed9289c0937914ec440242">3c819aed6f26</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html?present=1&amp;play=1#view=request-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -675,8 +675,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 723038,
- "artifactSha256": "e083cfe2d35701472374910e922ebdf8b30fdd3d5547d0e2cabd05094d033c66",
+ "artifactBytes": 723170,
+ "artifactSha256": "62cba5873a30e131d0407c6ac3761ab07c5e33bf1190acfa7ec095b02c7c9db8",
"sourceBytes": 5687,
"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c",
"checks": [
@@ -775,8 +775,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 724872,
- "artifactSha256": "dbf6d1b3cffa610f2e538cca3b9aa1c65eb45f580154f316d97c157d90916faa",
+ "artifactBytes": 725004,
+ "artifactSha256": "4fe21218427901b98c3d5fdf3e02f46b0d661f706fe0a4d2d204f773bfcc74b1",
"sourceBytes": 5476,
"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
@@ -875,8 +875,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 716842,
- "artifactSha256": "6bf688c8577049973ace979ac73292eda0cc8f349934c6ba4452720853ced84c",
+ "artifactBytes": 716974,
+ "artifactSha256": "462036eee61a4dc7bc622afc22038e93738f55c2a47c04f7f50e1863d7c684d9",
"sourceBytes": 4345,
"sourceSha256": "4bbaa6ca3cd4036002fd5d0f3a332eb922cec69d09bac3d7925f95beb4308389",
"checks": [
@@ -975,8 +975,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 719238,
- "artifactSha256": "358289f1aee93c3bf1075ce95372325ea415c0178f76ce62c868bdc3683cc5f4",
+ "artifactBytes": 719370,
+ "artifactSha256": "5097a37523223246afd0efb3006424fd28449ae78d3fe3e7095b35a8307aa694",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -1075,8 +1075,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 716567,
- "artifactSha256": "d50feba56cbba1bf62a19b45f142bc1f964bf6831730a79d2760aadcf106542a",
+ "artifactBytes": 716699,
+ "artifactSha256": "9b0a84d190e2fb328db39e7c1ac17b0a7be5e0172ff51091a4e0e37a55af9d9e",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -1175,8 +1175,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 720496,
- "artifactSha256": "d66d70595448044a92d032738e2437980d2160462f974a1de8cfa82c5e148d54",
+ "artifactBytes": 720628,
+ "artifactSha256": "ae8cf9c105d065b89e5276d43ab9a8d695e745bf1ec374f8313339f6ab41398f",
"sourceBytes": 5627,
"sourceSha256": "6fa38a7ccedf96da592d60b392783b846188eaa3ec9136c6dc06ca020e43a110",
"checks": [
@@ -1275,8 +1275,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 717252,
- "artifactSha256": "c4d7cb0eaecfeff4d713b8f3b36b916840d6530f08e9b698ded308effd3ff59b",
+ "artifactBytes": 717384,
+ "artifactSha256": "ea5bea440e2e548f816f9fc10462ebc2100206ebb0205b47354a54973c698082",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -1375,8 +1375,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 724459,
- "artifactSha256": "cab32bd06250fdc18f7d25e7562407af9b2e2a37f9ca65c6a852716f7faf1892",
+ "artifactBytes": 724591,
+ "artifactSha256": "21161a483d44d4c15412801bdaa9e5b94703ba128a299c338278894070f9201b",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -1475,8 +1475,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 714131,
- "artifactSha256": "d15306112803fe6ac1050c6fd5d943545a5bc6a72a0407cd0751d0d8794f6429",
+ "artifactBytes": 714263,
+ "artifactSha256": "f93704ccc7942c3c28f22e97b1851c0013b2067f487f08720660107fa9a5e7d9",
"sourceBytes": 4417,
"sourceSha256": "af939579dcafc8b4c49f09594591577994398aee57a57369d4c791dfc0d85a42",
"checks": [
@@ -1575,8 +1575,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 715123,
- "artifactSha256": "2b41af0f84ff5cdbe21f0d672d1d9825eab246b3e7fbaa0237c49042bf28547d",
+ "artifactBytes": 715255,
+ "artifactSha256": "10ec812d3cefcfbd1785220ac100760db19fbcbb17e251c18df4504d9ce7eae9",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -1675,8 +1675,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 715216,
- "artifactSha256": "26784b847623e79727e44eb5fabfbedc2c47289bf877703eee78787a3eb5bee5",
+ "artifactBytes": 715348,
+ "artifactSha256": "3c819aed6f26477e51b4d2d453d4d8f82c7c430b3bed9289c0937914ec440242",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index 141719b5..60e55be7 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -10919,7 +10919,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10979,7 +10979,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index 0fb6bb9a..b981e450 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -10976,7 +10976,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11036,7 +11036,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index 6fe7fb58..cb34a704 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -10997,7 +10997,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11057,7 +11057,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index d3e2c1e3..46a581ea 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -10985,7 +10985,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11045,7 +11045,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index c9ce3189..33b00f33 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -10931,7 +10931,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10991,7 +10991,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index b5ef2a6e..849b007d 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -11009,7 +11009,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11069,7 +11069,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index 0215d14a..abd7e157 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -10936,7 +10936,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10996,7 +10996,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index e56dd1bb..4907b39b 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -10970,7 +10970,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11030,7 +11030,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index 1401b6d6..f4245219 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -11001,7 +11001,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11061,7 +11061,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index 83c0fbf7..7c594cb9 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -10962,7 +10962,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11022,7 +11022,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index d6d45a50..a20e4a67 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -10934,7 +10934,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10994,7 +10994,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index d75d682f..834381fe 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -27,8 +27,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 723038,
- "artifactSha256": "e083cfe2d35701472374910e922ebdf8b30fdd3d5547d0e2cabd05094d033c66",
+ "artifactBytes": 723170,
+ "artifactSha256": "62cba5873a30e131d0407c6ac3761ab07c5e33bf1190acfa7ec095b02c7c9db8",
"sourceBytes": 5687,
"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c",
"checks": [
@@ -127,8 +127,8 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 724872,
- "artifactSha256": "dbf6d1b3cffa610f2e538cca3b9aa1c65eb45f580154f316d97c157d90916faa",
+ "artifactBytes": 725004,
+ "artifactSha256": "4fe21218427901b98c3d5fdf3e02f46b0d661f706fe0a4d2d204f773bfcc74b1",
"sourceBytes": 5476,
"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
@@ -227,8 +227,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 716842,
- "artifactSha256": "6bf688c8577049973ace979ac73292eda0cc8f349934c6ba4452720853ced84c",
+ "artifactBytes": 716974,
+ "artifactSha256": "462036eee61a4dc7bc622afc22038e93738f55c2a47c04f7f50e1863d7c684d9",
"sourceBytes": 4345,
"sourceSha256": "4bbaa6ca3cd4036002fd5d0f3a332eb922cec69d09bac3d7925f95beb4308389",
"checks": [
@@ -327,8 +327,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 719238,
- "artifactSha256": "358289f1aee93c3bf1075ce95372325ea415c0178f76ce62c868bdc3683cc5f4",
+ "artifactBytes": 719370,
+ "artifactSha256": "5097a37523223246afd0efb3006424fd28449ae78d3fe3e7095b35a8307aa694",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -427,8 +427,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 716567,
- "artifactSha256": "d50feba56cbba1bf62a19b45f142bc1f964bf6831730a79d2760aadcf106542a",
+ "artifactBytes": 716699,
+ "artifactSha256": "9b0a84d190e2fb328db39e7c1ac17b0a7be5e0172ff51091a4e0e37a55af9d9e",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -527,8 +527,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 720496,
- "artifactSha256": "d66d70595448044a92d032738e2437980d2160462f974a1de8cfa82c5e148d54",
+ "artifactBytes": 720628,
+ "artifactSha256": "ae8cf9c105d065b89e5276d43ab9a8d695e745bf1ec374f8313339f6ab41398f",
"sourceBytes": 5627,
"sourceSha256": "6fa38a7ccedf96da592d60b392783b846188eaa3ec9136c6dc06ca020e43a110",
"checks": [
@@ -627,8 +627,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 717252,
- "artifactSha256": "c4d7cb0eaecfeff4d713b8f3b36b916840d6530f08e9b698ded308effd3ff59b",
+ "artifactBytes": 717384,
+ "artifactSha256": "ea5bea440e2e548f816f9fc10462ebc2100206ebb0205b47354a54973c698082",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -727,8 +727,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 724459,
- "artifactSha256": "cab32bd06250fdc18f7d25e7562407af9b2e2a37f9ca65c6a852716f7faf1892",
+ "artifactBytes": 724591,
+ "artifactSha256": "21161a483d44d4c15412801bdaa9e5b94703ba128a299c338278894070f9201b",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -827,8 +827,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 714131,
- "artifactSha256": "d15306112803fe6ac1050c6fd5d943545a5bc6a72a0407cd0751d0d8794f6429",
+ "artifactBytes": 714263,
+ "artifactSha256": "f93704ccc7942c3c28f22e97b1851c0013b2067f487f08720660107fa9a5e7d9",
"sourceBytes": 4417,
"sourceSha256": "af939579dcafc8b4c49f09594591577994398aee57a57369d4c791dfc0d85a42",
"checks": [
@@ -927,8 +927,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 715123,
- "artifactSha256": "2b41af0f84ff5cdbe21f0d672d1d9825eab246b3e7fbaa0237c49042bf28547d",
+ "artifactBytes": 715255,
+ "artifactSha256": "10ec812d3cefcfbd1785220ac100760db19fbcbb17e251c18df4504d9ce7eae9",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -1027,8 +1027,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 715216,
- "artifactSha256": "26784b847623e79727e44eb5fabfbedc2c47289bf877703eee78787a3eb5bee5",
+ "artifactBytes": 715348,
+ "artifactSha256": "3c819aed6f26477e51b4d2d453d4d8f82c7c430b3bed9289c0937914ec440242",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
diff --git a/examples/checkout-platform-delta.html b/examples/checkout-platform-delta.html
index 7e28ead9..45824907 100644
--- a/examples/checkout-platform-delta.html
+++ b/examples/checkout-platform-delta.html
@@ -15693,7 +15693,7 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
}
function eligible() {
return Boolean(
- shell &amp;&amp; diagram &amp;&amp; svg &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp;
+ shell &amp;&amp; diagram &amp;&amp; svg &amp;&amp; ratio &gt; 0 &amp;&amp;
window.innerWidth &gt;= MIN_DESKTOP_WIDTH &amp;&amp;
html.getAttribute(&#39;data-embed&#39;) !== &#39;true&#39; &amp;&amp;
html.getAttribute(&#39;data-present&#39;) !== &#39;true&#39; &amp;&amp;
@@ -15753,7 +15753,10 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox &amp;&amp; viewBox.width &gt; 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
@@ -30773,7 +30776,7 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
}
function eligible() {
return Boolean(
- shell &amp;&amp; diagram &amp;&amp; svg &amp;&amp; ratio &gt;= WIDE_RATIO &amp;&amp;
+ shell &amp;&amp; diagram &amp;&amp; svg &amp;&amp; ratio &gt; 0 &amp;&amp;
window.innerWidth &gt;= MIN_DESKTOP_WIDTH &amp;&amp;
html.getAttribute(&#39;data-embed&#39;) !== &#39;true&#39; &amp;&amp;
html.getAttribute(&#39;data-present&#39;) !== &#39;true&#39; &amp;&amp;
@@ -30833,7 +30836,10 @@ html[data-theme="dark"] body{background:#071019!important;background-image:none!
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox &amp;&amp; viewBox.width &gt; 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/checkout-platform-delta.receipt.json b/examples/checkout-platform-delta.receipt.json
index 1e37e685..1e46fde1 100644
--- a/examples/checkout-platform-delta.receipt.json
+++ b/examples/checkout-platform-delta.receipt.json
@@ -219,8 +219,8 @@
"Boundary identity is conservatively derived from kind + label."
],
"artifact": {
- "sha256": "b509920b635dc816d7b0f9848bec5bbbf0b77a049ccb50225afbd1dae7a62e39",
- "bytes": 2023841
+ "sha256": "16e997f6039faecc263015bd78dd247f06fb1b580dc9e94f952ddde02832c8c6",
+ "bytes": 2024127
},
"validation": {
"checksPassed": 28,
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index e56dd1bb..4907b39b 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -10970,7 +10970,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11030,7 +11030,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index 141719b5..60e55be7 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -10919,7 +10919,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10979,7 +10979,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index d3e2c1e3..46a581ea 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -10985,7 +10985,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11045,7 +11045,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index d6d45a50..a20e4a67 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -10934,7 +10934,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10994,7 +10994,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/web-app.html b/examples/web-app.html
index d6d45a50..a20e4a67 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -10934,7 +10934,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -10994,7 +10994,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index 0fb6bb9a..b981e450 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -10976,7 +10976,7 @@
}
function eligible() {
return Boolean(
- shell && diagram && svg && ratio >= WIDE_RATIO &&
+ shell && diagram && svg && ratio > 0 &&
window.innerWidth >= MIN_DESKTOP_WIDTH &&
html.getAttribute('data-embed') !== 'true' &&
html.getAttribute('data-present') !== 'true' &&
@@ -11036,7 +11036,10 @@
}
var chrome = chromeMetrics();
var viewportCap = Math.max(0, window.innerWidth - chrome.bodyX);
- var minWidth = Math.min(MIN_READER_WIDTH, viewportCap);
+ var sourceWidth = viewBox && viewBox.width > 0
+ ? viewBox.width + chrome.diagramX
+ : MIN_READER_WIDTH;
+ var minWidth = Math.min(MIN_READER_WIDTH, sourceWidth, viewportCap);
var maxWidth = Math.min(MAX_READER_WIDTH, viewportCap);
var fixedHeight = chrome.bodyY + chrome.diagramY + SAFE_BOTTOM_GAP +
outerHeight(header) + outerHeight(guided) + outerHeight(cards);