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(web): polish kanban and backlog interactions

Andrej041cd87eb74b
diff --git a/apps/web/src/components/kanban-board/column/column-dropzone.tsx b/apps/web/src/components/kanban-board/column/column-dropzone.tsx
index 867c876ae..ee77c79c9 100644
--- a/apps/web/src/components/kanban-board/column/column-dropzone.tsx
+++ b/apps/web/src/components/kanban-board/column/column-dropzone.tsx
@@ -34,7 +34,7 @@ export function ColumnDropzone({
items={column.tasks}
strategy={verticalListSortingStrategy}
>
- <div className="flex flex-col gap-1.5">
+ <div className="flex flex-col gap-2">
{column.tasks.map((task) => (
<TaskCard key={task.id} task={task} />
))}
diff --git a/apps/web/src/components/kanban-board/column/column-header.tsx b/apps/web/src/components/kanban-board/column/column-header.tsx
index c5e26394f..ba1ebe53a 100644
--- a/apps/web/src/components/kanban-board/column/column-header.tsx
+++ b/apps/web/src/components/kanban-board/column/column-header.tsx
@@ -1,8 +1,8 @@
import { produce } from "immer";
import { Archive } from "lucide-react";
-import { toast } from "@/lib/toast";
import { useUpdateTask } from "@/hooks/mutations/task/use-update-task";
import { getColumnIcon } from "@/lib/column";
+import { toast } from "@/lib/toast";
import useProjectStore from "@/store/project";
import type { ProjectWithTasks } from "@/types/project";
@@ -45,13 +45,15 @@ export function ColumnHeader({ column }: ColumnHeaderProps) {
};
return (
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-2">
- {getColumnIcon(column.id, column.isFinal)}
- <span className="text-[15px] font-medium text-foreground/95">
+ <div className="flex items-center justify-between gap-2">
+ <div className="flex min-w-0 items-center gap-2">
+ <span className="text-muted-foreground">
+ {getColumnIcon(column.id, column.isFinal)}
+ </span>
+ <span className="truncate text-sm font-medium text-foreground/95">
{column.name}
</span>
- <span className="text-[15px] font-normal text-muted-foreground">
+ <span className="rounded-md bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground">
{column.tasks.length}
</span>
</div>
@@ -60,7 +62,7 @@ export function ColumnHeader({ column }: ColumnHeaderProps) {
<button
type="button"
onClick={handleArchiveTasks}
- className="text-left px-2 py-1.5 text-muted-foreground hover:bg-accent/50 rounded-md flex items-center transition-all group"
+ className="flex items-center rounded-md px-2 py-1 text-left text-muted-foreground transition-all hover:bg-accent/50"
title="Archive all completed tasks"
>
<Archive className="w-4 h-4 text-muted-foreground" />
diff --git a/apps/web/src/components/kanban-board/column/index.tsx b/apps/web/src/components/kanban-board/column/index.tsx
index ac93631f0..b51b65cf0 100644
--- a/apps/web/src/components/kanban-board/column/index.tsx
+++ b/apps/web/src/components/kanban-board/column/index.tsx
@@ -16,10 +16,10 @@ function Column({ column }: ColumnProps) {
return (
<div
- className={`group relative flex h-full min-h-0 w-full flex-col rounded-lg border transition-all duration-300 ease-out ${
+ className={`group relative flex h-full min-h-0 w-full flex-col rounded-xl border transition-all duration-300 ease-out ${
isDropzoneOver
- ? "border-ring/40 bg-accent/55 shadow-sm ring-2 ring-ring/30"
- : "border-border bg-muted/45 shadow-xs/5 hover:bg-muted/60 hover:shadow-sm"
+ ? "border-ring/40 bg-accent/60 shadow-md ring-2 ring-ring/30"
+ : "border-border/70 bg-muted/40 shadow-xs/5 hover:border-border/90 dark:bg-card/90"
}`}
>
<CreateTaskModal
@@ -28,19 +28,19 @@ function Column({ column }: ColumnProps) {
status={toKebabCase(column.name)}
/>
- <div className="p-2 shrink-0">
+ <div className="shrink-0 border-b border-border/60 px-3 py-2">
<ColumnHeader column={column} />
</div>
- <div className="p-2 overflow-y-auto overflow-x-hidden flex-1 min-h-0 [-webkit-overflow-scrolling:touch]">
+ <div className="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-2 py-2 [-webkit-overflow-scrolling:touch]">
<ColumnDropzone column={column} onIsOverChange={setIsDropzoneOver} />
</div>
- <div className="p-1.5 md:opacity-0 md:group-hover:opacity-100 transition-opacity">
+ <div className="border-t border-border/60 p-1.5 transition-opacity md:opacity-0 md:group-hover:opacity-100">
<button
type="button"
onClick={() => setIsTaskModalOpen(true)}
- className="w-full text-left px-2 py-1 text-sm text-muted-foreground hover:text-foreground hover:bg-accent/40 rounded-md flex items-center gap-2 transition-all"
+ className="flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-muted-foreground transition-all hover:bg-accent/50 hover:text-foreground"
>
<Plus className="w-4 h-4" />
<span>Add task</span>
diff --git a/apps/web/src/components/kanban-board/index.tsx b/apps/web/src/components/kanban-board/index.tsx
index ad04566f1..0cd2a7138 100644
--- a/apps/web/src/components/kanban-board/index.tsx
+++ b/apps/web/src/components/kanban-board/index.tsx
@@ -181,22 +181,22 @@ function KanbanBoard({ project }: KanbanBoardProps) {
if (!project || !project?.columns) {
return (
- <div className="h-full flex flex-col w-full">
+ <div className="flex h-full w-full flex-col bg-linear-to-b from-muted/25 to-background">
<header className="mb-6 mt-6 space-y-6 shrink-0 px-6">
<div className="flex items-center justify-between">
<div className="w-48 h-8 bg-muted/50 rounded-md animate-pulse" />
</div>
</header>
- <div className="flex-1 relative min-h-0">
- <div className="flex gap-6 flex-1 overflow-x-auto pb-4 px-4 md:px-6 h-full">
+ <div className="relative min-h-0 flex-1">
+ <div className="flex h-full flex-1 gap-4 overflow-x-auto px-4 pb-4 md:px-5">
{[...Array(4)].map((_, i) => (
<div
key={`kanban-column-skeleton-${
// biome-ignore lint/suspicious/noArrayIndexKey: It's a skeleton
i
}`}
- className="flex-1 w-full min-w-80 flex flex-col bg-background rounded-lg h-full"
+ className="h-full min-w-80 w-full flex-1 rounded-xl border border-border/70 bg-card"
>
<div className="px-4 py-3 flex items-center justify-between">
<div className="w-24 h-5 bg-muted/50 rounded animate-pulse" />
@@ -240,13 +240,13 @@ function KanbanBoard({ project }: KanbanBoardProps) {
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
>
- <div className="h-full flex flex-col w-full">
- <div className="flex-1 min-h-0 overflow-x-auto bg-background [-webkit-overflow-scrolling:touch]">
- <div className="flex gap-3 p-3 h-full min-w-max transition-all duration-200 ease-out">
+ <div className="flex h-full w-full flex-col bg-linear-to-b from-muted/20 to-background">
+ <div className="min-h-0 flex-1 overflow-x-auto [-webkit-overflow-scrolling:touch]">
+ <div className="flex h-full min-w-max gap-4 px-4 py-4 transition-all duration-200 ease-out md:px-5">
{project.columns?.map((column) => (
<div
key={column.id}
- className="h-full flex-1 min-w-80 max-w-96 shrink-0"
+ className="h-full max-w-96 min-w-80 shrink-0 flex-1"
>
<Column column={column} />
</div>
diff --git a/apps/web/src/components/kanban-board/task-card.tsx b/apps/web/src/components/kanban-board/task-card.tsx
index 5a2d68c0c..8dcc5a047 100644
--- a/apps/web/src/components/kanban-board/task-card.tsx
+++ b/apps/web/src/components/kanban-board/task-card.tsx
@@ -10,11 +10,9 @@ import {
GitPullRequest,
} from "lucide-react";
import { type CSSProperties, useMemo, useState } from "react";
-import { toast } from "@/lib/toast";
import {
AlertDialog,
AlertDialogClose,
-
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
@@ -33,6 +31,7 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";
import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";
import { dueDateStatusColors, getDueDateStatus } from "@/lib/due-date-status";
import { getPriorityIcon } from "@/lib/priority";
+import { toast } from "@/lib/toast";
import queryClient from "@/query-client";
import useBulkSelectionStore from "@/store/bulk-selection";
import useProjectStore from "@/store/project";
@@ -177,11 +176,11 @@ function TaskCard({ task }: TaskCardProps) {
{/** biome-ignore lint/a11y/noStaticElementInteractions: false positive for onClick and onKeyDown */}
<div
onClick={handleTaskCardClick}
- className={`group bg-card border border-border rounded-lg p-3 cursor-move transition-all duration-200 ease-out relative ${
+ className={`group relative cursor-move rounded-lg border border-border bg-background p-3 shadow-xs/5 transition-all duration-200 ease-out ${
isDragging
- ? "border-ring/40 shadow-lg bg-card/95"
- : "hover:border-border/70 hover:shadow-sm"
- } ${isTaskSelected ? "bg-accent/50 shadow-sm" : ""} ${isTaskFocused ? "ring-2 ring-inset ring-ring/50" : ""}`}
+ ? "border-ring/40 bg-card shadow-lg"
+ : "hover:border-border/90 hover:bg-background hover:shadow-sm"
+ } ${isTaskSelected ? "bg-accent/45 shadow-sm" : ""} ${isTaskFocused ? "ring-2 ring-inset ring-ring/50" : ""}`}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleTaskCardClick(e);
@@ -191,7 +190,7 @@ function TaskCard({ task }: TaskCardProps) {
}}
>
{showTaskNumbers && (
- <div className="text-[10px] font-mono text-muted-foreground mb-2">
+ <div className="mb-2 text-[10px] font-mono text-muted-foreground/90">
{project?.slug}-{task.number}
</div>
)}
@@ -199,7 +198,7 @@ function TaskCard({ task }: TaskCardProps) {
{showAssignees && (
<div className="absolute top-3 right-3">
{task.userId ? (
- <Avatar className="h-6 w-6">
+ <Avatar className="h-5 w-5">
<AvatarImage
src={assignee?.user?.image ?? ""}
alt={assignee?.user?.name || ""}
@@ -210,7 +209,7 @@ function TaskCard({ task }: TaskCardProps) {
</Avatar>
) : (
<div
- className="w-6 h-6 rounded-full bg-muted border border-border flex items-center justify-center"
+ className="flex h-5 w-5 items-center justify-center rounded-full border border-border bg-muted"
title="Unassigned"
>
<span className="text-[10px] font-medium text-muted-foreground">
@@ -221,9 +220,9 @@ function TaskCard({ task }: TaskCardProps) {
</div>
)}
- <div className="mb-3 pr-7">
+ <div className="mb-2.5 pr-6">
<div
- className="text-[15px] font-medium text-foreground/95 leading-6 overflow-hidden break-words"
+ className="overflow-hidden break-words text-sm leading-5 font-medium text-foreground/95"
style={{
display: "-webkit-box",
WebkitLineClamp: 3,
@@ -237,14 +236,14 @@ function TaskCard({ task }: TaskCardProps) {
</div>
{showLabels && (
- <div className="mb-3">
+ <div className="mb-2.5">
<TaskCardLabels taskId={task.id} />
</div>
)}
- <div className="flex items-center gap-2">
+ <div className="flex items-center gap-1.5">
{showPriority && (
- <span className="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-sidebar text-[10px] font-medium text-muted-foreground">
+ <span className="inline-flex items-center gap-1 rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] font-medium text-muted-foreground">
{getPriorityIcon(task.priority ?? "")}
</span>
)}
@@ -276,7 +275,7 @@ function TaskCard({ task }: TaskCardProps) {
e.stopPropagation();
window.open(pullRequests[0].url, "_blank");
}}
- className="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-sidebar text-[10px] font-medium text-muted-foreground"
+ className="inline-flex items-center gap-1.5 rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] font-medium text-muted-foreground"
>
{getPRInfo(pullRequests[0]).icon}
<span>#{pullRequests[0].externalId}</span>
@@ -323,7 +322,7 @@ function TaskCard({ task }: TaskCardProps) {
<button
type="button"
onClick={(e) => e.stopPropagation()}
- className="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-border bg-sidebar text-[10px] font-medium text-muted-foreground"
+ className="inline-flex items-center gap-1.5 rounded border border-border/70 bg-muted/55 px-2 py-1 text-[10px] font-medium text-muted-foreground"
>
<GitPullRequest className={`h-3 w-3 ${iconColor}`} />
<span>{pullRequests.length} PRs</span>
diff --git a/apps/web/src/components/search-command-menu/index.tsx b/apps/web/src/components/search-command-menu/index.tsx
index cddd34a3a..f95c0550c 100644
--- a/apps/web/src/components/search-command-menu/index.tsx
+++ b/apps/web/src/components/search-command-menu/index.tsx
@@ -53,6 +53,14 @@ type SearchCommandMenuProps = {
setOpen: (open: boolean) => void;
};
+const GROUP_LABELS: Record<SearchResultItem["type"], string> = {
+ task: "Tasks",
+ project: "Projects",
+ workspace: "Workspaces",
+ comment: "Comments",
+ activity: "Activities",
+};
+
function SearchCommandMenu({ open, setOpen }: SearchCommandMenuProps) {
const [query, setQuery] = useState("");
const { data: workspace } = useActiveWorkspace();
@@ -152,23 +160,6 @@ function SearchCommandMenu({ open, setOpen }: SearchCommandMenuProps) {
}
};
- const getGroupLabel = (type: string) => {
- switch (type) {
- case "task":
- return "Tasks";
- case "project":
- return "Projects";
- case "workspace":
- return "Workspaces";
- case "comment":
- return "Comments";
- case "activity":
- return "Activities";
- default:
- return "Results";
- }
- };
-
const groupedItems = useMemo<SearchGroup[]>(() => {
if (!searchEnabled) return [];
const results = (searchResults?.results ?? []) as SearchResultItem[];
@@ -183,7 +174,7 @@ function SearchCommandMenu({ open, setOpen }: SearchCommandMenuProps) {
return Object.entries(grouped).map(([type, items]) => ({
value: type,
- label: getGroupLabel(type),
+ label: GROUP_LABELS[type as SearchResultItem["type"]] ?? "Results",
items,
}));
}, [searchEnabled, searchResults?.results]);
@@ -200,7 +191,7 @@ function SearchCommandMenu({ open, setOpen }: SearchCommandMenuProps) {
<CommandInput
placeholder="Search tasks, projects, comments..."
value={query}
- onValueChange={setQuery}
+ onChange={(event) => setQuery(event.target.value)}
/>
<CommandPanel>
<CommandEmpty>
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
index 9ab3f06a9..1c03e03b6 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog.tsx
@@ -3,7 +3,6 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
import { produce } from "immer";
import { ArrowRight, Calendar, Filter, Plus, User, X } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
-import { toast } from "@/lib/toast";
import BacklogListView from "@/components/backlog-list-view";
import ProjectLayout from "@/components/common/project-layout";
import PageTitle from "@/components/page-title";
@@ -29,6 +28,7 @@ import { useGetTasks } from "@/hooks/queries/task/use-get-tasks";
import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";
import { useRegisterShortcuts } from "@/hooks/use-keyboard-shortcuts";
import { getPriorityIcon } from "@/lib/priority";
+import { toast } from "@/lib/toast";
import useProjectStore from "@/store/project";
import { useUserPreferencesStore } from "@/store/user-preferences";
import type Task from "@/types/task";
@@ -318,13 +318,17 @@ function RouteComponent() {
};
return (
- <ProjectLayout projectId={projectId} workspaceId={workspaceId}>
+ <ProjectLayout
+ projectId={projectId}
+ workspaceId={workspaceId}
+ activeView="backlog"
+ >
<PageTitle title={`${project?.name}'s backlog`} />
<div className="relative flex flex-col h-full min-h-0 overflow-hidden">
- <div className="bg-card border-b border-border/80">
- <div className="h-10 flex items-center px-4">
- <div className="flex items-center justify-between w-full">
- <div className="flex items-center gap-2">
+ <div className="border-border/80 border-b bg-card/80 backdrop-blur supports-[backdrop-filter]:bg-card/70">
+ <div className="flex min-h-12 items-center px-3 py-2 md:px-4">
+ <div className="flex w-full items-center gap-2">
+ <div className="flex w-full flex-wrap items-center gap-1.5">
<Button
variant="ghost"
size="xs"
@@ -466,17 +470,14 @@ function RouteComponent() {
<Button
variant="outline"
size="sm"
- className="h-8 gap-2 px-3 font-medium text-foreground"
+ className="h-7 gap-2 px-2.5 text-xs font-medium text-foreground"
/>
}
>
<Filter className="h-3.5 w-3.5" />
Filter
</DropdownMenuTrigger>
- <DropdownMenuContent
- className="w-80"
- align="start"
- >
+ <DropdownMenuContent className="w-80" align="start">
<DropdownMenuItem
disabled
className="h-8 rounded-md border border-border/80 bg-card text-sm text-muted-foreground"
@@ -525,7 +526,10 @@ function RouteComponent() {
key={member.userId}
checked={filters.assignee === member.userId}
onCheckedChange={(checked) =>
- updateFilter("assignee", checked ? member.userId : null)
+ updateFilter(
+ "assignee",
+ checked ? member.userId : null,
+ )
}
className="h-8 rounded-md text-sm"
>
@@ -586,8 +590,9 @@ function RouteComponent() {
className="w-3 h-3 rounded-full flex-shrink-0"
style={{
backgroundColor:
- labelColors.find((c) => c.value === label.color)
- ?.color || "var(--color-neutral-400)",
+ labelColors.find(
+ (c) => c.value === label.color,
+ )?.color || "var(--color-neutral-400)",
}}
/>
<span>{label.name}</span>