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): keep SVG quality profile aligned with compiler (#437)

Easternc3e15cc60c9a
diff --git a/archify.zip b/archify.zip
index 67e13d6a..eea25d54 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/renderers/shared/cli.mjs b/archify/renderers/shared/cli.mjs
index 32f66726..f4a6eed0 100644
--- a/archify/renderers/shared/cli.mjs
+++ b/archify/renderers/shared/cli.mjs
@@ -146,13 +146,13 @@ export function validateGuidedViews(diagramType, diagram) {
}
// Accessible name for the generated diagram SVG.
-export function svgRootAttrs(meta) {
+export function svgRootAttrs(meta, explicitQualityProfile) {
const animation = meta.animation === 'trace' ? ' data-animation="trace"' : '';
const preset = ` data-preset="${esc(meta.visual_preset || 'classic')}"`;
const engineeringProfile = meta.engineering_profile
? ` data-engineering-profile="${esc(meta.engineering_profile)}"`
: '';
- const requestedProfile = process.env.ARCHIFY_QUALITY_PROFILE || meta.quality_profile;
+ const requestedProfile = explicitQualityProfile || process.env.ARCHIFY_QUALITY_PROFILE || meta.quality_profile;
const qualityProfile = requestedProfile === 'showcase' ? 'showcase' : 'standard';
const advisory = requestedProfile ? '' : ' data-quality-gates="advisory"';
return `role="img" lang="${esc(resolveLocale(meta.locale))}" aria-labelledby="archify-diagram-title archify-diagram-description"${animation}${preset}${engineeringProfile} data-quality-profile="${esc(qualityProfile)}"${advisory}`;
diff --git a/archify/renderers/workflow/workflow-compiler.mjs b/archify/renderers/workflow/workflow-compiler.mjs
index 81ba79a1..a12348f9 100644
--- a/archify/renderers/workflow/workflow-compiler.mjs
+++ b/archify/renderers/workflow/workflow-compiler.mjs
@@ -4246,7 +4246,7 @@ function renderLegend() {
}
function renderSvg() {
- return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(workflow.meta, 'workflow diagram')}>
+ return ` <svg viewBox="0 0 ${viewBox[0]} ${viewBox[1]}" ${svgRootAttrs(workflow.meta, resolvedQualityProfile)}>
${svgAccessibleText(workflow.meta, 'workflow')}
${renderDefinitions()}
diff --git a/archify/test/workflow-compiler-hard-contract.test.mjs b/archify/test/workflow-compiler-hard-contract.test.mjs
index f8a7aeb8..4dc8e501 100644
--- a/archify/test/workflow-compiler-hard-contract.test.mjs
+++ b/archify/test/workflow-compiler-hard-contract.test.mjs
@@ -1820,6 +1820,7 @@ test('an explicit standard profile overrides an ambient showcase profile', () =>
true,
`the explicit standard profile must win:\n${JSON.stringify(result.diagnostics, null, 2)}`,
);
+ assert.match(result.svg, /data-quality-profile="standard"/);
} finally {
if (previousProfile === undefined) delete process.env.ARCHIFY_QUALITY_PROFILE;
else process.env.ARCHIFY_QUALITY_PROFILE = previousProfile;