refactor(dashboard): move controls to overlays and fix mobile/positioning issues

BREAKING CHANGES:
- Resize handles and edit controls now render in separate overlay containers
- This prevents widget overflow and scrollbar issues

Major Changes:

Overlay System Refactor:
- Create overlay containers for resize handles and edit controls
- Append handles/controls to overlays instead of widget DOM
- Fix position calculations using offsetLeft/Top instead of getBoundingClientRect
- Add position sync after resize/drag/reposition operations
- Add cleanup methods when switching tabs

Mobile Fixes:
- Add pointer/touch event support for Add Widget button
- Fix file upload trigger for iOS/Android compatibility
- Move modals to document.body with flex centering
- Fix modal button font-sizes (rem-based instead of vw)
- Add mobile-responsive styling for widget dialog

Bug Fixes:
- Fix getActiveTabId() calls (use activeTabId property instead)
- Fix file input disabled state (exclude type="file" from edit mode disable)
- Fix Add Widget modal registry.getAll() destructuring (objects not arrays)
- Fix edit/delete button hover (keep visible when hovering buttons)
- Fix reset layout to restore deleted widgets (regenerate default layout)

UI Improvements:
- No more scrollbars from resize handles
- Consistent button visibility in edit mode
- Touch-friendly button sizes on mobile (44px min-height)
- Single-column widget grid on mobile
- Proper z-index stacking for overlays

Files Changed:
- dashboardManager.js: Overlay container management, sync methods
- resizeHandler.js: Append to overlay, update positioning
- editModeManager.js: Append to overlay, hover behavior, sync/cleanup
- dashboardIntegration.js: Mobile touch events, file upload, modal fixes
- dashboardTemplate.html: File input accessibility
- style.css: Modal button font-sizes, mobile optimizations
- RESIZE_HANDLES_INVESTIGATION.md: Technical investigation documentation
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-29 19:07:01 +11:00
parent ddb2f8c222
commit 9fbc35dbd9
7 changed files with 651 additions and 28 deletions
+29
View File
@@ -1748,6 +1748,35 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
padding: 0.75rem 1rem;
font-size: 1.05rem; /* Touch-friendly size for mobile readability */
}
/* Add Widget dialog mobile optimizations */
.rpg-widget-grid {
grid-template-columns: 1fr; /* Single column on mobile for better readability */
gap: 0.75rem; /* Slightly tighter spacing */
}
.rpg-widget-card {
padding: 0.875rem; /* Slightly less padding on mobile */
}
.rpg-widget-card-icon {
font-size: 2rem; /* Scale down icon for mobile */
}
.rpg-widget-card-name {
font-size: 0.9rem; /* Slightly smaller name */
}
.rpg-widget-card-description {
font-size: 0.7rem; /* Compact description */
line-height: 1.25;
}
.rpg-widget-card-add {
min-height: 44px; /* Touch-friendly button size */
padding: 0.75rem 1rem;
font-size: 0.95rem;
}
}
.rpg-dashboard-grid {