From 12e06468cd5d7ce3765d426abc6873d014f4d33e Mon Sep 17 00:00:00 2001 From: Chneemann Date: Thu, 13 Aug 2026 12:39:24 +0200 Subject: [PATCH] feat(tasks): add task editing actions, drop zone enhancements, and mobile support --- app/(app)/dashboard/card/Card.tsx | 1 + app/(app)/dashboard/card/CardActions.tsx | 38 +++- .../dashboard/header/ActionDropZones.tsx | 170 ++++++++++++++++++ app/(app)/dashboard/header/DeleteDropZone.tsx | 94 ---------- app/(app)/dashboard/header/Header.tsx | 6 +- 5 files changed, 207 insertions(+), 102 deletions(-) create mode 100644 app/(app)/dashboard/header/ActionDropZones.tsx delete mode 100644 app/(app)/dashboard/header/DeleteDropZone.tsx diff --git a/app/(app)/dashboard/card/Card.tsx b/app/(app)/dashboard/card/Card.tsx index db8a120..d16893c 100644 --- a/app/(app)/dashboard/card/Card.tsx +++ b/app/(app)/dashboard/card/Card.tsx @@ -104,6 +104,7 @@ export default function Card({
void} onMove - Callback function triggered when a new status column is selected. * @property {() => void} onDelete - Callback function triggered when the delete action is selected. */ interface CardActionsProps { + taskId: string; currentStatus: TaskStatus; isCreator: boolean; onMove: (newStatus: TaskStatus) => void; @@ -27,17 +30,19 @@ interface CardActionsProps { /** * Renders a mobile-only action menu component allowing users to move a task - * between different columns or delete it entirely via a dropdown interface. + * between different columns, edit it, or delete it entirely via a dropdown interface. * * @param {CardActionsProps} props - The component props. * @returns {JSX.Element} The rendered mobile card actions component. */ export default function CardActions({ + taskId, currentStatus, isCreator, onMove, onDelete, }: CardActionsProps) { + const router = useRouter(); const [showMobileActions, setShowMobileActions] = useState(false); const dropdownRef = useRef(null); @@ -72,6 +77,19 @@ export default function CardActions({ setShowMobileActions(false); }; + /** + * Handles clicking the edit action item to navigate to the task edit view if a valid ID exists. + * + * @param {React.MouseEvent} e - The mouse event object. + */ + const handleEditClick = (e: React.MouseEvent) => { + e.stopPropagation(); + if (taskId) { + router.push(`/tasks?task=edit&id=${taskId}`); + } + setShowMobileActions(false); + }; + /** * Handles clicking the delete action item to trigger task deletion. * @@ -92,7 +110,7 @@ export default function CardActions({ setShowMobileActions(!showMobileActions); }} className="p-1.5 rounded-lg border border-border bg-background/50 text-foreground-muted transition-all cursor-pointer hover:text-foreground hover:border-primary-hover flex items-center justify-center" - title="Move Task" + title="Task Actions" > @@ -124,10 +142,20 @@ export default function CardActions({ ); })} - {/* Delete Button */} + {/* Creator Actions: Edit & Delete */} {isCreator && ( <>
+
-