natus wheel: fix DON/DOFF reset on PRV/NXT return to DONned planet — TDD
All checks were successful
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline was successful

_aspectsVisible was set to false when stepping away to a different planet,
but the guard `if (item0.name !== _aspectPlanet)` only skipped resetting it
on return — it never restored it to true. Replace the conditional with a
direct assignment: _aspectsVisible = (item0.name === _aspectPlanet).

T11g: navigating away via NXT then back via PRV restores DOFF-active state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-21 16:04:32 -04:00
parent 04f0e87eba
commit 02975d79d3
3 changed files with 44 additions and 5 deletions

View File

@@ -344,12 +344,11 @@ const NatusWheel = (() => {
/** Lock-activate a planet by cycle index. */
function _activatePlanet(idx) {
_clearActive();
// Aspect lines persist across planet switches — cleared only by DON or DOFF.
// Re-opening the same planet restores _aspectsVisible so DON shows as ×.
// _aspectsVisible tracks whether the currently-active planet's aspects are drawn.
// Derive it from _aspectPlanet so navigating away and back via PRV/NXT correctly
// restores the DOFF state instead of resetting to DON.
const item0 = _planetItems[idx];
if (item0.name !== _aspectPlanet) {
_aspectsVisible = false;
}
_aspectsVisible = (item0.name === _aspectPlanet);
_activeRing = 'planets';
_activeIdx = idx;
const item = _planetItems[idx];