beacon: suppress drift UI during the Unbuilding

This commit is contained in:
Timmy
2026-04-13 22:05:15 -04:00
committed by Alexander Whitestone
parent f1bed950e6
commit cff3d1715b
2 changed files with 19 additions and 0 deletions

View File

@@ -38,6 +38,12 @@ function renderAlignment() {
const container = document.getElementById('alignment-ui');
if (!container) return;
if (G.dismantleActive || G.dismantleComplete) {
container.innerHTML = '';
container.style.display = 'none';
return;
}
if (G.dismantleTriggered && !G.dismantleActive && !G.dismantleComplete && typeof Dismantle !== 'undefined' && Dismantle.triggered) {
Dismantle.renderChoice();
return;

View File

@@ -262,6 +262,19 @@ test('renderAlignment does not wipe the Unbuilding prompt after it is offered',
assert.match(document.getElementById('alignment-ui').innerHTML, /THE UNBUILDING/);
});
test('active Unbuilding suppresses pending alignment event UI', () => {
const { G, Dismantle, renderAlignment, document } = loadBeacon({ includeRender: true });
G.pendingAlignment = true;
G.dismantleActive = true;
Dismantle.active = true;
renderAlignment();
assert.equal(document.getElementById('alignment-ui').innerHTML, '');
assert.equal(document.getElementById('alignment-ui').style.display, 'none');
});
test('deferring the Unbuilding clears the prompt and allows it to return later', () => {
const { G, Dismantle, document } = loadBeacon();