From 487fb767767495319b421feccb88d373aa74af30 Mon Sep 17 00:00:00 2001 From: shancds Date: Mon, 30 Jun 2025 17:09:17 +0530 Subject: [PATCH] feat(enhanced-kanban): enhance drag-and-drop overlays with theme-aware styling - Added theme mode support to the drag-and-drop overlays for tasks and groups, improving visual consistency in dark and light modes. - Updated the display of active tasks and groups during drag operations to enhance user experience and clarity. --- .../enhanced-kanban/EnhancedKanbanBoard.tsx | 45 ++++++++++++---- .../enhanced-kanban/EnhancedKanbanGroup.tsx | 52 +++++++++---------- 2 files changed, 59 insertions(+), 38 deletions(-) diff --git a/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanBoard.tsx b/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanBoard.tsx index 28a70475..dfee2303 100644 --- a/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanBoard.tsx +++ b/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanBoard.tsx @@ -71,6 +71,7 @@ const EnhancedKanbanBoard: React.FC = ({ projectId, cl const groupBy = useSelector((state: RootState) => state.enhancedKanbanReducer.groupBy); const project = useAppSelector((state: RootState) => state.projectReducer.project); const { statusCategories, status: existingStatuses } = useAppSelector((state) => state.taskStatusReducer); + const themeMode = useAppSelector(state => state.themeReducer.mode); // Load filter data useFilterDataLoader(); @@ -441,18 +442,42 @@ const EnhancedKanbanBoard: React.FC = ({ projectId, cl {activeTask && ( - +
+ {activeTask.name} +
)} {activeGroup && ( -
-
-

{activeGroup.name}

- ({activeGroup.tasks.length}) -
+
+

{activeGroup.name}

+ ({activeGroup.tasks.length})
)} diff --git a/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanGroup.tsx b/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanGroup.tsx index 5d33a77a..5d7aa3f2 100644 --- a/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanGroup.tsx +++ b/worklenz-frontend/src/components/enhanced-kanban/EnhancedKanbanGroup.tsx @@ -342,18 +342,6 @@ const EnhancedKanbanGroup: React.FC = React.memo(({ e.stopPropagation(); }} > - - {group.tasks.length} - {isLoading && } {isEditable ? ( @@ -403,7 +391,7 @@ const EnhancedKanbanGroup: React.FC = React.memo(({ e.stopPropagation(); }} > - {name} + {name} ({group.tasks.length}) )} @@ -480,28 +468,36 @@ const EnhancedKanbanGroup: React.FC = React.memo(({ {group.tasks.map((task, index) => ( - {/* Show drop indicator before task if this is the target position */} - {shouldShowDropIndicators && overId === task.id && ( -
-
-
+ {/* Drop indicator before the card if this is the drop target */} + {overId === task.id && ( +
)} - - - {/* Show drop indicator after last task if dropping at the end */} - {shouldShowDropIndicators && - index === group.tasks.length - 1 && - overId === group.id && ( -
-
-
- )} + {/* Drop indicator at the end if dropping at the end of the group */} + {index === group.tasks.length - 1 && overId === group.id && ( +
+ )} ))}