feat: Enhance DashboardConfigurePage with drag-and-drop functionality and improved widget search
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s

- Added drag-and-drop support for widget reordering in the dashboard configuration.
- Introduced a new search input for filtering widgets, enhancing user experience.
- Updated layout editor with a new function to move widgets between indices.
- Improved responsiveness by implementing viewport detection for drag-and-drop features.
- Refactored state management for better handling of widget visibility and search functionality.
This commit is contained in:
Lars committed 2026-04-08 07:58:52 +02:00
1 parent e4e2f23d7f
commit ff95ef63c7
2 files changed
+286 -84

No files matched your search

+14
View File
@@ -25,3 +25,17 @@ export function toggleWidget(layout, index) {
if (!anyOn) return layout
return { ...layout, widgets: next }
}
/**
* Verschiebt eine Zeile von fromIndex nach dropIndex (Indizes im vollen layout.widgets).
* Semantik wie üblich: Element landet an Position dropIndex (nach Entfernen an der alten Stelle).
*/
export function moveWidgetToIndex(layout, fromIndex, dropIndex) {
if (!layout?.widgets?.length) return layout
if (fromIndex < 0 || fromIndex >= layout.widgets.length) return layout
if (dropIndex < 0 || dropIndex > layout.widgets.length) return layout
if (fromIndex === dropIndex) return layout
const next = [...layout.widgets]
next.splice(dropIndex, 0, next.splice(fromIndex, 1)[0])
return { ...layout, widgets: next }
}