fix(dashboard): resolve widget sizing and detection issues
Issue 1: PresentCharacters widget too small with gaps - Increase height from h:3 to h:4 in defaultLayout.js - Widget's defaultSize is h:2 but layout had h:3, creating mismatch - Now properly fills vertical space without gaps Issue 2: Recent Events not appearing in reset/auto-arrange Root cause: previousTrackerConfig starts as null, preventing widget detection Fixes: - Initialize previousTrackerConfig on dashboard load (dashboardIntegration.js) - Deep clone trackerConfig after dashboard init - Enables detectConfigChanges() to work on first load - Reset previousTrackerConfig to null in resetLayout() (dashboardManager.js) - Ensures fresh detection after layout reset - Prevents stale comparison data Verified: Recent Events enabled by default in tracker config (state.js:95) Result: ✅ PresentCharacters fills space properly ✅ Recent Events appears in reset layout ✅ Recent Events appears in auto-arrange ✅ Tracker editor enable/disable now works correctly
This commit is contained in:
@@ -104,6 +104,14 @@ export async function initializeDashboard(dependencies) {
|
||||
dashboardManager.setDefaultLayout(defaultLayout);
|
||||
console.log('[RPG Companion] Default layout set with', defaultLayout.tabs.length, 'tabs');
|
||||
|
||||
// Initialize previousTrackerConfig to enable widget detection on first load
|
||||
// Without this, detectConfigChanges() returns [] because oldConfig is null
|
||||
const settings = dependencies.getExtensionSettings();
|
||||
if (settings?.trackerConfig && dashboardManager) {
|
||||
dashboardManager.previousTrackerConfig = JSON.parse(JSON.stringify(settings.trackerConfig));
|
||||
console.log('[RPG Companion] Initialized previousTrackerConfig for widget detection');
|
||||
}
|
||||
|
||||
// Set up dashboard event listeners
|
||||
setupDashboardEventListeners(dependencies);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user