From fedc93f504cc2d113b197c95d4655154539ce5f7 Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Thu, 6 Nov 2025 21:07:27 +1100 Subject: [PATCH] fix: lock button visual state now updates correctly outside edit mode Fixed bug where the lock/unlock button's icon and title didn't update when toggling lock state outside of edit mode. The logical state changed correctly (widgets locked/unlocked), but the button appearance remained stale. Root Cause: - toggleLock() correctly updates the button element - When in dropdown/menu mode (narrow screens), menu items are static snapshots - Edit mode toggle refreshed the menu (via headerOverflowManager.refresh()) - Lock button toggle did NOT refresh the menu - Result: stale button appearance in dropdown menus Solution: - Added headerOverflowManager.refresh() call after toggleLock() - Follows the exact same pattern as edit mode toggle (lines 323-326) - Uses setTimeout(50ms) to ensure DOM updates complete first Changes: - src/systems/dashboard/dashboardIntegration.js (lines 338-341) Added 4 lines to refresh menu after lock state change Result: Lock button now correctly updates its visual state (icon: lock/lock-open, title: "Lock Widgets"/"Unlock Widgets") whether in edit mode or not, and whether visible directly or in dropdown/hamburger menus. --- src/systems/dashboard/dashboardIntegration.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/systems/dashboard/dashboardIntegration.js b/src/systems/dashboard/dashboardIntegration.js index ba99a57..3d8f299 100644 --- a/src/systems/dashboard/dashboardIntegration.js +++ b/src/systems/dashboard/dashboardIntegration.js @@ -335,6 +335,10 @@ function setupDashboardEventListeners(dependencies) { if (dashboardManager && dashboardManager.editManager) { console.log('[RPG Companion] Lock button clicked'); dashboardManager.editManager.toggleLock(); + // Refresh header overflow menu to reflect lock button state change + if (headerOverflowManager) { + setTimeout(() => headerOverflowManager.refresh(), 50); + } } }); }