feat(dashboard): add confirmations, fix UX issues, and optimize grid rendering
BREAKING CHANGE: applyDashboardConfig() now accepts optional second parameter for optimization Add auto-arrange confirmation dialog: - Add warning popup before auto-arranging widgets across all tabs - Follows same pattern as reset layout confirmation - Prevents accidental destructive operations Fix text selection interference: - Apply user-select: none to entire .rpg-widget in edit mode - Previously only applied to .rpg-widget-content - Prevents text selection when dragging widgets, especially in attribute boxes - Improves drag interaction on both desktop and mobile Fix edit controls visibility: - Add CSS rule to completely hide edit controls outside edit mode - Controls now properly hidden when not in edit mode - Settings button (⚙) kept for future widget configuration Fix input disabling in edit mode: - Call disableContentEditing() after tab switches in onTabChange() - Call disableContentEditing() in syncAllControls() - Ensures text fields remain non-editable in edit mode after all operations Fix resize grid background rendering: - Copy drag handler grid logic EXACTLY to resize handler - Use gridEngine.calculateGridHeight(widgets) instead of manual calculation - Add proper remToPixels() conversions for gap and rowHeight - Pass widgets array through initWidget() and startResize() - Grid now renders correctly during resize, matching drag behavior Optimize layout operations: - Add skipInitialSwitch option to applyDashboardConfig() - Prevents redundant clearGrid() calls during resetLayout() - Defers rendering until after layout calculations complete Files modified: - dashboardIntegration.js: Auto-arrange confirmation - dashboardManager.js: skipInitialSwitch option, input disabling, widgets array - editModeManager.js: Input disabling in syncAllControls() - resizeHandler.js: Grid rendering fixes with proper unit conversions - style.css: Text selection prevention, edit controls visibility
This commit is contained in:
@@ -1803,7 +1803,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
}
|
||||
|
||||
/* Prevent text selection in edit mode (especially important for mobile) */
|
||||
.edit-mode .rpg-widget-content {
|
||||
.edit-mode .rpg-widget {
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
@@ -1811,6 +1811,11 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
-webkit-touch-callout: none; /* Prevent iOS callout menu */
|
||||
}
|
||||
|
||||
/* Hide edit controls completely when not in edit mode */
|
||||
.rpg-dashboard-container:not(.edit-mode) .widget-edit-controls {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Hide resize handles when widgets are locked */
|
||||
.widgets-locked .resize-handles {
|
||||
opacity: 0 !important;
|
||||
|
||||
Reference in New Issue
Block a user