diff --git a/archify.zip b/archify.zip index 996023861c..14cab75155 100644 Binary files a/archify.zip and b/archify.zip differ diff --git a/archify/renderers/lifecycle/render-lifecycle.mjs b/archify/renderers/lifecycle/render-lifecycle.mjs index 1a49c1e431..082747cfee 100644 --- a/archify/renderers/lifecycle/render-lifecycle.mjs +++ b/archify/renderers/lifecycle/render-lifecycle.mjs @@ -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)); diff --git a/test/code-analysis-standalone-browser.test.mjs b/test/code-analysis-standalone-browser.test.mjs index 13226851d7..7fb35d27b9 100644 --- a/test/code-analysis-standalone-browser.test.mjs +++ b/test/code-analysis-standalone-browser.test.mjs @@ -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'; @@ -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); diff --git a/test/legend-contract.test.mjs b/test/legend-contract.test.mjs index c978c6bf5f..3af66e1657 100644 --- a/test/legend-contract.test.mjs +++ b/test/legend-contract.test.mjs @@ -248,6 +248,14 @@ test('visibility overrides apply after auto/all and empty legends leave no chrom assert.doesNotMatch(empty, />Legend kind !== 'final').map((kind) => [kind, { visible: false }])); + onlyFinal.final = { visible: true }; + const finalOnly = canonicalSvg(render('lifecycle', withLegend('lifecycle', { entries: onlyFinal }))); + assert.match(finalOnly, />Legend')), 'data-legend-semantic-kind'), ['final']); }); test('label overrides round-trip through all five public renderers', () => {