Skip to content

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

Fall back to English controls for non-Chinese pages; title steps with node labels

tt-a1if6ad7dc73161
diff --git a/archify/explainer/reader.js b/archify/explainer/reader.js
index ced7b365..8e47f5b7 100644
--- a/archify/explainer/reader.js
+++ b/archify/explainer/reader.js
@@ -5,7 +5,7 @@
const prepared = read('archify-explainer-prepared');
const diagrams = prepared.preparedDiagrams.diagrams || prepared.preparedDiagrams;
const words = read('explainer-reader-words');
- const english = root.lang.startsWith('en');
+ const english = !root.lang.startsWith('zh');
const say = (en,zh) => english ? en : zh;
const byId = id => document.getElementById(id);
const all = (selector, within = document) => [...within.querySelectorAll(selector)];
diff --git a/archify/references/explainer-authoring.md b/archify/references/explainer-authoring.md
index f7a7b1b1..2f6eebeb 100644
--- a/archify/references/explainer-authoring.md
+++ b/archify/references/explainer-authoring.md
@@ -79,7 +79,7 @@ A diagram replaces the paragraph that would describe it. When the answer involve
| A change to code | `@diff` or a ```` ```diff ```` fence |
| A command, config or code that does not exist yet | Plain fence |
-Steps that walk through a diagram belong in the diagram's panel: the page reads them beside it, each step lighting its part, and the reader can step through them.
+Steps that walk through a diagram belong in the diagram's panel: the page reads them beside it, each step lighting its part, and the reader can step through them. Title each step with the label of the node it points at, so the text and the diagram match at a glance; the detail column says what to do there.
A small answer gets a small page: the conclusion plus one or two panels. A how-it-works, diagnosis or checklist question usually needs three to five.
diff --git a/test/explainer-renderer.test.mjs b/test/explainer-renderer.test.mjs
index f4dc9840..12002015 100644
--- a/test/explainer-renderer.test.mjs
+++ b/test/explainer-renderer.test.mjs
@@ -150,6 +150,14 @@ test('renderer: over-limit metrics disclose the excess and limit-only metrics im
assert.equal(text(all(find(tree,'capacity-only'),node=>attr(node,'class') === 'metric-value')[0]),'Limit 10requests');
});
+test('renderer: only Chinese pages get Chinese controls; other languages fall back to English',()=>{
+ for (const [locale,expected] of [['es','Over limit by'],['ko','Over limit by'],['zh-TW','超限']]) {
+ const input = fixture(); input.meta.locale = locale;
+ input.panels[0].blocks = [{id:'overflow',type:'metric',label:'Requests',value:12,limit:10}];
+ assert.match(text(find(parse(renderExplainer(input)),'overflow')),new RegExp(expected),locale);
+ }
+});
+
test('renderer: native diagram panels receive responsive space without changing the frozen native diagram',()=>{
const input = fixture();
input.panels.push({id:'text-only',title:'What stays in context?',blocks:[{id:'plain-only',type:'prose',text:'The narrative still provides the context.'}]});