Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat: enhance task due date management with clearing functionality and UI improvements

Andrej Acevskia9155cbefc40
diff --git a/apps/api/src/activity/index.ts b/apps/api/src/activity/index.ts
index 6d96b1564..da20faa9d 100644
--- a/apps/api/src/activity/index.ts
+++ b/apps/api/src/activity/index.ts
@@ -269,6 +269,17 @@ subscribeToEvent<{
const oldDate = data.oldDueDate
? new Date(data.oldDueDate).toLocaleDateString()
: "none";
+
+ if (!data.newDueDate) {
+ await createActivity(
+ data.taskId,
+ data.type,
+ data.userId,
+ "cleared the due date",
+ );
+ return;
+ }
+
const newDate = new Date(data.newDueDate).toLocaleDateString();
await createActivity(
data.taskId,
diff --git a/apps/api/src/task/controllers/update-task-due-date.ts b/apps/api/src/task/controllers/update-task-due-date.ts
index b32a75268..667a7ac0c 100644
--- a/apps/api/src/task/controllers/update-task-due-date.ts
+++ b/apps/api/src/task/controllers/update-task-due-date.ts
@@ -8,7 +8,7 @@ async function updateTaskDueDate({
dueDate,
}: {
id: string;
- dueDate: Date;
+ dueDate: Date | null;
}) {
const updatedTask = await db.query.taskTable.findFirst({
where: eq(taskTable.id, id),
@@ -20,7 +20,10 @@ async function updateTaskDueDate({
});
}
- await db.update(taskTable).set({ dueDate }).where(eq(taskTable.id, id));
+ await db
+ .update(taskTable)
+ .set({ dueDate: dueDate || null })
+ .where(eq(taskTable.id, id));
if (!updatedTask) {
throw new HTTPException(404, {
diff --git a/apps/api/src/task/index.ts b/apps/api/src/task/index.ts
index 8023b209b..2ee9583ae 100644
--- a/apps/api/src/task/index.ts
+++ b/apps/api/src/task/index.ts
@@ -435,14 +435,17 @@ const task = new Hono<{
},
}),
validator("param", v.object({ id: v.string() })),
- validator("json", v.object({ dueDate: v.string() })),
+ validator("json", v.object({ dueDate: v.optional(v.string()) })),
workspaceAccess.fromTask(),
async (c) => {
const { id } = c.req.valid("param");
- const { dueDate } = c.req.valid("json");
+ const { dueDate = null } = c.req.valid("json");
const user = c.get("userId");
- const task = await updateTaskDueDate({ id, dueDate: new Date(dueDate) });
+ const task = await updateTaskDueDate({
+ id,
+ dueDate: dueDate ? new Date(dueDate) : null,
+ });
await publishEvent("task.due_date_changed", {
taskId: task.id,
diff --git a/apps/web/src/components/activity/comment-input.tsx b/apps/web/src/components/activity/comment-input.tsx
index 2ca7d11ef..33568386f 100644
--- a/apps/web/src/components/activity/comment-input.tsx
+++ b/apps/web/src/components/activity/comment-input.tsx
@@ -316,9 +316,16 @@ export default function CommentInput({ taskId }: CommentInputProps) {
<TooltipTrigger asChild>
<Button
size="xs"
+ variant="outline"
onClick={handleSubmit}
disabled={isPending || !content.trim()}
- className="h-6 w-6 p-4 text-white"
+ className={cn(
+ "h-6 w-6 border-2",
+ isPending ||
+ (!content.trim() && "opacity-50 cursor-not-allowed"),
+ content.trim().length > 0 &&
+ "bg-background text-sidebar-foreground",
+ )}
>
<SendHorizontal className="size-4" />
</Button>
diff --git a/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx b/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx
index f60badcc0..63cfaa468 100644
--- a/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx
+++ b/apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx
@@ -1,3 +1,4 @@
+import { X } from "lucide-react";
import { useMemo } from "react";
import { toast } from "sonner";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
@@ -163,27 +164,55 @@ export default function TaskCardContextMenuContent({
<ContextMenuSubTrigger>
<span>Due date</span>
</ContextMenuSubTrigger>
- <ContextMenuSubContent className="w-64 p-2">
- <Calendar
- mode="single"
- selected={task.dueDate ? new Date(task.dueDate) : undefined}
- onSelect={async (date) => {
- try {
- await updateTaskDueDate({
- ...task,
- dueDate: date?.toISOString() || null,
- });
- toast.success("Task due date updated successfully");
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : "Failed to update task due date",
- );
- }
- }}
- className="w-full !bg-popover"
- />
+ <ContextMenuSubContent className="w-64 p-0">
+ <div className="p-2">
+ <Calendar
+ mode="single"
+ selected={task.dueDate ? new Date(task.dueDate) : undefined}
+ onSelect={async (date) => {
+ try {
+ await updateTaskDueDate({
+ ...task,
+ dueDate: date?.toISOString() || null,
+ });
+ toast.success("Task due date updated successfully");
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : "Failed to update task due date",
+ );
+ }
+ }}
+ className="w-full bg-popover!"
+ />
+ </div>
+ {task.dueDate && (
+ <>
+ <ContextMenuSeparator />
+ <ContextMenuItem
+ className="gap-2 text-muted-foreground"
+ onClick={async () => {
+ try {
+ await updateTaskDueDate({
+ ...task,
+ dueDate: null,
+ });
+ toast.success("Task due date cleared");
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : "Failed to clear due date",
+ );
+ }
+ }}
+ >
+ <X className="h-4 w-4" />
+ <span>Clear date</span>
+ </ContextMenuItem>
+ </>
+ )}
</ContextMenuSubContent>
</ContextMenuSub>
diff --git a/apps/web/src/components/task/task-details-content.tsx b/apps/web/src/components/task/task-details-content.tsx
index 8499f6383..bb2ab2682 100644
--- a/apps/web/src/components/task/task-details-content.tsx
+++ b/apps/web/src/components/task/task-details-content.tsx
@@ -33,7 +33,7 @@ export default function TaskDetailsContent({
if (!taskId) return null;
return (
- <div className={className}>
+ <div className={`${className} gap-4`}>
<p className="text-xs font-semibold text-muted-foreground">
{project?.slug}-{task?.number}
</p>
@@ -47,8 +47,8 @@ export default function TaskDetailsContent({
/>
</div>
)}
- <span className="text-sm font-medium text-muted-foreground h-[1px] bg-border w-full block mt-4" />
- <div className="flex flex-col gap-4 pt-8">
+ <span className="text-sm font-medium text-muted-foreground h-[1px] bg-border w-full block shrink-0" />
+ <div className="flex flex-col gap-4">
<h1 className="text-md font-semibold">Activity</h1>
{user?.id && taskId && <CommentInput taskId={taskId} />}
<div className="flex flex-col">
diff --git a/apps/web/src/components/task/task-details-sheet.tsx b/apps/web/src/components/task/task-details-sheet.tsx
index a70eb6eb4..651b8158c 100644
--- a/apps/web/src/components/task/task-details-sheet.tsx
+++ b/apps/web/src/components/task/task-details-sheet.tsx
@@ -1,7 +1,8 @@
import { useNavigate } from "@tanstack/react-router";
import { Maximize2, X } from "lucide-react";
-import { useCallback, useEffect, useRef, useState } from "react";
+import { useCallback, useEffect, useState } from "react";
import { Button } from "@/components/ui/button";
+import { Sheet, SheetContent } from "@/components/ui/sheet";
import {
Tooltip,
TooltipContent,
@@ -10,7 +11,6 @@ import {
} from "@/components/ui/tooltip";
import useGetProject from "@/hooks/queries/project/use-get-project";
import useGetTask from "@/hooks/queries/task/use-get-task";
-import { cn } from "@/lib/cn";
import TaskDetailsContent from "./task-details-content";
import TaskPropertiesSidebar from "./task-properties-sidebar";
@@ -28,8 +28,6 @@ export default function TaskDetailsSheet({
onClose,
}: TaskDetailsSheetProps) {
const navigate = useNavigate();
- const panelRef = useRef<HTMLDivElement>(null);
- const [isVisible, setIsVisible] = useState(false);
const [currentTaskId, setCurrentTaskId] = useState<string | undefined>(
taskId,
);
@@ -39,11 +37,10 @@ export default function TaskDetailsSheet({
useEffect(() => {
if (taskId) {
- setIsVisible(true);
// Update taskId immediately without closing/reopening
setCurrentTaskId(taskId);
} else {
- setIsVisible(false);
+ // Delay clearing to allow exit animation
const timer = setTimeout(() => {
setCurrentTaskId(undefined);
}, 300);
@@ -63,69 +60,13 @@ export default function TaskDetailsSheet({
});
}, [navigate, workspaceId, projectId, currentTaskId]);
- useEffect(() => {
- const handleKeyDown = (e: KeyboardEvent) => {
- if (e.key === "Escape" && isVisible) {
- onClose();
- }
- };
-
- document.addEventListener("keydown", handleKeyDown);
- return () => document.removeEventListener("keydown", handleKeyDown);
- }, [isVisible, onClose]);
-
- useEffect(() => {
- const handleClickOutside = (e: MouseEvent) => {
- const target = e.target as HTMLElement;
-
- // Don't close if clicking on a portal element (popover, dropdown, etc.)
- if (
- target.closest('[role="dialog"]') ||
- target.closest("[data-radix-popper-content-wrapper]")
- ) {
- return;
- }
-
- if (isVisible && panelRef.current && !panelRef.current.contains(target)) {
- onClose();
- }
- };
-
- document.addEventListener("mousedown", handleClickOutside);
- return () => document.removeEventListener("mousedown", handleClickOutside);
- }, [isVisible, onClose]);
-
- if (!currentTaskId && !isVisible) {
- return null;
- }
-
return (
- <>
- {/** biome-ignore lint/a11y/noStaticElementInteractions: false positive for onKeyDown and onKeyUp */}
- <div
- className={cn(
- "absolute inset-0 bg-black/50 z-30 transition-opacity duration-300",
- isVisible ? "opacity-100" : "opacity-0 pointer-events-none",
- )}
- onKeyDown={(e) => {
- if (e.key === "Escape") {
- onClose();
- }
- }}
- onKeyUp={(e) => {
- if (e.key === "Escape") {
- onClose();
- }
- }}
- />
- <div
- ref={panelRef}
- className={cn(
- "absolute top-0 right-0 bottom-0 w-full max-w-full sm:max-w-md md:max-w-lg lg:max-w-2xl bg-background border-l border-border shadow-xl z-40 flex flex-col transform transition-transform duration-300 ease-in-out",
- isVisible ? "translate-x-0" : "translate-x-full",
- )}
+ <Sheet open={!!taskId} onOpenChange={(open) => !open && onClose()}>
+ <SheetContent
+ side="right"
+ className="w-full max-w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl p-0 gap-0 [&>button]:hidden"
>
- <div className="flex items-center justify-between px-3 py-2 border-b border-border bg-background shrink-0">
+ <div className="flex items-center justify-between px-4 py-2.5 border-b border-border bg-background shrink-0">
<div className="flex items-center gap-2">
<span className="text-sm font-medium text-muted-foreground">
{project?.slug}-{task?.number}
@@ -171,17 +112,17 @@ export default function TaskDetailsSheet({
/>
<div className="flex-1 overflow-y-auto">
- <div className="px-3 py-3">
+ <div className="px-4 py-4">
<TaskDetailsContent
taskId={currentTaskId}
projectId={projectId}
workspaceId={workspaceId}
- className="flex flex-col gap-2"
+ className="flex flex-col gap-3"
/>
</div>
</div>
</div>
- </div>
- </>
+ </SheetContent>
+ </Sheet>
);
}
diff --git a/apps/web/src/components/task/task-due-date-popover.tsx b/apps/web/src/components/task/task-due-date-popover.tsx
index c46151edf..ad0b67a40 100644
--- a/apps/web/src/components/task/task-due-date-popover.tsx
+++ b/apps/web/src/components/task/task-due-date-popover.tsx
@@ -1,5 +1,7 @@
+import { X } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
+import { Button } from "@/components/ui/button";
import { Calendar } from "@/components/ui/calendar";
import {
Popover,
@@ -48,6 +50,19 @@ export default function TaskDueDatePopover({
onSelect={handleDateChange}
className="w-full bg-popover"
/>
+ {task.dueDate && (
+ <div className="p-2 border-t border-border">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="w-full justify-start gap-2 text-muted-foreground hover:text-foreground"
+ onClick={() => handleDateChange(undefined)}
+ >
+ <X className="h-4 w-4" />
+ Clear date
+ </Button>
+ </div>
+ )}
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-properties-sidebar.tsx b/apps/web/src/components/task/task-properties-sidebar.tsx
index becdb6e29..7055ecceb 100644
--- a/apps/web/src/components/task/task-properties-sidebar.tsx
+++ b/apps/web/src/components/task/task-properties-sidebar.tsx
@@ -82,7 +82,7 @@ export default function TaskPropertiesSidebar({
const { data: task } = useGetTask(taskId ?? "");
const { data: project } = useGetProject({ id: projectId, workspaceId });
const { data: workspaceUsers } = useGetActiveWorkspaceUsers(workspaceId);
- const { data: taskLabels = [] } = useGetLabelsByTask(taskId);
+ const { data: taskLabels = [] } = useGetLabelsByTask(taskId ?? "");
const { data: githubIntegration } = useGetGithubIntegration(projectId);
const projectSlug = project?.slug;
@@ -113,166 +113,475 @@ export default function TaskPropertiesSidebar({
return (
<div className={className}>
- <div className="flex gap-2 px-3 py-2">
- <p className="text-sm font-medium text-muted-foreground flex-1">
- Properties
- </p>
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="xs"
- className="text-muted-foreground"
- onClick={() => handleCopyTaskLink()}
- >
- <Copy className="size-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <KbdSequence
- keys={["Ctrl", "Shift", "C"]}
- description="Copy task link"
- separator=""
- />
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
-
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="xs"
- className="text-muted-foreground"
- onClick={() => handleCopyTaskBranch()}
- >
- <GitBranch className="size-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <KbdSequence
- keys={["Ctrl", "Shift", "G"]}
- description="Copy task branch"
- separator=""
- />
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- </div>
+ {/* Compact mode: properties + icons in one row */}
+ {compact && (
+ <div className="flex flex-row-reverse gap-2 w-full border-b border-border">
+ <div className="flex gap-2 px-3 py-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskLink()}
+ >
+ <Copy className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "C"]}
+ description="Copy task link"
+ separator=""
+ />
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
- <div
- className={
- compact
- ? "flex flex-row flex-wrap gap-1 items-start px-3 pb-2"
- : "flex flex-row flex-wrap lg:flex-col gap-1 lg:gap-2 items-start px-3 lg:px-4 pb-3 lg:pb-0"
- }
- >
- {task && (
- <TaskStatusPopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1"
- >
- {getColumnIcon(task.status ?? "")}
- <span className="text-xs font-semibold truncate">
- {toNormalCase(task.status)}
- </span>
- </Button>
- </TaskStatusPopover>
- )}
- {task && (
- <TaskPriorityPopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1"
- >
- {getPriorityIcon(task.priority ?? "")}
- <span className="text-xs font-semibold truncate">
- {toNormalCase(task.priority ?? "")}
- </span>
- </Button>
- </TaskPriorityPopover>
- )}
- {task && (
- <TaskAssigneePopover task={task} workspaceId={workspaceId}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1"
- >
- {task.userId ? (
- <Avatar className="h-[16px] w-[16px]">
- <AvatarImage
- src={assignee?.user?.image ?? ""}
- alt={assignee?.user?.name || ""}
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskBranch()}
+ >
+ <GitBranch className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "G"]}
+ description="Copy task branch"
+ separator=""
/>
- <AvatarFallback className="text-[9px] font-medium border border-border/30 flex-shrink-0 h-[16px] w-[16px]">
- {assignee?.user?.name?.charAt(0).toUpperCase()}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center flex-shrink-0"
- title="Unassigned"
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+
+ <div className="flex flex-row flex-wrap gap-1 items-center p-2 w-full">
+ {task && (
+ <TaskStatusPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
>
- <span className="text-[8px] font-medium">?</span>
- </div>
- )}
- <span className="text-xs font-semibold truncate max-w-[100px]">
- {assignee?.user?.name || task.assigneeName || "Unassigned"}
- </span>
- </Button>
- </TaskAssigneePopover>
- )}
- {task && (
- <TaskDueDatePopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1"
- >
- {task.dueDate ? (
- <>
- {getDueDateStatus(task.dueDate) === "overdue" && (
- <CalendarX
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
- />
+ {getColumnIcon(task.status ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.status)}
+ </span>
+ </Button>
+ </TaskStatusPopover>
+ )}
+ {task && (
+ <TaskPriorityPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {getPriorityIcon(task.priority ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.priority ?? "")}
+ </span>
+ </Button>
+ </TaskPriorityPopover>
+ )}
+ {task && (
+ <TaskAssigneePopover task={task} workspaceId={workspaceId}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {task.userId ? (
+ <Avatar className="h-[16px] w-[16px]">
+ <AvatarImage
+ src={assignee?.user?.image ?? ""}
+ alt={assignee?.user?.name || ""}
+ />
+ <AvatarFallback className="text-[9px] font-medium border border-border/30 flex-shrink-0 h-[16px] w-[16px]">
+ {assignee?.user?.name?.charAt(0).toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ ) : (
+ <div
+ className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center flex-shrink-0"
+ title="Unassigned"
+ >
+ <span className="text-[8px] font-medium">?</span>
+ </div>
)}
- {getDueDateStatus(task.dueDate) === "due-soon" && (
- <CalendarClock
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
- />
+ <span className="text-xs font-semibold truncate max-w-[100px]">
+ {assignee?.user?.name || task.assigneeName || "Unassigned"}
+ </span>
+ </Button>
+ </TaskAssigneePopover>
+ )}
+ {task && (
+ <TaskDueDatePopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {task.dueDate ? (
+ <>
+ {getDueDateStatus(task.dueDate) === "overdue" && (
+ <CalendarX
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {getDueDateStatus(task.dueDate) === "due-soon" && (
+ <CalendarClock
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {(getDueDateStatus(task.dueDate) === "far-future" ||
+ getDueDateStatus(task.dueDate) === "no-due-date") && (
+ <Calendar
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ <span className="text-xs font-semibold">
+ {format(new Date(task.dueDate), "MMM d")}
+ </span>
+ </>
+ ) : (
+ <>
+ <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
+ <span className="text-xs font-semibold text-muted-foreground">
+ No date
+ </span>
+ </>
)}
- {(getDueDateStatus(task.dueDate) === "far-future" ||
- getDueDateStatus(task.dueDate) === "no-due-date") && (
- <Calendar
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ </Button>
+ </TaskDueDatePopover>
+ )}
+ </div>
+ </div>
+ )}
+
+ {!compact && (
+ <>
+ {/* Mobile: Compact-style layout */}
+ <div className="flex flex-row-reverse gap-2 w-full border-b border-border lg:hidden">
+ <div className="flex gap-2 px-3 py-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskLink()}
+ >
+ <Copy className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "C"]}
+ description="Copy task link"
+ separator=""
/>
- )}
- <span className="text-xs font-semibold">
- {format(new Date(task.dueDate), "MMM d")}
- </span>
- </>
- ) : (
- <>
- <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
- <span className="text-xs font-semibold text-muted-foreground">
- No date
- </span>
- </>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskBranch()}
+ >
+ <GitBranch className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "G"]}
+ description="Copy task branch"
+ separator=""
+ />
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+
+ <div className="flex flex-row flex-wrap gap-1 items-center p-2 w-full">
+ {task && (
+ <TaskStatusPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {getColumnIcon(task.status ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.status)}
+ </span>
+ </Button>
+ </TaskStatusPopover>
)}
- </Button>
- </TaskDueDatePopover>
- )}
- </div>
+ {task && (
+ <TaskPriorityPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {getPriorityIcon(task.priority ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.priority ?? "")}
+ </span>
+ </Button>
+ </TaskPriorityPopover>
+ )}
+ {task && (
+ <TaskAssigneePopover task={task} workspaceId={workspaceId}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {task.userId ? (
+ <Avatar className="h-[16px] w-[16px]">
+ <AvatarImage
+ src={assignee?.user?.image ?? ""}
+ alt={assignee?.user?.name || ""}
+ />
+ <AvatarFallback className="text-[9px] font-medium border border-border/30 shrink-0 h-[16px] w-[16px]">
+ {assignee?.user?.name?.charAt(0).toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ ) : (
+ <div
+ className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center shrink-0"
+ title="Unassigned"
+ >
+ <span className="text-[8px] font-medium">?</span>
+ </div>
+ )}
+ <span className="text-xs font-semibold truncate max-w-[100px]">
+ {assignee?.user?.name ||
+ task.assigneeName ||
+ "Unassigned"}
+ </span>
+ </Button>
+ </TaskAssigneePopover>
+ )}
+ {task && (
+ <TaskDueDatePopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1"
+ >
+ {task.dueDate ? (
+ <>
+ {getDueDateStatus(task.dueDate) === "overdue" && (
+ <CalendarX
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {getDueDateStatus(task.dueDate) === "due-soon" && (
+ <CalendarClock
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {(getDueDateStatus(task.dueDate) === "far-future" ||
+ getDueDateStatus(task.dueDate) === "no-due-date") && (
+ <Calendar
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ <span className="text-xs font-semibold">
+ {format(new Date(task.dueDate), "MMM d")}
+ </span>
+ </>
+ ) : (
+ <>
+ <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
+ <span className="text-xs font-semibold text-muted-foreground">
+ No date
+ </span>
+ </>
+ )}
+ </Button>
+ </TaskDueDatePopover>
+ )}
+ </div>
+ </div>
+
+ {/* Desktop: Title + stacked properties */}
+ <div className="hidden lg:block">
+ <div className="flex items-center justify-between px-3 py-2 border-b border-border lg:border-none">
+ <p className="text-sm font-medium text-muted-foreground flex-1">
+ Properties
+ </p>
+ <div className="flex gap-2">
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskLink()}
+ >
+ <Copy className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "C"]}
+ description="Copy task link"
+ separator=""
+ />
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="xs"
+ className="text-muted-foreground"
+ onClick={() => handleCopyTaskBranch()}
+ >
+ <GitBranch className="size-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <KbdSequence
+ keys={["Ctrl", "Shift", "G"]}
+ description="Copy task branch"
+ separator=""
+ />
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ </div>
+ </div>
- <div className="hidden lg:block w-full h-[1px] bg-border my-2" />
+ <div className="flex flex-col gap-2 px-3 py-3">
+ {task && (
+ <TaskStatusPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1 w-full"
+ >
+ {getColumnIcon(task.status ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.status)}
+ </span>
+ </Button>
+ </TaskStatusPopover>
+ )}
+ {task && (
+ <TaskPriorityPopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1 w-full"
+ >
+ {getPriorityIcon(task.priority ?? "")}
+ <span className="text-xs font-semibold truncate">
+ {toNormalCase(task.priority ?? "")}
+ </span>
+ </Button>
+ </TaskPriorityPopover>
+ )}
+ {task && (
+ <TaskAssigneePopover task={task} workspaceId={workspaceId}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1 w-full"
+ >
+ {task.userId ? (
+ <Avatar className="h-[16px] w-[16px]">
+ <AvatarImage
+ src={assignee?.user?.image ?? ""}
+ alt={assignee?.user?.name || ""}
+ />
+ <AvatarFallback className="text-[9px] font-medium border border-border/30 shrink-0 h-[16px] w-[16px]">
+ {assignee?.user?.name?.charAt(0).toUpperCase()}
+ </AvatarFallback>
+ </Avatar>
+ ) : (
+ <div
+ className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center shrink-0"
+ title="Unassigned"
+ >
+ <span className="text-[8px] font-medium">?</span>
+ </div>
+ )}
+ <span className="text-xs font-semibold truncate max-w-[100px]">
+ {assignee?.user?.name ||
+ task.assigneeName ||
+ "Unassigned"}
+ </span>
+ </Button>
+ </TaskAssigneePopover>
+ )}
+ {task && (
+ <TaskDueDatePopover task={task}>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="justify-start h-7 px-1.5 gap-1 w-full"
+ >
+ {task.dueDate ? (
+ <>
+ {getDueDateStatus(task.dueDate) === "overdue" && (
+ <CalendarX
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {getDueDateStatus(task.dueDate) === "due-soon" && (
+ <CalendarClock
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ {(getDueDateStatus(task.dueDate) === "far-future" ||
+ getDueDateStatus(task.dueDate) === "no-due-date") && (
+ <Calendar
+ className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate)]}`}
+ />
+ )}
+ <span className="text-xs font-semibold">
+ {format(new Date(task.dueDate), "MMM d")}
+ </span>
+ </>
+ ) : (
+ <>
+ <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
+ <span className="text-xs font-semibold text-muted-foreground">
+ No date
+ </span>
+ </>
+ )}
+ </Button>
+ </TaskDueDatePopover>
+ )}
+ </div>
+ </div>
+ </>
+ )}
- <div className="hidden lg:flex px-3 lg:px-2 pb-3 lg:pb-4 flex-col gap-3">
+ <div className="hidden lg:flex px-3 flex-col gap-3 p-2">
<div className="flex flex-col gap-1">
<span className="text-xs font-medium text-muted-foreground px-2">
Labels
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
index bec8c1542..b95cd8ca4 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_.tsx
@@ -39,7 +39,7 @@ function RouteComponent() {
taskId={taskId}
projectId={projectId}
workspaceId={workspaceId}
- className="flex flex-col h-full min-h-0 max-w-3xl mx-auto px-3 sm:px-4 py-4 sm:py-8 gap-2"
+ className="flex flex-col h-full min-h-0 max-w-3xl mx-auto px-3 sm:px-4 xl:py-8 py-2 gap-2"
/>
</TaskLayout>
);