⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
refactor: simplify task details sheet structure and add keyboard escape functionality for closing
Andrej Acevskic442d6f0e24a
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.tsxindex 48822c626..f60badcc0 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@@ -243,7 +243,6 @@ export default function TaskCardContextMenuContent({className="text-destructive"onClick={(e) => {e.preventDefault();- // Delay to ensure context menu closes before dialog openssetTimeout(() => {onDeleteClick();}, 0);diff --git a/apps/web/src/components/task/task-details-sheet.tsx b/apps/web/src/components/task/task-details-sheet.tsxindex 904e07796..a70eb6eb4 100644--- a/apps/web/src/components/task/task-details-sheet.tsx+++ b/apps/web/src/components/task/task-details-sheet.tsx@@ -100,69 +100,88 @@ export default function TaskDetailsSheet({}return (- <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",- )}- >- <div className="flex items-center justify-between px-3 py-2 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}- </span>- </div>- <div className="flex items-center gap-1">- <TooltipProvider>- <Tooltip>- <TooltipTrigger asChild>- <Button- variant="ghost"- size="sm"- onClick={handleOpenFullPage}- className="text-muted-foreground hover:text-foreground"- >- <Maximize2 className="size-4" />- </Button>- </TooltipTrigger>- <TooltipContent>Open in full page</TooltipContent>- </Tooltip>- </TooltipProvider>- <Button- variant="ghost"- size="sm"- onClick={onClose}- className="text-muted-foreground hover:text-foreground"- >- <X className="size-4" />- </Button>- </div>- </div>-+ <>+ {/** 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- className="flex flex-col flex-1 min-h-0 overflow-hidden"- key={currentTaskId}+ 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",+ )}>- <TaskPropertiesSidebar- taskId={currentTaskId}- projectId={projectId}- workspaceId={workspaceId}- className="w-full bg-sidebar border-b border-border flex flex-col gap-0 overflow-y-auto shrink-0"- compact={true}- />+ <div className="flex items-center justify-between px-3 py-2 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}+ </span>+ </div>+ <div className="flex items-center gap-1">+ <TooltipProvider>+ <Tooltip>+ <TooltipTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ onClick={handleOpenFullPage}+ className="text-muted-foreground hover:text-foreground"+ >+ <Maximize2 className="size-4" />+ </Button>+ </TooltipTrigger>+ <TooltipContent>Open in full page</TooltipContent>+ </Tooltip>+ </TooltipProvider>+ <Button+ variant="ghost"+ size="sm"+ onClick={onClose}+ className="text-muted-foreground hover:text-foreground"+ >+ <X className="size-4" />+ </Button>+ </div>+ </div>++ <div+ className="flex flex-col flex-1 min-h-0 overflow-hidden"+ key={currentTaskId}+ >+ <TaskPropertiesSidebar+ taskId={currentTaskId}+ projectId={projectId}+ workspaceId={workspaceId}+ className="w-full bg-sidebar border-b border-border flex flex-col gap-0 overflow-y-auto shrink-0"+ compact={true}+ />- <div className="flex-1 overflow-y-auto">- <div className="px-3 py-3">- <TaskDetailsContent- taskId={currentTaskId}- projectId={projectId}- workspaceId={workspaceId}- className="flex flex-col gap-2"- />+ <div className="flex-1 overflow-y-auto">+ <div className="px-3 py-3">+ <TaskDetailsContent+ taskId={currentTaskId}+ projectId={projectId}+ workspaceId={workspaceId}+ className="flex flex-col gap-2"+ />+ </div></div></div></div>- </div>+ </>);}