fix(dashboard): quest widget auto-arrange tab placement

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 
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-30 08:44:33 +11:00
parent 9f92c4af87
commit f6ba2642f7
2 changed files with 19 additions and 3 deletions
+18 -2
View File
@@ -866,7 +866,8 @@ export class DashboardManager {
user: [], user: [],
scene: [], scene: [],
social: [], social: [],
inventory: [] inventory: [],
quests: []
}; };
widgets.forEach(widget => { widgets.forEach(widget => {
@@ -938,6 +939,20 @@ export class DashboardManager {
this.gridEngine.autoLayout(groups.inventory, { preserveOrder: true }); 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'); console.log('[DashboardManager] Created', this.dashboard.tabs.length, 'tabs');
// Re-render tabs and switch to first tab // Re-render tabs and switch to first tab
@@ -965,7 +980,8 @@ export class DashboardManager {
'scene': 2, 'scene': 2,
'social': 3, 'social': 3,
'inventory': 4, 'inventory': 4,
'other': 5 'quests': 5,
'other': 6
}; };
// Specific widget type ordering within user category // Specific widget type ordering within user category
@@ -393,7 +393,7 @@ export function registerQuestsWidget(registry, dependencies) {
name: 'Quests', name: 'Quests',
icon: '<i class="fa-solid fa-scroll"></i>', icon: '<i class="fa-solid fa-scroll"></i>',
description: 'Quest tracking with main and optional quests', description: 'Quest tracking with main and optional quests',
category: 'scene', category: 'quests',
minSize: { w: 2, h: 4 }, minSize: { w: 2, h: 4 },
defaultSize: { w: 2, h: 5 }, defaultSize: { w: 2, h: 5 },
maxAutoSize: { w: 3, h: 7 }, maxAutoSize: { w: 3, h: 7 },