Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified archify.zip
Binary file not shown.
8 changes: 6 additions & 2 deletions archify/renderers/lifecycle/render-lifecycle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,11 +1017,15 @@ function legendCatalog() {
// The start marker and final ring remain meaningful in a change review.
const entries = reviewLegendEntries(changeReview, resolveLegend(config, LEGEND_CATALOG, presentKinds), config,
LEGEND_CATALOG.map((entry) => entry.kind).filter((kind) => kind !== 'start'));
if (config?.mode !== 'hidden' && config?.entries?.final?.visible !== false && [...states.values()].some(isFinal)) {
const changeEntries = changeLegendEntries(changeReview, config, lifecycle.meta.locale);
// By default the final ring only joins other entries; an explicit visible: true keeps it alone.
const finalVisible = config?.entries?.final?.visible;
if ((entries.length || changeEntries.length || finalVisible === true) && config?.mode !== 'hidden'
&& finalVisible !== false && [...states.values()].some(isFinal)) {
const label = config?.entries?.final?.label || i18nText(lifecycle.meta.locale, 'legend.lifecycle.final');
entries.push({ kind: 'final', label, interactive: false, present: true, swatchWidth: 16 });
}
return [...entries, ...changeLegendEntries(changeReview, config, lifecycle.meta.locale)];
return [...entries, ...changeEntries];
}
const legendEntries = legendCatalog();
const canvasWidth = Math.max(640, Math.ceil(geometry.contentRight + MARGIN_X));
Expand Down
8 changes: 8 additions & 0 deletions test/code-analysis-standalone-browser.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ test('standalone workbench keeps Atlas alongside evidence, both locales/themes a
const click = async selector => clickAt(await point(selector));
const hover = async selector => send('Input.dispatchMouseEvent', { type: 'mouseMoved', ...await point(selector) });
const drawSettled = "!document.documentElement.hasAttribute('data-bauify-atlas-animating')";
const readerWidthSettled = `!document.querySelector('main.container').getAnimations()
.some(animation => animation.transitionProperty === 'grid-template-columns')`;
const details = '#bauify-detail';
const priority = '.priority-card [data-finding]';
const copy = '.priority-card .quick-copy';
Expand Down Expand Up @@ -139,9 +141,15 @@ test('standalone workbench keeps Atlas alongside evidence, both locales/themes a
assert.equal(selected.kind, { 'coupling/cycle': 'modules', 'coupling/import-cycle': 'cycle' }[selected.code]);
await click(`${details} .inline-evidence .ref`);
assert.equal(await run("document.getElementById('bauify-code').hidden"), false);
// Changing reader width moves the Back buttons under the pointer.
await wait(readerWidthSettled, 'source reader did not finish expanding');
await click('#bauify-code .source-back');
await wait(`document.getElementById('bauify-code').hidden
&& document.querySelector('${details}').getClientRects().length
&& ${readerWidthSettled}`, 'finding reader did not return from source');
assert.equal(await run(selectedFinding), id, 'returning from source keeps the detail selected');
await click(`${details} .back`);
assert.equal(await run("document.getElementById('bauify-overview').hidden"), false, 'Back opens the overview');
assert.equal(await run(selectedFinding), '', 'returning to the overview restores no selection');
assert.equal(await run("!document.querySelector('.atlas-selection .selected')"), true);

Expand Down
8 changes: 8 additions & 0 deletions test/legend-contract.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,14 @@ test('visibility overrides apply after auto/all and empty legends leave no chrom
assert.doesNotMatch(empty, />Legend</, type);
assert.doesNotMatch(empty, /data-legend/, type);
}

// An explicit visible: true keeps the lifecycle final key even when it is the only entry left.
const onlyFinal = Object.fromEntries(AUTO_KINDS.lifecycle
.filter((kind) => kind !== 'final').map((kind) => [kind, { visible: false }]));
onlyFinal.final = { visible: true };
const finalOnly = canonicalSvg(render('lifecycle', withLegend('lifecycle', { entries: onlyFinal })));
assert.match(finalOnly, />Legend</);
assert.deepEqual(attrValues(finalOnly.slice(finalOnly.indexOf('<!-- Legend -->')), 'data-legend-semantic-kind'), ['final']);
});

test('label overrides round-trip through all five public renderers', () => {
Expand Down
Loading