From 58047e6ad6380360ce1c87b0d199249825d52f4a Mon Sep 17 00:00:00 2001 From: topkoa Date: Wed, 1 Jul 2026 02:38:58 -0400 Subject: [PATCH] Address review: force target to All when the pane picker is hidden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When only one pane is live the Target row is hidden, but _aspectEditTarget could remain a specific pane key — silently routing edits into a hidden (and persistent arr:*) override in single-player. Reset the edit target to "" in _aspectBuildTargets whenever the row is hidden (or the selected pane is gone), so single-pane edits always go to the shared base. Co-Authored-By: Claude Opus 4.8 Signed-off-by: topkoa --- plugins/highway_3d/screen.js | 8 +++++++- tests/js/highway_3d_wide_fov.test.js | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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,