Skip to content

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

test(timeline): cover fractional axis ticks and merge dev

cyanseekd2ee084cce07
diff --cc archify.zip
index d1769fb0,776666e0..8cd93154
Binary files differ
diff --cc test/timeline-rendering.test.mjs
index f33b53c6,6001adc7..546d189b
--- a/test/timeline-rendering.test.mjs
+++ b/test/timeline-rendering.test.mjs
@@@ -28,32 -28,6 +28,34 @@@ function layoutOf(diagram)
}
const overlap = (a, b) => a.left < b.left + b.width && b.left < a.left + a.width && a.top < b.top + b.height && b.top < a.top + a.height;
+test('timeline: subsecond events retain their time in cards and accessible context', () => {
+ const diagram = clone(small);
+ diagram.meta.timezone = 'Asia/Kolkata';
+ diagram.events = [
+ { id: 'sent', title: 'Request sent', at: '2026-10-01T10:00:00.007Z', lane: 'release' },
+ { id: 'reply', title: 'Reply received', at: '2026-10-01T15:30:00.900+05:30', lane: 'release' },
+ { id: 'done', title: 'Finished', at: '2026-10-01T10:00:01Z', lane: 'release' },
+ ];
+ const result = run(diagram);
+ assert.equal(result.status, 0, result.stderr);
+ const html = fs.readFileSync(result.output, 'utf8');
+ for (const [id, time] of [['sent', '15:30:00.007'], ['reply', '15:30:00.900'], ['done', '15:30:01']]) {
+ const node = html.match(new RegExp(`<g [^>]*data-node-id="${id}"[^>]*>[\\s\\S]*?</g>`))?.[0];
+ assert.ok(node, id);
+ assert.ok(node.includes(`UTC+05:30`), node);
+ assert.ok(node.includes(`10-01 ${time} UTC+05:30`), node);
+ assert.ok(node.includes(`>${time}</text>`), node);
+ }
++ const axisLabels = [...html.matchAll(/<text [^>]*class="[^"]*\btl-tick\b[^"]*"[^>]*>([^<]*)<\/text>/g)].map(([, label]) => label);
++ assert.ok(axisLabels.includes('15:30:00.007'), axisLabels.join(', '));
+ const report = layoutOf(diagram);
+ assert.equal(report.events[1].t - report.events[0].t, 893);
+ assert.ok(report.events[1].x > report.events[0].x);
+ for (const card of report.events) for (const other of report.events) {
+ if (card.id < other.id) assert.ok(!overlap(card, other), `${card.id} overlaps ${other.id}`);
+ }
+});
+
test('timeline: both examples render and pass the showcase artifact checks', () => {
for (const diagram of [small, large]) {
const result = run(diagram);