diff --git a/plugins/highway_3d/screen.js b/plugins/highway_3d/screen.js index ac0c3a5..6556367 100644 --- a/plugins/highway_3d/screen.js +++ b/plugins/highway_3d/screen.js @@ -1837,7 +1837,13 @@ o.value = pk; o.textContent = reg[pk].label; _aspectTargetSel.appendChild(o); }); - if (_aspectEditTarget && !reg[_aspectEditTarget]) _aspectEditTarget = ''; + // Force the edit target back to "All" when the Target row is hidden + // (single pane) or the selected pane is gone — otherwise a stale pane + // target would silently route edits into a hidden (and persistent + // arr:*) override in single-player. + if (keys.length <= 1 || (_aspectEditTarget && !reg[_aspectEditTarget])) { + _aspectEditTarget = ''; + } _aspectTargetSel.value = _aspectEditTarget; // The Target row only matters with more than one pane (a split). With a // single pane there's nothing to disambiguate, so hide it. diff --git a/tests/js/highway_3d_wide_fov.test.js b/tests/js/highway_3d_wide_fov.test.js index abf80df..f3bee04 100644 --- a/tests/js/highway_3d_wide_fov.test.js +++ b/tests/js/highway_3d_wide_fov.test.js @@ -235,6 +235,14 @@ test('pruning drops the matching readout slot and a dangling __last', () => { ); }); +test('single-pane forces the edit target back to All (no hidden pane edits)', () => { + assert.match( + src, + /if\s*\(\s*keys\.length\s*<=\s*1\s*\|\|\s*\(\s*_aspectEditTarget\s*&&\s*!reg\[_aspectEditTarget\]\s*\)\s*\)\s*\{\s*_aspectEditTarget\s*=\s*''/, + '_aspectBuildTargets must reset the edit target to "" when the Target row is hidden', + ); +}); + test('the panel has a dismiss (close) control', () => { assert.match( src,