fix(dashboard): fix persistent px values, auto-layout, widget loss, gaps, and tabs

This commit resolves 6 critical dashboard issues reported by user:

1. **Persistent px values causing 264rem widget heights**
   - Root cause: state.js had hardcoded rowHeight: 80, gap: 12 (px)
   - Root cause: index.js double-loaded layout, overwriting migration
   - Fix: Changed state.js gridConfig to rem units (5, 0.75)
   - Fix: Removed redundant applyDashboardConfig in index.js
   - Fix: Added migration in layoutPersistence.js for old saves
   - Dashboard now uses rem consistently throughout

2. **Auto-layout on first load**
   - Added auto-layout in loadLayout() when no saved layout exists
   - Prevents overlap from hardcoded default positions
   - Saves auto-laid-out result as initial layout

3. **Reset layout causes overlap**
   - Added auto-layout loop in resetLayout() after applying config
   - Each tab auto-lays out to prevent widget overlap

4. **Auto-arrange loses inventory/social widgets**
   - Fixed autoLayoutWidgets to gather ALL widgets from ALL tabs
   - Previously only gathered current tab, lost other tabs
   - Now always uses multi-tab distribution to preserve all widgets

5. **Auto-arrange leaves 2x2 gaps**
   - Added compact pass in gridEngine.js after bin-packing
   - Moves widgets upward to fill gaps
   - Eliminates empty spaces at bottom of layout

6. **Tabs not compact (icon-only)**
   - Updated tab styling: icons only, names show on hover
   - Allows more tabs in compact space
   - min-width: 2.5rem, larger icon size

Also added debug logging to track config values through initialization.

Fixes refresh sizing bug, reset overlap, widget loss, and layout gaps.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-23 19:32:27 +11:00
parent 79582070f0
commit c4485971fa
6 changed files with 121 additions and 51 deletions
+11 -2
View File
@@ -1083,8 +1083,10 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
.rpg-dashboard-tab {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.3rem;
padding: 0.4rem 0.7rem;
padding: 0.5rem;
min-width: 2.5rem;
font-size: 0.75rem;
border: 1px solid transparent;
background: transparent;
@@ -1108,11 +1110,18 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
}
.rpg-tab-icon {
font-size: 0.9rem;
font-size: 1.1rem;
}
.rpg-tab-name {
font-size: 0.75rem;
display: none;
}
/* Show name on hover */
.rpg-dashboard-tab:hover .rpg-tab-name {
display: inline;
margin-left: 0.3rem;
}
.rpg-dashboard-btn {