From 1434eb63427e22254ef8b1bea6a8e387d43b6885 Mon Sep 17 00:00:00 2001 From: topkoa Date: Wed, 1 Jul 2026 02:54:15 -0400 Subject: [PATCH] Address review: only register panes while the tuner is open camUpdate registered every pane each frame regardless of whether the tuner had ever been opened, so window.__h3dAspectPanes could grow unbounded (prune runs only while the panel is open) and it ran even for users who never opt in. Gate _aspectRegisterPane behind __h3dAspectPanelOpen (same gate as the readout). The pane key is still resolved every frame so saved overrides keep applying; only the picker bookkeeping is deferred until the panel is open. Co-Authored-By: Claude Opus 4.8 Signed-off-by: topkoa --- plugins/highway_3d/screen.js | 6 +++++- tests/js/highway_3d_wide_fov.test.js | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/highway_3d/screen.js b/plugins/highway_3d/screen.js index 25198bf..53c6c08 100644 --- a/plugins/highway_3d/screen.js +++ b/plugins/highway_3d/screen.js @@ -14459,7 +14459,11 @@ // costs nothing. const _paneKey = _aspectPaneKey( bundle && bundle.songInfo && bundle.songInfo.arrangement, _paneUid); - _aspectRegisterPane(_paneKey); + // Only feed the Target-picker registry while the tuner is open (same + // gate as the readout). Closed → nothing is registered, so the registry + // can't grow for users who never open the panel; the key is still + // resolved below so any saved overrides keep applying. + if (window.__h3dAspectPanelOpen) _aspectRegisterPane(_paneKey); const _aspTune = _resolveTuneFor(_paneKey); const _aspActive = !!(_aspTune && _aspTune.enabled && !(_aspTune.splitOnly && !_ssActive())); diff --git a/tests/js/highway_3d_wide_fov.test.js b/tests/js/highway_3d_wide_fov.test.js index ead7b58..475dc9c 100644 --- a/tests/js/highway_3d_wide_fov.test.js +++ b/tests/js/highway_3d_wide_fov.test.js @@ -170,8 +170,8 @@ test('a Target select and pane registry drive the per-pane picker', () => { 'the panel must build a Target