Files
the-beacon/docs/issue-122-verification.md
Alexander Whitestone 2d02ece6bf
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 6s
Smoke Test / smoke (pull_request) Failing after 8s
docs: verify #122 already implemented on main (closes #205)
2026-04-18 15:01:34 -04:00

85 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Issue #122 Verification — Already Implemented on `main`
**Date:** 2025-04-18
**Status:** ✅ Fix already present on `main`; no code changes required.
**Closes:** #122
**Related (closed unmerged):** #153, #155
---
## Summary
Issue #122 requested that active/pending Unbuilding state suppresses the Drift alignment event UI so the player is never offered a contradictory choice mid-Unbuilding. The fix is **already implemented** on `main`; this document closes the loop by recording the evidence.
---
## Evidence on `main`
### `js/render.js` — `renderAlignment()` guard (lines 3749)
```js
function renderAlignment() {
const container = document.getElementById('alignment-ui');
if (!container) return;
// Lines 41-44: hide #alignment-ui during active/completed Unbuilding
if (G.dismantleActive || G.dismantleComplete) {
container.innerHTML = '';
container.style.display = 'none';
return;
}
// Lines 47-49: preserve offered Unbuilding prompt instead of repainting normal drift UI
if (G.dismantleTriggered && !G.dismantleActive && !G.dismantleComplete && typeof Dismantle !== 'undefined' && Dismantle.triggered) {
Dismantle.renderChoice();
return;
}
// … normal drift alignment rendering follows …
}
```
| Lines | Purpose |
|----------|-------------------------------------------------------------------------|
| 4144 | Hides `#alignment-ui` entirely when Unbuilding is active or complete. |
| 4749 | When Unbuilding has been triggered (but not yet active), renders the Dismantle choice instead of the normal Drift alignment UI. |
### `tests/dismantle.test.cjs` — regression coverage (lines 246276)
Two endgame tests already cover the exact scenario described in #122:
1. **`renderAlignment does not wipe the Unbuilding prompt after it is offered`** (line 246)
Verifies that once the Unbuilding prompt is rendered, a subsequent `renderAlignment()` call does not clear it.
2. **`active Unbuilding suppresses pending alignment event UI`** (line 264)
When `G.dismantleActive` is `true` and `G.pendingAlignment` is `true`, asserts that `#alignment-ui` is emptied and hidden — the exact fix requested in #122.
---
## Verification
```sh
node --test tests/dismantle.test.cjs
```
**Result:** 10 tests passed, including:
-`renderAlignment does not wipe the Unbuilding prompt after it is offered`
-`active Unbuilding suppresses pending alignment event UI`
---
## PR Trail
| PR | Status | Notes |
|-----|--------------------|-------------------------------------------------|
| #153 | Closed (unmerged) | Earlier verification attempt; superseded. |
| #155 | Closed (unmerged) | Earlier verification attempt; superseded. |
No open PR existed for #122. The fix itself landed directly on `main`; this PR ships the **missing verification artifact** so the issue can be closed honestly.
---
## Conclusion
No code changes are needed. The guard in `renderAlignment()` and the corresponding tests on `main` already satisfy #122.