From f6ba2642f764fafda81ee74b0152c85b0bfc0a12 Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Thu, 30 Oct 2025 08:44:33 +1100 Subject: [PATCH] fix(dashboard): quest widget auto-arrange tab placement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed auto-arrange placing quest widget into wrong tab. Problem: - Quest widget had category: 'scene' but needs dedicated tab - Auto-arrange only created Status/Scene/Social/Inventory tabs - Quest widget got grouped with scene widgets - No 'quests' category existed in the system Solution: 1. Changed quest widget category from 'scene' to 'quests' 2. Added 'quests' to category groups in distributeWidgetsByCategory() 3. Added Quests tab creation in auto-arrange logic 4. Updated category sort order to include 'quests' (order 5) Changes: - questsWidget.js: category: 'quests' (line 396) - dashboardManager.js: Added 'quests' to groups object (line 870) - dashboardManager.js: Added Quests tab creation (lines 942-954) - dashboardManager.js: Updated categoryOrder to include 'quests': 5 (line 983) Result: - Auto-arrange now creates dedicated Quests tab ✅ - Quest widget correctly placed in Quests tab ✅ - Matches default layout structure ✅ - Clean separation of scene info vs quests ✅ --- src/systems/dashboard/dashboardManager.js | 20 +++++++++++++++++-- src/systems/dashboard/widgets/questsWidget.js | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/systems/dashboard/dashboardManager.js b/src/systems/dashboard/dashboardManager.js index 2ccb46d..0f5030f 100644 --- a/src/systems/dashboard/dashboardManager.js +++ b/src/systems/dashboard/dashboardManager.js @@ -866,7 +866,8 @@ export class DashboardManager { user: [], scene: [], social: [], - inventory: [] + inventory: [], + quests: [] }; widgets.forEach(widget => { @@ -938,6 +939,20 @@ export class DashboardManager { this.gridEngine.autoLayout(groups.inventory, { preserveOrder: true }); } + // Create Quests tab if there are quest widgets + if (groups.quests.length > 0) { + this.dashboard.tabs.push({ + id: 'tab-quests', + name: 'Quests', + icon: 'fa-solid fa-scroll', + order: 4, + widgets: groups.quests + }); + + // Auto-layout quest widgets + this.gridEngine.autoLayout(groups.quests, { preserveOrder: true }); + } + console.log('[DashboardManager] Created', this.dashboard.tabs.length, 'tabs'); // Re-render tabs and switch to first tab @@ -965,7 +980,8 @@ export class DashboardManager { 'scene': 2, 'social': 3, 'inventory': 4, - 'other': 5 + 'quests': 5, + 'other': 6 }; // Specific widget type ordering within user category diff --git a/src/systems/dashboard/widgets/questsWidget.js b/src/systems/dashboard/widgets/questsWidget.js index f944665..ce5bd1b 100644 --- a/src/systems/dashboard/widgets/questsWidget.js +++ b/src/systems/dashboard/widgets/questsWidget.js @@ -393,7 +393,7 @@ export function registerQuestsWidget(registry, dependencies) { name: 'Quests', icon: '', description: 'Quest tracking with main and optional quests', - category: 'scene', + category: 'quests', minSize: { w: 2, h: 4 }, defaultSize: { w: 2, h: 5 }, maxAutoSize: { w: 3, h: 7 },