From 4dd71c95c797e0dce5e7d06d603fe8ddd414fa26 Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Thu, 6 Nov 2025 22:37:20 +1100 Subject: [PATCH] refactor: remove redundant Edit Trackers button from hamburger menu Remove duplicate "Edit Trackers" button from hamburger menu since there's already a Tracker Settings button in the dashboard header. Changes: - Removed "Edit Trackers" button from template.html hamburger menu - Updated Settings button to full width (removed .rpg-btn-half class) - Changed dashboard button ID from 'rpg-dashboard-tracker-settings' to 'rpg-open-tracker-editor' to become the canonical button - Removed redundant event handler in dashboardIntegration.js that was clicking the old hamburger button Benefits: - Reduces UI clutter in hamburger menu - Single source of truth for Tracker Settings button (dashboard header) - Existing code in trackerEditor.js, infoBoxWidgets.js continues to work via jQuery event delegation on ID 'rpg-open-tracker-editor' Technical Notes: - jQuery delegation $(document).on('click', '#rpg-open-tracker-editor', ...) works for any element with that ID, not just a specific one - No changes needed to trackerEditor.js or widget disabled state handlers - Dashboard button is now the canonical "Edit Trackers" trigger Related: Hamburger menu UI, dashboard header controls --- src/systems/dashboard/dashboardIntegration.js | 16 ++-------------- src/systems/dashboard/dashboardTemplate.html | 2 +- template.html | 7 ++----- 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/systems/dashboard/dashboardIntegration.js b/src/systems/dashboard/dashboardIntegration.js index 79ef448..0da6eda 100644 --- a/src/systems/dashboard/dashboardIntegration.js +++ b/src/systems/dashboard/dashboardIntegration.js @@ -347,20 +347,8 @@ function setupDashboardEventListeners(dependencies) { }); } - // Tracker Settings button (open tracker editor modal) - const trackerSettingsBtn = document.querySelector('#rpg-dashboard-tracker-settings'); - if (trackerSettingsBtn) { - trackerSettingsBtn.addEventListener('click', () => { - console.log('[RPG Companion] Tracker Settings button clicked'); - // Trigger the tracker editor button from main UI - const trackerEditorBtn = document.getElementById('rpg-open-tracker-editor'); - if (trackerEditorBtn) { - trackerEditorBtn.click(); - } else { - console.warn('[RPG Companion] Tracker editor button not found'); - } - }); - } + // Tracker Settings button now uses ID 'rpg-open-tracker-editor' + // Event handler is in trackerEditor.js using jQuery delegation // Done button (exit edit mode) const doneBtn = document.querySelector('#rpg-dashboard-done-edit'); diff --git a/src/systems/dashboard/dashboardTemplate.html b/src/systems/dashboard/dashboardTemplate.html index 79e61dd..f210818 100644 --- a/src/systems/dashboard/dashboardTemplate.html +++ b/src/systems/dashboard/dashboardTemplate.html @@ -24,7 +24,7 @@ - diff --git a/template.html b/template.html index b4aa08b..9a9a800 100644 --- a/template.html +++ b/template.html @@ -64,12 +64,9 @@ Refresh RPG Info - +
- -