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): redesign task details

Andrejd9cb5558893c
diff --git a/apps/web/src/components/activity/comment-card.tsx b/apps/web/src/components/activity/comment-card.tsx
index 147b76810..23b4f0d67 100644
--- a/apps/web/src/components/activity/comment-card.tsx
+++ b/apps/web/src/components/activity/comment-card.tsx
@@ -150,18 +150,18 @@ export default function CommentCard({
return (
<TooltipProvider>
- <div className="group relative w-full rounded-xl border border-border/80 bg-card/60">
- <div className="flex flex-wrap items-center gap-2 px-3 pt-2.5">
+ <div className="group relative w-full rounded-lg border border-border/80 bg-foreground/2">
+ <div className="flex flex-wrap items-center gap-2 px-3 pt-3">
<HoverCard>
<HoverCardTrigger>
<div className="flex cursor-pointer items-center gap-2">
- <Avatar className="h-6 w-6">
+ <Avatar className="size-5">
<AvatarImage src={user?.image ?? ""} alt={user?.name || ""} />
- <AvatarFallback className="bg-muted text-xs font-medium">
+ <AvatarFallback className="bg-muted font-semibold text-[9px]">
{getInitials(user?.name)}
</AvatarFallback>
</Avatar>
- <span className="text-sm font-medium text-foreground/92 hover:text-foreground transition-colors">
+ <span className="font-medium text-[13px] text-foreground transition-colors hover:text-foreground/80">
{user?.name}
</span>
</div>
@@ -218,7 +218,7 @@ export default function CommentCard({
<TooltipTrigger asChild>
<button
type="button"
- className="cursor-default text-xs text-muted-foreground/62 outline-none focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
+ className="cursor-default text-xs text-muted-foreground/60 outline-none focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
aria-label={fullTimestamp}
title={fullTimestamp}
>
@@ -294,7 +294,7 @@ export default function CommentCard({
className={
isEditing
? "[&_.kaneo-comment-editor-content_.ProseMirror]:min-h-[3rem] [&_.kaneo-comment-editor-content_.ProseMirror]:max-h-none [&_.kaneo-comment-editor-content_.ProseMirror]:overflow-visible [&_.kaneo-comment-editor-content_.ProseMirror]:px-3 [&_.kaneo-comment-editor-content_.ProseMirror]:pt-2.5 [&_.kaneo-comment-editor-content_.ProseMirror]:pb-2"
- : "kaneo-comment-viewer [&_.kaneo-comment-editor-content_.ProseMirror]:px-3 [&_.kaneo-comment-editor-content_.ProseMirror]:pt-2 [&_.kaneo-comment-editor-content_.ProseMirror]:pb-3"
+ : "kaneo-comment-viewer [&_.kaneo-comment-editor-content_.ProseMirror]:pt-1.5 [&_.kaneo-comment-editor-content_.ProseMirror]:pr-3.5 [&_.kaneo-comment-editor-content_.ProseMirror]:pb-3.5 [&_.kaneo-comment-editor-content_.ProseMirror]:pl-10"
}
autoFocus={isEditing}
readOnly={!isEditing}
diff --git a/apps/web/src/components/activity/index.tsx b/apps/web/src/components/activity/index.tsx
index ab5f38b53..1ffb620c6 100644
--- a/apps/web/src/components/activity/index.tsx
+++ b/apps/web/src/components/activity/index.tsx
@@ -49,7 +49,7 @@ type WorkspaceUser = {
};
function getActivityTypeIcon(type: string) {
- const iconClass = "h-4 w-4";
+ const iconClass = "size-3.5";
switch (type) {
case "status_changed":
return <History className={iconClass} />;
@@ -107,13 +107,15 @@ function UserHoverName({
fallbackName: string;
}) {
if (!user?.user) {
- return <span className="font-medium text-foreground">{fallbackName}</span>;
+ return (
+ <span className="font-medium text-foreground/85">{fallbackName}</span>
+ );
}
return (
<HoverCard>
<HoverCardTrigger asChild>
- <span className="cursor-pointer font-medium text-foreground transition-colors hover:text-primary">
+ <span className="cursor-pointer font-medium text-foreground/85 transition-colors hover:text-foreground">
{user.user.name}
</span>
</HoverCardTrigger>
@@ -150,9 +152,9 @@ function ActorAvatar({
fallbackName: string;
}) {
return (
- <Avatar className="size-6">
+ <Avatar className="size-4.5">
<AvatarImage src={user?.user?.image ?? ""} alt={fallbackName} />
- <AvatarFallback className="bg-muted text-[11px] font-medium">
+ <AvatarFallback className="bg-muted font-semibold text-[8px]">
{getInitials(fallbackName)}
</AvatarFallback>
</Avatar>
@@ -174,7 +176,7 @@ function renderActivityContent({
if (activity.type === "priority_changed") {
if (eventData) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedPriority", {
from: getPriorityLabel(String(eventData.oldPriority ?? "")),
to: getPriorityLabel(String(eventData.newPriority ?? "")),
@@ -187,11 +189,11 @@ function renderActivityContent({
/changed priority from "?(.+?)"? to "?(.+?)"?$/i,
);
if (!match) {
- return <span className="text-sm text-muted-foreground">{content}</span>;
+ return <span className="text-muted-foreground">{content}</span>;
}
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedPriority", {
from: getPriorityLabel(match[1]),
to: getPriorityLabel(match[2]),
@@ -203,7 +205,7 @@ function renderActivityContent({
if (activity.type === "status_changed") {
if (eventData) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedStatus", {
from: getStatusLabel(String(eventData.oldStatus ?? "")),
to: getStatusLabel(String(eventData.newStatus ?? "")),
@@ -214,11 +216,11 @@ function renderActivityContent({
const match = content.match(/changed status from "?(.+?)"? to "?(.+?)"?$/i);
if (!match) {
- return <span className="text-sm text-muted-foreground">{content}</span>;
+ return <span className="text-muted-foreground">{content}</span>;
}
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedStatus", {
from: getStatusLabel(match[1]),
to: getStatusLabel(match[2]),
@@ -237,7 +239,7 @@ function renderActivityContent({
: null;
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{newDueDate
? oldDueDate
? t("activity:changedDueDate", {
@@ -253,7 +255,7 @@ function renderActivityContent({
const changeMatch = content.match(/changed due date from (.+) to (.+)$/i);
if (changeMatch) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedDueDate", {
from: formatActivityDateText(changeMatch[1]),
to: formatActivityDateText(changeMatch[2]),
@@ -265,7 +267,7 @@ function renderActivityContent({
const setMatch = content.match(/set due date to (.+)$/i);
if (setMatch) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:setDueDate", {
date: formatActivityDateText(setMatch[1]),
})}
@@ -275,20 +277,18 @@ function renderActivityContent({
if (content.includes("cleared the due date")) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:clearedDueDate")}
</span>
);
}
- return <span className="text-sm text-muted-foreground">{content}</span>;
+ return <span className="text-muted-foreground">{content}</span>;
}
if (activity.type === "unassigned") {
return (
- <span className="text-sm text-muted-foreground">
- {t("activity:unassigned")}
- </span>
+ <span className="text-muted-foreground">{t("activity:unassigned")}</span>
);
}
@@ -296,7 +296,7 @@ function renderActivityContent({
if (eventData) {
if (eventData.isSelfAssigned) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:assignedToSelf")}
</span>
);
@@ -308,7 +308,7 @@ function renderActivityContent({
workspaceUsers?.find((member) => member.user?.id === targetId) || null;
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:assignedTo", {
name: targetUser?.user?.name ?? targetName,
})}
@@ -318,7 +318,7 @@ function renderActivityContent({
if (content.includes("themselves")) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:assignedToSelf")}
</span>
);
@@ -333,7 +333,7 @@ function renderActivityContent({
workspaceUsers?.find((member) => member.user?.id === targetId) || null;
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:assignedTo", {
name: targetUser?.user?.name ?? targetName,
})}
@@ -346,7 +346,7 @@ function renderActivityContent({
const targetName = legacyMatch[1];
const targetUser = findUserByName(workspaceUsers, targetName);
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:assignedTo", {
name: targetUser?.user?.name ?? targetName,
})}
@@ -358,7 +358,7 @@ function renderActivityContent({
if (activity.type === "title_changed") {
if (eventData) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedTitle", {
from: String(eventData.oldTitle ?? ""),
to: String(eventData.newTitle ?? ""),
@@ -370,7 +370,7 @@ function renderActivityContent({
const legacyMatch = content.match(/changed title from "(.+)" to "(.+)"$/i);
if (legacyMatch) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{t("activity:changedTitle", {
from: legacyMatch[1],
to: legacyMatch[2],
@@ -383,7 +383,7 @@ function renderActivityContent({
if (activity.type === "moved") {
if (eventData) {
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{eventData.fromProjectName
? t("activity:moved", {
from: String(eventData.fromProjectName),
@@ -397,18 +397,14 @@ function renderActivityContent({
}
}
- if (activity.type === "created") {
- if (eventData) {
- return (
- <span className="text-sm text-muted-foreground">
- {t("activity:created")}
- </span>
- );
- }
+ if (["create", "created", "task"].includes(activity.type)) {
+ return (
+ <span className="text-muted-foreground">{t("activity:created")}</span>
+ );
}
return (
- <span className="text-sm text-muted-foreground">
+ <span className="text-muted-foreground">
{content || toDisplayCase(activity.type)}
</span>
);
@@ -417,11 +413,9 @@ function renderActivityContent({
function Activity({
activity,
step,
- showConnector = false,
}: {
activity: ActivityItem;
step: number;
- showConnector?: boolean;
}) {
const { t } = useTranslation();
const { data: workspace } = useActiveWorkspace();
@@ -454,7 +448,7 @@ function Activity({
};
return (
- <TimelineItem className="m-0! flex-row items-start py-2!" step={step}>
+ <TimelineItem className="m-0! flex-row items-start py-1!" step={step}>
<TimelineContent className="min-w-0 flex-1">
<CommentCard
commentId={activity.id}
@@ -475,29 +469,29 @@ function Activity({
);
}
- const activityIcon = getActivityTypeIcon(activity.type);
+ const isCreated = ["create", "created", "task"].includes(activity.type);
return (
<TimelineItem
- className="relative m-0! flex-row items-center gap-3 py-2.5!"
+ className="m-0! min-h-7 flex-row items-start gap-2.5 py-1! pl-2"
step={step}
>
- {showConnector && (
- <span className="-translate-x-1/2 absolute top-9 bottom-0 left-3 w-px bg-[color-mix(in_srgb,var(--foreground)_18%,transparent)] dark:bg-[color-mix(in_srgb,var(--foreground)_26%,transparent)]" />
- )}
- <span className="inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground/80">
- {activityIcon}
+ <span className="flex h-5 w-4.5 shrink-0 items-center justify-center text-muted-foreground">
+ {isCreated ? (
+ <ActorAvatar user={user || null} fallbackName={actorName} />
+ ) : (
+ getActivityTypeIcon(activity.type)
+ )}
</span>
- <ActorAvatar user={user || null} fallbackName={actorName} />
- <TimelineContent className="text-sm leading-6 text-foreground">
+ <TimelineContent className="min-w-0 flex-1 text-[13px] text-foreground leading-5">
<UserHoverName user={user || null} fallbackName={actorName} />{" "}
{renderActivityContent({
activity,
workspaceUsers: workspaceUsers as WorkspaceUser[] | undefined,
t,
})}{" "}
- <span className="whitespace-nowrap text-muted-foreground/70 text-xs">
- {formatRelativeTime(activity.createdAt)}
+ <span className="whitespace-nowrap text-muted-foreground/60 text-xs">
+ · {formatRelativeTime(activity.createdAt)}
</span>
</TimelineContent>
</TimelineItem>
diff --git a/apps/web/src/components/bulk-selection/bulk-bar.tsx b/apps/web/src/components/bulk-selection/bulk-bar.tsx
index 6620c8641..029118ac1 100644
--- a/apps/web/src/components/bulk-selection/bulk-bar.tsx
+++ b/apps/web/src/components/bulk-selection/bulk-bar.tsx
@@ -24,7 +24,8 @@ import { BulkDeleteConfirm } from "./bulk-delete-confirm";
import { BulkDueDatePopover } from "./bulk-due-date-popover";
import { useBulkRequestStore } from "./bulk-request-store";
import { BulkMoreMenu } from "./bulk-more-menu";
-import { type BulkOption, BulkOptionPopover } from "./bulk-option-popover";
+import type { OptionMenuItem } from "@/components/common/option-menu/option-menu-item";
+import { BulkOptionPopover } from "./bulk-option-popover";
import { toolbarPresenceClass } from "./toolbar-presence-class";
import { useBulkActions } from "./use-bulk-actions";
import { useBulkOptions } from "./use-bulk-options";
@@ -41,7 +42,7 @@ type BulkBarProps = {
const toCommandItems = (
prefix: string,
- options: BulkOption[],
+ options: OptionMenuItem[],
run: (value: string) => unknown,
): BulkCommandItem[] =>
options.map((option) => ({
diff --git a/apps/web/src/components/bulk-selection/bulk-option-popover.tsx b/apps/web/src/components/bulk-selection/bulk-option-popover.tsx
index d7e2fc7ca..1099b7857 100644
--- a/apps/web/src/components/bulk-selection/bulk-option-popover.tsx
+++ b/apps/web/src/components/bulk-selection/bulk-option-popover.tsx
@@ -1,6 +1,6 @@
-import { Autocomplete } from "@base-ui/react/autocomplete";
import { type ReactNode, useState } from "react";
-import { useTranslation } from "react-i18next";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
+import type { OptionMenuItem } from "@/components/common/option-menu/option-menu-item";
import {
Popover,
PopoverContent,
@@ -11,17 +11,11 @@ import { BarTooltip } from "./bar-tooltip";
import type { BulkPicker } from "./bulk-request-store";
import { useBulkPickerRequest } from "./use-bulk-picker-request";
-export type BulkOption = {
- value: string;
- label: string;
- icon?: ReactNode;
-};
-
type BulkOptionPopoverProps = {
icon: ReactNode;
label: string;
placeholder: string;
- options: BulkOption[];
+ options: OptionMenuItem[];
onSelect: (value: string) => void;
className?: string;
picker?: BulkPicker;
@@ -40,17 +34,11 @@ export function BulkOptionPopover({
onDismiss,
returnFocus,
}: BulkOptionPopoverProps) {
- const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { openedByRequest, openedManually } = useBulkPickerRequest(
picker,
setOpen,
);
- const [query, setQuery] = useState("");
- const needle = query.trim().toLowerCase();
- const filtered = options.filter((option) =>
- option.label.toLowerCase().includes(needle),
- );
const select = (value: string) => {
setOpen(false);
@@ -66,7 +54,6 @@ export function BulkOptionPopover({
openedManually();
return;
}
- setQuery("");
onDismiss?.();
}}
>
@@ -92,66 +79,12 @@ export function BulkOptionPopover({
className="w-60 p-0"
finalFocus={() => (openedByRequest() && returnFocus?.()) || true}
>
- <Autocomplete.Root
- items={options}
- filteredItems={filtered}
- value={query}
- onValueChange={(value, details) => {
- if (
- details.reason === "input-change" ||
- details.reason === "input-clear"
- )
- setQuery(value);
- }}
- inline
- open
- autoHighlight="always"
- keepHighlight
- >
- <Autocomplete.Input
- autoFocus
- aria-label={label}
- placeholder={placeholder}
- onKeyDown={(event) => {
- if (query || !/^[1-9]$/.test(event.key)) return;
- const option = filtered[Number(event.key) - 1];
- if (!option) return;
- event.preventDefault();
- select(option.value);
- }}
- className="h-10 w-full border-border/80 border-b bg-transparent px-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
- />
- <Autocomplete.Empty className="px-3 text-muted-foreground text-xs not-empty:py-5">
- {t("tasks:filterMenu.noResults")}
- </Autocomplete.Empty>
- <Autocomplete.List className="max-h-72 overflow-y-auto p-1 empty:hidden">
- {(option: BulkOption) => {
- const index = filtered.indexOf(option);
- return (
- <Autocomplete.Item
- key={option.value}
- value={option}
- onClick={() => select(option.value)}
- className="flex h-8 cursor-default select-none items-center gap-2 rounded-md px-2 text-[13px] text-foreground outline-none data-highlighted:bg-accent [&_svg]:size-3.5"
- >
- {option.icon && (
- <span className="inline-flex size-4 shrink-0 items-center justify-center">
- {option.icon}
- </span>
- )}
- <span className="min-w-0 flex-1 truncate">
- {option.label}
- </span>
- {!query && index < 9 && (
- <span className="shrink-0 text-muted-foreground text-xs tabular-nums">
- {index + 1}
- </span>
- )}
- </Autocomplete.Item>
- );
- }}
- </Autocomplete.List>
- </Autocomplete.Root>
+ <OptionMenu
+ label={label}
+ placeholder={placeholder}
+ options={options}
+ onSelect={select}
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/bulk-selection/use-bulk-options.tsx b/apps/web/src/components/bulk-selection/use-bulk-options.tsx
index 54a79fec3..45d68c747 100644
--- a/apps/web/src/components/bulk-selection/use-bulk-options.tsx
+++ b/apps/web/src/components/bulk-selection/use-bulk-options.tsx
@@ -6,7 +6,7 @@ import { getInitials } from "@/lib/get-initials";
import { getPriorityLabel } from "@/lib/i18n/domain";
import { resolveLabelColor } from "@/lib/label-color";
import { getPriorityIcon } from "@/lib/priority";
-import type { BulkOption } from "./bulk-option-popover";
+import type { OptionMenuItem } from "@/components/common/option-menu/option-menu-item";
import type { BulkActions } from "./use-bulk-actions";
const PRIORITIES = ["urgent", "high", "medium", "low", "no-priority"];
@@ -16,17 +16,17 @@ export function useBulkOptions(actions: BulkActions) {
const { columns, members, labels } = actions;
return useMemo(() => {
- const columnOptions: BulkOption[] = columns.map((column) => ({
+ const columnOptions: OptionMenuItem[] = columns.map((column) => ({
value: column.id,
label: column.name,
icon: getColumnIcon(column.id, column.isFinal, column.icon),
}));
- const priorityOptions: BulkOption[] = PRIORITIES.map((priority) => ({
+ const priorityOptions: OptionMenuItem[] = PRIORITIES.map((priority) => ({
value: priority,
label: getPriorityLabel(priority),
icon: getPriorityIcon(priority),
}));
- const memberOptions: BulkOption[] = members.map((member) => ({
+ const memberOptions: OptionMenuItem[] = members.map((member) => ({
value: member.id,
label: member.name || t("common:people.someone"),
icon: (
@@ -38,7 +38,7 @@ export function useBulkOptions(actions: BulkActions) {
</Avatar>
),
}));
- const labelOptions: BulkOption[] = labels.map((label) => ({
+ const labelOptions: OptionMenuItem[] = labels.map((label) => ({
value: label.id,
label: label.name,
icon: (
diff --git a/apps/web/src/components/common/option-menu/option-menu-item.ts b/apps/web/src/components/common/option-menu/option-menu-item.ts
new file mode 100644
index 000000000..759bd063a
--- /dev/null
+++ b/apps/web/src/components/common/option-menu/option-menu-item.ts
@@ -0,0 +1,8 @@
+import type { ReactNode } from "react";
+
+export type OptionMenuItem = {
+ value: string;
+ label: string;
+ icon?: ReactNode;
+ selected?: boolean;
+};
diff --git a/apps/web/src/components/common/option-menu/option-menu.test.tsx b/apps/web/src/components/common/option-menu/option-menu.test.tsx
new file mode 100644
index 000000000..f6eb2ff9b
--- /dev/null
+++ b/apps/web/src/components/common/option-menu/option-menu.test.tsx
@@ -0,0 +1,66 @@
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vite-plus/test";
+import { OptionMenu } from "./option-menu";
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+
+afterEach(cleanup);
+
+const options = [
+ { value: "to-do", label: "To Do" },
+ { value: "done", label: "Done", selected: true },
+];
+
+function renderMenu() {
+ const onSelect = vi.fn();
+ render(
+ <OptionMenu
+ label="Status"
+ placeholder="Change status"
+ options={options}
+ onSelect={onSelect}
+ />,
+ );
+ return { onSelect, input: screen.getByPlaceholderText("Change status") };
+}
+
+describe("OptionMenu", () => {
+ it("picks an option by its number", () => {
+ const { onSelect, input } = renderMenu();
+
+ fireEvent.keyDown(input, { key: "2" });
+
+ expect(onSelect).toHaveBeenCalledWith("done");
+ });
+
+ it("catches a number pressed before the menu has focus", () => {
+ const { onSelect } = renderMenu();
+
+ fireEvent.keyDown(document.body, { key: "1" });
+
+ expect(onSelect).toHaveBeenCalledWith("to-do");
+ });
+
+ it("types digits into the search once a query exists", () => {
+ const { onSelect, input } = renderMenu();
+
+ fireEvent.change(input, { target: { value: "do" } });
+ fireEvent.keyDown(input, { key: "1" });
+
+ expect(onSelect).not.toHaveBeenCalled();
+ });
+
+ it("marks the current value", () => {
+ renderMenu();
+
+ expect(screen.getByRole("option", { name: "Done" })).toHaveAttribute(
+ "aria-current",
+ "true",
+ );
+ expect(screen.getByRole("option", { name: /To Do/ })).not.toHaveAttribute(
+ "aria-current",
+ );
+ });
+});
diff --git a/apps/web/src/components/common/option-menu/option-menu.tsx b/apps/web/src/components/common/option-menu/option-menu.tsx
new file mode 100644
index 000000000..82395908b
--- /dev/null
+++ b/apps/web/src/components/common/option-menu/option-menu.tsx
@@ -0,0 +1,128 @@
+import { Autocomplete } from "@base-ui/react/autocomplete";
+import { Check } from "lucide-react";
+import { type ReactNode, useEffect, useEffectEvent, useState } from "react";
+import { useTranslation } from "react-i18next";
+import { isEditableTarget } from "@/lib/shortcuts/registry";
+import type { OptionMenuItem } from "./option-menu-item";
+
+type OptionMenuProps = {
+ label: string;
+ placeholder: string;
+ options: OptionMenuItem[];
+ onSelect: (value: string) => void;
+ onQueryChange?: (query: string) => void;
+ status?: ReactNode;
+};
+
+export function OptionMenu({
+ label,
+ placeholder,
+ options,
+ onSelect,
+ onQueryChange,
+ status,
+}: OptionMenuProps) {
+ const { t } = useTranslation();
+ const [query, setQuery] = useState("");
+ const needle = query.trim().toLowerCase();
+ const filtered = options.filter((option) =>
+ option.label.toLowerCase().includes(needle),
+ );
+
+ const selectByNumber = (key: string) => {
+ if (query || !/^[1-9]$/.test(key)) return false;
+ const option = filtered[Number(key) - 1];
+ if (!option) return false;
+ onSelect(option.value);
+ return true;
+ };
+
+ const handleEarlyKey = useEffectEvent((event: KeyboardEvent) => {
+ if (isEditableTarget(event.target)) return;
+ if (selectByNumber(event.key)) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ });
+
+ useEffect(() => {
+ document.addEventListener("keydown", handleEarlyKey, true);
+ return () => document.removeEventListener("keydown", handleEarlyKey, true);
+ }, []);
+
+ return (
+ <Autocomplete.Root
+ items={options}
+ filteredItems={filtered}
+ value={query}
+ onValueChange={(value, details) => {
+ if (
+ details.reason === "input-change" ||
+ details.reason === "input-clear"
+ ) {
+ setQuery(value);
+ onQueryChange?.(value);
+ }
+ }}
+ inline
+ open
+ autoHighlight="always"
+ keepHighlight
+ >
+ <Autocomplete.Input
+ autoFocus
+ aria-label={label}
+ placeholder={placeholder}
+ onKeyDown={(event) => {
+ if (selectByNumber(event.key)) event.preventDefault();
+ }}
+ className="h-10 w-full border-border/80 border-b bg-transparent px-3 text-[13px] text-foreground outline-none placeholder:text-muted-foreground"
+ />
+ {status ? (
+ <div className="px-3 py-5 text-muted-foreground text-xs">{status}</div>
+ ) : (
+ <>
+ <Autocomplete.Empty className="px-3 text-muted-foreground text-xs not-empty:py-5">
+ {t("tasks:filterMenu.noResults")}
+ </Autocomplete.Empty>
+ <Autocomplete.List className="max-h-72 overflow-y-auto p-1 empty:hidden">
+ {(option: OptionMenuItem) => {
+ const index = filtered.indexOf(option);
+ return (
+ <Autocomplete.Item
+ key={option.value}
+ value={option}
+ aria-current={option.selected || undefined}
+ onClick={() => onSelect(option.value)}
+ className="flex h-8 cursor-default select-none items-center gap-2 rounded-md px-2 text-[13px] text-foreground outline-none data-highlighted:bg-accent [&_svg]:size-3.5"
+ >
+ {option.icon && (
+ <span className="inline-flex size-4 shrink-0 items-center justify-center">
+ {option.icon}
+ </span>
+ )}
+ <span className="min-w-0 flex-1 truncate">
+ {option.label}
+ </span>
+ {option.selected ? (
+ <Check
+ aria-hidden="true"
+ className="shrink-0 text-muted-foreground"
+ />
+ ) : (
+ !query &&
+ index < 9 && (
+ <span className="shrink-0 text-muted-foreground text-xs tabular-nums">
+ {index + 1}
+ </span>
+ )
+ )}
+ </Autocomplete.Item>
+ );
+ }}
+ </Autocomplete.List>
+ </>
+ )}
+ </Autocomplete.Root>
+ );
+}
diff --git a/apps/web/src/components/common/task-layout.tsx b/apps/web/src/components/common/task-layout.tsx
index e97c2a7c9..4e5cc3cd6 100644
--- a/apps/web/src/components/common/task-layout.tsx
+++ b/apps/web/src/components/common/task-layout.tsx
@@ -23,7 +23,7 @@ type TaskLayoutProps = {
workspaceId: string;
headerActions?: ReactNode;
children: ReactNode;
- rightSidebar?: ReactNode;
+ rail?: ReactNode;
};
export default function TaskLayout({
@@ -32,7 +32,7 @@ export default function TaskLayout({
workspaceId,
headerActions,
children,
- rightSidebar,
+ rail,
}: TaskLayoutProps) {
const { t } = useTranslation();
const navigate = useNavigate();
@@ -116,20 +116,15 @@ export default function TaskLayout({
workspaceId={workspaceId}
/>
) : (
- <div className="flex h-full min-h-0 flex-col overflow-hidden lg:flex-row">
- <div className="order-2 min-h-0 flex-1 overflow-y-auto overscroll-contain lg:order-1">
- {children}
- </div>
- <div className="order-1 border-b border-border/80 lg:order-2 lg:hidden">
- {rightSidebar}
- </div>
+ <div className="h-full min-h-0 overflow-y-auto overscroll-contain">
+ {children}
</div>
)}
</Layout.Content>
</div>
{unavailableReason ? null : (
- <div className="hidden border-l border-border/80 bg-card lg:flex lg:h-full lg:overflow-y-auto">
- {rightSidebar}
+ <div className="hidden border-border/80 border-l lg:flex lg:h-full lg:overflow-y-auto">
+ {rail}
</div>
)}
</Layout>
diff --git a/apps/web/src/components/common/unassigned-avatar.tsx b/apps/web/src/components/common/unassigned-avatar.tsx
new file mode 100644
index 000000000..d0d0ca69c
--- /dev/null
+++ b/apps/web/src/components/common/unassigned-avatar.tsx
@@ -0,0 +1,15 @@
+import { cn } from "@/lib/cn";
+
+export function UnassignedAvatar({ className }: { className?: string }) {
+ return (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "flex shrink-0 items-center justify-center rounded-full border border-border bg-muted font-medium text-[9px] text-muted-foreground leading-none",
+ className,
+ )}
+ >
+ ?
+ </span>
+ );
+}
diff --git a/apps/web/src/components/custom-fields/custom-field-chip.tsx b/apps/web/src/components/custom-fields/custom-field-chip.tsx
index 65594fcb9..0ff695dd0 100644
--- a/apps/web/src/components/custom-fields/custom-field-chip.tsx
+++ b/apps/web/src/components/custom-fields/custom-field-chip.tsx
@@ -14,6 +14,7 @@ type CustomFieldChipProps = {
onChange: (value: string) => void;
invalid?: boolean;
disabled?: boolean;
+ className?: string;
};
export function CustomFieldChip({
@@ -22,6 +23,7 @@ export function CustomFieldChip({
onChange,
invalid = false,
disabled = false,
+ className,
}: CustomFieldChipProps) {
const { t } = useTranslation();
@@ -37,6 +39,7 @@ export function CustomFieldChip({
className={cn(
propertyChipClass,
checked && "bg-accent/30 text-foreground",
+ className,
)}
>
<CheckboxMark checked={checked} />
@@ -58,6 +61,7 @@ export function CustomFieldChip({
display && "bg-accent/30",
invalid &&
"border-destructive/50 bg-destructive/8 text-destructive-foreground focus-visible:ring-destructive/40",
+ className,
)}
>
<CustomFieldTypeIcon type={field.type} className="size-3.5 shrink-0" />
diff --git a/apps/web/src/components/custom-fields/custom-field-row.tsx b/apps/web/src/components/custom-fields/custom-field-row.tsx
index 44301f145..ac117e4ab 100644
--- a/apps/web/src/components/custom-fields/custom-field-row.tsx
+++ b/apps/web/src/components/custom-fields/custom-field-row.tsx
@@ -1,8 +1,9 @@
import { useTranslation } from "react-i18next";
import type { CustomFieldDefinition } from "@/components/project/custom-fields/types";
+import { PropertyRow } from "@/components/task/properties/property-row";
+import { PropertyValue } from "@/components/task/properties/property-value";
import { CheckboxMark } from "./checkbox-mark";
import { CustomFieldPopover } from "./custom-field-popover";
-import { CustomFieldTypeIcon } from "./custom-field-type-icon";
import { formatCustomFieldValue } from "./format-custom-field-value";
type CustomFieldRowProps = {
@@ -12,9 +13,6 @@ type CustomFieldRowProps = {
disabled?: boolean;
};
-const rowClass =
- "group/row flex h-7 w-full min-w-0 items-center gap-2 rounded-md px-1.5 text-left text-xs outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring enabled:hover:bg-accent data-popup-open:bg-accent";
-
export function CustomFieldRow({
field,
value,
@@ -22,69 +20,60 @@ export function CustomFieldRow({
disabled = false,
}: CustomFieldRowProps) {
const { t } = useTranslation();
- const label = (
- <>
- <CustomFieldTypeIcon
- type={field.type}
- className="size-3.5 shrink-0 text-muted-foreground group-data-popup-open/row:text-sidebar-foreground"
- />
- <span className="w-26 shrink-0 truncate font-medium text-muted-foreground group-data-popup-open/row:text-sidebar-foreground">
- {field.name}
- </span>
- </>
- );
if (field.type === "boolean") {
const checked = value === "true";
return (
- <button
- type="button"
- role="checkbox"
- aria-checked={checked}
- aria-label={field.name}
- disabled={disabled}
- onClick={() => onChange(checked ? "false" : "true")}
- className={rowClass}
- >
- {label}
- <CheckboxMark checked={checked} />
- </button>
+ <PropertyRow label={field.name}>
+ <PropertyValue
+ role="checkbox"
+ aria-checked={checked}
+ aria-label={field.name}
+ disabled={disabled}
+ onClick={() => onChange(checked ? "false" : "true")}
+ >
+ <CheckboxMark checked={checked} />
+ </PropertyValue>
+ </PropertyRow>
);
}
const display = formatCustomFieldValue(field.type, value, "medium");
- const row = (
- <button type="button" disabled={disabled} className={rowClass}>
- {label}
+ const button = (
+ <PropertyValue disabled={disabled} aria-label={field.name}>
{display ? (
- <span className="flex min-w-0 items-center gap-1.5 font-semibold text-foreground">
+ <>
<span className="truncate" title={display.text}>
{display.text}
</span>
{!!display.more && (
- <span className="shrink-0 font-medium text-muted-foreground">
+ <span className="shrink-0 text-muted-foreground">
+{display.more}
</span>
)}
- </span>
+ </>
) : (
- <span className="truncate text-muted-foreground/70">
+ <span className="truncate font-normal text-muted-foreground/70">
{t("tasks:customFields.empty")}
</span>
)}
- </button>
+ </PropertyValue>
);
- if (disabled) return row;
-
return (
- <CustomFieldPopover
- field={field}
- value={value}
- onChange={onChange}
- side="left"
- >
- {row}
- </CustomFieldPopover>
+ <PropertyRow label={field.name}>
+ {disabled ? (
+ button
+ ) : (
+ <CustomFieldPopover
+ field={field}
+ value={value}
+ onChange={onChange}
+ side="left"
+ >
+ {button}
+ </CustomFieldPopover>
+ )}
+ </PropertyRow>
);
}
diff --git a/apps/web/src/components/custom-fields/property-chip-class.ts b/apps/web/src/components/custom-fields/property-chip-class.ts
index 29fe8281d..23b11598e 100644
--- a/apps/web/src/components/custom-fields/property-chip-class.ts
+++ b/apps/web/src/components/custom-fields/property-chip-class.ts
@@ -1,2 +1,2 @@
export const propertyChipClass =
- "inline-flex h-7 max-w-full items-center gap-1.5 rounded-md border border-border px-2.5 font-medium text-muted-foreground text-xs outline-none transition-colors hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring data-popup-open:border-input data-popup-open:bg-accent disabled:pointer-events-none";
+ "inline-flex h-7 max-w-full items-center gap-1.5 rounded-md border border-border px-2.5 font-medium text-muted-foreground text-xs outline-none transition-colors hover:bg-accent/50 focus-visible:bg-accent/50 data-popup-open:border-input data-popup-open:bg-accent disabled:pointer-events-none";
diff --git a/apps/web/src/components/editor/detect-code-language.test.ts b/apps/web/src/components/editor/detect-code-language.test.ts
new file mode 100644
index 000000000..edff443a6
--- /dev/null
+++ b/apps/web/src/components/editor/detect-code-language.test.ts
@@ -0,0 +1,39 @@
+import { describe, expect, it } from "vite-plus/test";
+import { detectCodeLanguage } from "./detect-code-language";
+
+describe("detectCodeLanguage", () => {
+ it.each([
+ ["const a = 'a';", "javascript"],
+ ["console.log('hi')", "javascript"],
+ ["import { x } from './x';\nexport default x;", "javascript"],
+ ["let total: number = 1;", "typescript"],
+ ["interface Task { title: string }", "typescript"],
+ ['{"a": 1, "b": [1, 2]}', "json"],
+ ["def add(a, b):\n return a + b", "python"],
+ ["import os\nos.getcwd()", "python"],
+ ['fn main() {\n println!("hi");\n}', "rust"],
+ ["package main\n\nfunc main() {}", "go"],
+ ["func greet(name: String) -> String {", "swift"],
+ ["public class App { public static void main(String[] args) {} }", "java"],
+ ["using System;\nConsole.WriteLine(1);", "csharp"],
+ ["fun main() {\n val x = 1\n}", "kotlin"],
+ ["def greet\n puts 'hi'\nend", "ruby"],
+ ["<?php echo $name;", "php"],
+ ["SELECT id FROM users WHERE id = 1;", "sql"],
+ ["query Tasks {\n tasks { id }\n}", "graphql"],
+ ['<div class="card">Hi</div>', "html"],
+ ['<?xml version="1.0"?><note/>', "xml"],
+ ["pnpm install\npnpm dev", "bash"],
+ [".card { color: red; }", "css"],
+ ["name: kaneo\nversion: 2\nservices:\n - api", "yaml"],
+ ["@@ -1,2 +1,2 @@\n-a\n+b", "diff"],
+ ["# Title\n\n- [ ] task", "markdown"],
+ ])("detects %j as %s", (code, language) => {
+ expect(detectCodeLanguage(code)).toBe(language);
+ });
+
+ it("leaves prose and empty blocks as plain text", () => {
+ expect(detectCodeLanguage("hello world")).toBeNull();
+ expect(detectCodeLanguage(" ")).toBeNull();
+ });
+});
diff --git a/apps/web/src/components/editor/detect-code-language.ts b/apps/web/src/components/editor/detect-code-language.ts
new file mode 100644
index 000000000..51617c61b
--- /dev/null
+++ b/apps/web/src/components/editor/detect-code-language.ts
@@ -0,0 +1,84 @@
+const SAMPLE_LENGTH = 2000;
+
+const SIGNATURES: [language: string, pattern: RegExp][] = [
+ ["diff", /^(?:diff --git |\+\+\+ |--- |@@ )/m],
+ ["php", /<\?php|\$\w+\s*->\s*\w+/],
+ [
+ "html",
+ /^\s*<(?:!doctype html|html|head|body|div|span|p|a|ul|ol|li|section|main|header|footer|nav|button|input|form|img|table|script|style|template)\b/i,
+ ],
+ ["xml", /^\s*<(?:\?xml\b|[\w:-]+[\s/>])/],
+ [
+ "sql",
+ /^\s*(?:select\s[\s\S]*\bfrom\b|insert\s+into\b|update\s+\w+\s+set\b|delete\s+from\b|create\s+(?:table|index|view)\b|alter\s+table\b|drop\s+table\b|with\s+\w+\s+as\s*\()/im,
+ ],
+ ["graphql", /^\s*(?:query|mutation|subscription|fragment)\b[^{]*\{/m],
+ [
+ "swift",
+ /\bfunc\s+\w+\s*\([^)]*\)\s*->|\bguard\s+let\b|\bimport\s+(?:UIKit|SwiftUI|Foundation)\b/,
+ ],
+ [
+ "rust",
+ /\bfn\s+\w+\s*[<(]|\blet\s+mut\b|\b\w+!\(|\bimpl\b[^{\n]*\{|\bpub\s+(?:fn|struct|enum)\b/,
+ ],
+ [
+ "python",
+ /^\s*(?:def|class)\s+\w+[^\n{]*:\s*$|^\s*from\s+[\w.]+\s+import\b|^\s*import\s+[\w.]+\s*$|\bprint\(|\bself\.\w+|\belif\b/m,
+ ],
+ ["go", /^package\s+\w+|\bfunc\s+(?:\([^)]*\)\s*)?\w+\s*\(|\b\w+\s*:=/m],
+ [
+ "ruby",
+ /^\s*def\s+\w+[^:\n]*$|^\s*end\s*$|\bputs\s|\.each\s+do\b|^\s*require\s+['"]/m,
+ ],
+ ["csharp", /\busing\s+System\b|\bConsole\.Write|\bnamespace\s+[\w.]+\s*[{;]/],
+ [
+ "java",
+ /\bpublic\s+(?:static\s+)?(?:final\s+)?(?:class|void|interface)\b|\bSystem\.out\.|\bimport\s+java\./,
+ ],
+ ["kotlin", /\bfun\s+\w+\s*\(|\bval\s+\w+\s*[:=]/],
+ [
+ "typescript",
+ /\binterface\s+\w+|\btype\s+\w+\s*=|\b\w+\??\s*:\s*(?:string|number|boolean|void|unknown|any|never)\b|\bas\s+const\b/,
+ ],
+ [
+ "bash",
+ /^\s*(?:#!\/|\$ |sudo\s|npm\s|npx\s|pnpm\s|yarn\s|bun\s|git\s|cd\s|ls\b|echo\s|curl\s|docker\s|brew\s|apt(?:-get)?\s|mkdir\s|rm\s+-|export\s+\w+=)/m,
+ ],
+ [
+ "javascript",
+ /\b(?:const|let|var)\s+[\w{[]|=>|\bfunction\b|\bconsole\.\w+\(|\brequire\(|\bimport\s[^\n]+\sfrom\s+['"]|\bexport\s+(?:default|const|function|class)\b/,
+ ],
+ ["css", /^\s*[.#@]?[\w-][^{}\n]*\{[^}]*\b[\w-]+\s*:\s*[^;{}]+;/m],
+ ["markdown", /^(?:#{1,6}\s+\S|\s*[-*]\s+\[[ x]\]\s|>\s+\S|```)/m],
+];
+
+function isJson(code: string) {
+ if (!/^[[{]/.test(code)) return false;
+ try {
+ JSON.parse(code);
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+function isYaml(code: string) {
+ if (/[{};]/.test(code)) return false;
+ const lines = code.split("\n").filter((line) => line.trim());
+ return (
+ lines.length > 0 &&
+ lines.every((line) => /^\s*(?:-\s+|[\w.-]+:(?:\s|$)|#|---)/.test(line))
+ );
+}
+
+export function detectCodeLanguage(code: string): string | null {
+ const sample = code.slice(0, SAMPLE_LENGTH).trim();
+ if (!sample) return null;
+ if (isJson(sample)) return "json";
+
+ for (const [language, pattern] of SIGNATURES) {
+ if (pattern.test(sample)) return language;
+ }
+
+ return isYaml(sample) ? "yaml" : null;
+}
diff --git a/apps/web/src/components/editor/extensions.ts b/apps/web/src/components/editor/extensions.ts
index 3e4ac282d..23287bbcd 100644
--- a/apps/web/src/components/editor/extensions.ts
+++ b/apps/web/src/components/editor/extensions.ts
@@ -16,6 +16,7 @@ import { SafeHardBreak } from "@/components/task/extensions/safe-hard-break";
import { ShikiCodeBlock } from "@/components/task/extensions/shiki-code-block";
import { TaskItemWithCheckbox } from "@/components/task/extensions/task-item-with-checkbox";
import { EditorKeymap } from "./editor-keymap";
+import { detectCodeLanguage } from "./detect-code-language";
export function createEditorExtensions({
placeholder,
@@ -45,6 +46,7 @@ export function createEditorExtensions({
ShikiCodeBlock.configure({
highlighter,
resolveLanguage,
+ detectLanguage: detectCodeLanguage,
themeDark: "github-dark",
themeLight: "github-light",
}),
diff --git a/apps/web/src/components/external-links/external-links-accordion.test.tsx b/apps/web/src/components/external-links/external-links-accordion.test.tsx
index 8ba973e5b..3945bf9d3 100644
--- a/apps/web/src/components/external-links/external-links-accordion.test.tsx
+++ b/apps/web/src/components/external-links/external-links-accordion.test.tsx
@@ -203,7 +203,7 @@ describe("removing manual resources", () => {
"settings:externalLinks.removeError",
),
);
- expect(screen.getByRole("link", { name: "Design" })).toHaveAttribute(
+ expect(screen.getByRole("link", { name: /^Design/ })).toHaveAttribute(
"href",
manualLink.url,
);
diff --git a/apps/web/src/components/external-links/external-links-accordion.tsx b/apps/web/src/components/external-links/external-links-accordion.tsx
index b799803c6..42c85b890 100644
--- a/apps/web/src/components/external-links/external-links-accordion.tsx
+++ b/apps/web/src/components/external-links/external-links-accordion.tsx
@@ -1,17 +1,18 @@
import {
- ChevronDown,
ChevronRight,
FolderGit,
GitMerge,
GitPullRequest,
Link,
- Plus,
X,
} from "lucide-react";
import { useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { GithubIcon } from "@/components/icons/github-icon";
import { GitlabIcon } from "@/components/icons/gitlab-icon";
+import { SectionAddButton } from "@/components/task/sections/section-add-button";
+import { SectionHeader } from "@/components/task/sections/section-header";
+import { sectionRowClass } from "@/components/task/sections/section-row-class";
import { Button } from "@/components/ui/button";
import {
Collapsible,
@@ -30,7 +31,9 @@ import { Label } from "@/components/ui/label";
import useCreateExternalLink from "@/hooks/mutations/external-link/use-create-external-link";
import useDeleteExternalLink from "@/hooks/mutations/external-link/use-delete-external-link";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
+import { cn } from "@/lib/cn";
import type { ExternalLink } from "@/types/external-link";
+import { linkHost } from "./link-host";
interface ExternalLinksAccordionProps {
taskId: string;
@@ -176,102 +179,112 @@ export function ExternalLinksAccordion({
return (
<>
- <Collapsible open={isOpen} onOpenChange={setIsOpen} className="w-full">
- <div className="flex items-center justify-between">
- <CollapsibleTrigger asChild>
- <Button
- data-task-action="resources"
- variant="ghost"
- size="sm"
- className="justify-start gap-1 px-0 h-8 hover:bg-transparent"
- >
- {isOpen ? (
- <ChevronDown className="size-4 text-muted-foreground" />
- ) : (
- <ChevronRight className="size-4 text-muted-foreground" />
- )}
- <span className="text-sm text-muted-foreground">
- {t("settings:externalLinks.resources")}
- </span>
- </Button>
- </CollapsibleTrigger>
-
- {canAddResource && (
- <Button
- type="button"
- variant="ghost"
- size="xs"
- className="text-muted-foreground"
- data-task-action="addLink"
- aria-label={t("settings:externalLinks.addResource")}
- title={t("settings:externalLinks.addResource")}
- onClick={() => setIsDialogOpen(true)}
- >
- <Plus className="size-3.5" />
- </Button>
- )}
- </div>
-
- <CollapsibleContent>
- {isLoading ? null : linksWithoutRedundantBranches.length > 0 ? (
- <div className="flex flex-col gap-2 mt-2">
- {linksWithoutRedundantBranches.map((link) => (
- <div key={link.id} className="flex items-center gap-1">
- <a
- href={link.url}
- target="_blank"
- rel="noopener noreferrer"
- className="group flex min-w-0 flex-1 items-center gap-3 py-2 px-3 rounded-md hover:bg-accent/50 transition-colors"
- >
- {isGiteaResourceLink(link) ? (
- <FolderGit className="size-4 flex-shrink-0 text-muted-foreground" />
- ) : isGitlabResourceLink(link) ? (
- <GitlabIcon className="size-4 flex-shrink-0 text-muted-foreground" />
- ) : link.resourceType === "url" ? (
- <Link className="size-4 flex-shrink-0 text-muted-foreground" />
- ) : (
- <GithubIcon className="size-4 flex-shrink-0 text-muted-foreground" />
- )}
-
- <span className="text-sm truncate flex-1 text-foreground/90 group-hover:text-foreground">
- {link.title || link.externalId}
- {link.resourceType !== "branch" &&
- link.resourceType !== "url" && (
- <span className="text-muted-foreground ml-2">
- #{link.externalId}
- </span>
- )}
- </span>
-
- {getStatusBadge(link)}
- </a>
- {canAddResource &&
- link.integrationId === null &&
- link.resourceType === "url" && (
- <Button
- type="button"
- variant="ghost"
- size="icon-sm"
- aria-label={t("settings:externalLinks.remove", {
- title: link.title || link.url,
- })}
- disabled={deleteExternalLink.isPending}
- onClick={() =>
- deleteExternalLink.mutate({ taskId, id: link.id })
- }
+ <Collapsible open={isOpen} onOpenChange={setIsOpen}>
+ <section className="flex flex-col gap-1">
+ <SectionHeader
+ title={
+ <CollapsibleTrigger asChild>
+ <button
+ type="button"
+ data-task-action="resources"
+ className="flex items-center gap-1 rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {t("settings:externalLinks.resources")}
+ {!isOpen && (
+ <ChevronRight
+ aria-hidden="true"
+ className="size-3 text-muted-foreground"
+ />
+ )}
+ </button>
+ </CollapsibleTrigger>
+ }
+ meta={
+ linksWithoutRedundantBranches.length > 0 && (
+ <span className="text-muted-foreground text-xs tabular-nums">
+ {linksWithoutRedundantBranches.length}
+ </span>
+ )
+ }
+ action={
+ canAddResource && (
+ <SectionAddButton
+ data-task-action="addLink"
+ aria-label={t("settings:externalLinks.addResource")}
+ title={t("settings:externalLinks.addResource")}
+ onClick={() => setIsDialogOpen(true)}
+ />
+ )
+ }
+ />
+
+ <CollapsibleContent>
+ {isLoading ? null : linksWithoutRedundantBranches.length > 0 ? (
+ <div className="flex flex-col">
+ {linksWithoutRedundantBranches.map((link) => {
+ const isUrl = link.resourceType === "url";
+ const removable =
+ canAddResource && link.integrationId === null && isUrl;
+
+ return (
+ <div key={link.id} className={sectionRowClass}>
+ <a
+ href={link.url}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex min-w-0 flex-1 items-center gap-2.5 self-stretch outline-none focus-visible:underline"
>
- <X aria-hidden="true" />
- </Button>
- )}
- </div>
- ))}
- </div>
- ) : (
- <p className="mt-2 px-3 text-sm text-muted-foreground">
- {t("settings:externalLinks.empty")}
- </p>
- )}
- </CollapsibleContent>
+ {isGiteaResourceLink(link) ? (
+ <FolderGit className="size-3.5 shrink-0 text-muted-foreground" />
+ ) : isGitlabResourceLink(link) ? (
+ <GitlabIcon className="size-3.5 shrink-0 text-muted-foreground" />
+ ) : isUrl ? (
+ <Link className="size-3.5 shrink-0 text-muted-foreground" />
+ ) : (
+ <GithubIcon className="size-3.5 shrink-0 text-muted-foreground" />
+ )}
+ <span className="min-w-0 shrink truncate text-[13px] text-foreground/85 group-hover:text-foreground">
+ {link.title || link.externalId}
+ </span>
+ <span
+ className={cn(
+ "min-w-0 flex-1 truncate text-muted-foreground/70 text-xs",
+ !isUrl && "font-mono",
+ )}
+ >
+ {isUrl
+ ? linkHost(link.url)
+ : link.resourceType !== "branch" &&
+ `#${link.externalId}`}
+ </span>
+ {getStatusBadge(link)}
+ </a>
+ {removable && (
+ <button
+ type="button"
+ aria-label={t("settings:externalLinks.remove", {
+ title: link.title || link.url,
+ })}
+ disabled={deleteExternalLink.isPending}
+ onClick={() =>
+ deleteExternalLink.mutate({ taskId, id: link.id })
+ }
+ className="flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground opacity-0 outline-none transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 disabled:pointer-events-none"
+ >
+ <X aria-hidden="true" className="size-3.5" />
+ </button>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ ) : (
+ <p className="px-2 py-1 text-muted-foreground text-xs">
+ {t("settings:externalLinks.empty")}
+ </p>
+ )}
+ </CollapsibleContent>
+ </section>
</Collapsible>
<Dialog
diff --git a/apps/web/src/components/external-links/link-host.test.ts b/apps/web/src/components/external-links/link-host.test.ts
new file mode 100644
index 000000000..36088e644
--- /dev/null
+++ b/apps/web/src/components/external-links/link-host.test.ts
@@ -0,0 +1,18 @@
+import { describe, expect, it } from "vite-plus/test";
+import { linkHost } from "./link-host";
+
+describe("linkHost", () => {
+ it("shows the domain without a leading www", () => {
+ expect(linkHost("https://www.example.com/docs/rate-limits")).toBe(
+ "example.com",
+ );
+ });
+
+ it("keeps subdomains other than www", () => {
+ expect(linkHost("https://wiki.example.com/page")).toBe("wiki.example.com");
+ });
+
+ it("returns null for a value that is not a URL", () => {
+ expect(linkHost("not a url")).toBeNull();
+ });
+});
diff --git a/apps/web/src/components/external-links/link-host.ts b/apps/web/src/components/external-links/link-host.ts
new file mode 100644
index 000000000..42be48822
--- /dev/null
+++ b/apps/web/src/components/external-links/link-host.ts
@@ -0,0 +1,7 @@
+export function linkHost(url: string) {
+ try {
+ return new URL(url).hostname.replace(/^www\./, "");
+ } catch {
+ return null;
+ }
+}
diff --git a/apps/web/src/components/inbox/inbox-task.tsx b/apps/web/src/components/inbox/inbox-task.tsx
index 14cabec8d..70542a977 100644
--- a/apps/web/src/components/inbox/inbox-task.tsx
+++ b/apps/web/src/components/inbox/inbox-task.tsx
@@ -3,7 +3,6 @@ import { ArrowUpRight } from "lucide-react";
import { useTranslation } from "react-i18next";
import Activity from "@/components/activity";
import CommentInput from "@/components/activity/comment-input";
-import { isCommentActivity } from "@/components/activity/utils";
import { DueDateText } from "@/components/my-work/due-date-text";
import { Button } from "@/components/ui/button";
import { HttpError } from "@/lib/http-error";
@@ -186,21 +185,13 @@ export function InboxTask({ taskId, workspaceId }: InboxTaskProps) {
) : (
recent.length > 0 && (
<Timeline>
- {recent.map((activity, index) => {
- const next = recent[index + 1];
- return (
- <Activity
- key={activity.id}
- activity={activity}
- step={recent.length - index}
- showConnector={
- !isCommentActivity(activity) &&
- Boolean(next) &&
- !isCommentActivity(next)
- }
- />
- );
- })}
+ {recent.map((activity, index) => (
+ <Activity
+ key={activity.id}
+ activity={activity}
+ step={recent.length - index}
+ />
+ ))}
</Timeline>
)
)}
diff --git a/apps/web/src/components/task/custom-fields/task-custom-field-chips.tsx b/apps/web/src/components/task/custom-fields/task-custom-field-chips.tsx
index c4fb07b4a..7ab7e894e 100644
--- a/apps/web/src/components/task/custom-fields/task-custom-field-chips.tsx
+++ b/apps/web/src/components/task/custom-fields/task-custom-field-chips.tsx
@@ -4,30 +4,27 @@ import { useTaskCustomFields } from "./use-task-custom-fields";
type TaskCustomFieldChipsProps = {
taskId: string;
projectId: string;
+ className?: string;
};
export function TaskCustomFieldChips({
taskId,
projectId,
+ className,
}: TaskCustomFieldChipsProps) {
const { fields, values, save, canEdit } = useTaskCustomFields(
taskId,
projectId,
);
- if (fields.length === 0) return null;
-
- return (
- <div className="flex w-full flex-wrap items-center gap-1.5">
- {fields.map((field) => (
- <CustomFieldChip
- key={field.id}
- field={field}
- value={values[field.id] ?? ""}
- onChange={(value) => void save(field, value)}
- disabled={!canEdit}
- />
- ))}
- </div>
- );
+ return fields.map((field) => (
+ <CustomFieldChip
+ key={field.id}
+ field={field}
+ value={values[field.id] ?? ""}
+ onChange={(value) => void save(field, value)}
+ disabled={!canEdit}
+ className={className}
+ />
+ ));
}
diff --git a/apps/web/src/components/task/custom-fields/task-custom-field-rows.tsx b/apps/web/src/components/task/custom-fields/task-custom-field-rows.tsx
index 544cf7a9b..d2c76569e 100644
--- a/apps/web/src/components/task/custom-fields/task-custom-field-rows.tsx
+++ b/apps/web/src/components/task/custom-fields/task-custom-field-rows.tsx
@@ -1,5 +1,8 @@
+import { Link } from "@tanstack/react-router";
+import { SlidersHorizontal } from "lucide-react";
import { useTranslation } from "react-i18next";
import { CustomFieldRow } from "@/components/custom-fields/custom-field-row";
+import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { useTaskCustomFields } from "./use-task-custom-fields";
type TaskCustomFieldRowsProps = {
@@ -12,6 +15,7 @@ export function TaskCustomFieldRows({
projectId,
}: TaskCustomFieldRowsProps) {
const { t } = useTranslation();
+ const { canUpdateProjects } = useWorkspacePermission();
const { fields, values, save, canEdit } = useTaskCustomFields(
taskId,
projectId,
@@ -22,22 +26,33 @@ export function TaskCustomFieldRows({
return (
<section
aria-label={t("tasks:customFields.fields")}
- className="flex flex-col gap-1"
+ className="flex flex-col gap-0.5 border-border border-t pt-3.5"
>
- <span className="px-2 font-medium text-foreground/70 text-xs">
- {t("tasks:customFields.fields")}
- </span>
- <div className="flex flex-col gap-1">
- {fields.map((field) => (
- <CustomFieldRow
- key={field.id}
- field={field}
- value={values[field.id] ?? ""}
- onChange={(value) => void save(field, value)}
- disabled={!canEdit}
- />
- ))}
+ <div className="flex h-6 items-center justify-between pr-1 pb-1 pl-2">
+ <span className="font-medium text-muted-foreground text-xs">
+ {t("tasks:customFields.fields")}
+ </span>
+ {canUpdateProjects() && (
+ <Link
+ to="/dashboard/settings/projects/$projectId/custom-fields"
+ params={{ projectId }}
+ aria-label={t("tasks:customFields.manage")}
+ title={t("tasks:customFields.manage")}
+ className="flex size-6 items-center justify-center rounded-md text-muted-foreground/70 outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground"
+ >
+ <SlidersHorizontal className="size-3.25" />
+ </Link>
+ )}
</div>
+ {fields.map((field) => (
+ <CustomFieldRow
+ key={field.id}
+ field={field}
+ value={values[field.id] ?? ""}
+ onChange={(value) => void save(field, value)}
+ disabled={!canEdit}
+ />
+ ))}
</section>
);
}
diff --git a/apps/web/src/components/task/extensions/shiki-code-block.ts b/apps/web/src/components/task/extensions/shiki-code-block.ts
index aa2ebf8ed..746d7b3a2 100644
--- a/apps/web/src/components/task/extensions/shiki-code-block.ts
+++ b/apps/web/src/components/task/extensions/shiki-code-block.ts
@@ -9,6 +9,7 @@ type ShikiCodeBlockOptions = {
defaultLanguage: string;
highlighter: Highlighter | null | (() => Highlighter | null);
resolveLanguage: (language: string) => string;
+ detectLanguage: (code: string) => string | null;
themeDark: string;
themeLight: string;
};
@@ -48,7 +49,7 @@ function getDecorations(doc: ProseMirrorNode, options: ShikiCodeBlockOptions) {
const rawLanguage =
(block.node.attrs.language as string | undefined) || "";
const normalizedLanguage = options.resolveLanguage(
- rawLanguage || options.defaultLanguage,
+ rawLanguage || options.detectLanguage(code) || options.defaultLanguage,
);
let tokensResult: ReturnType<Highlighter["codeToTokens"]>;
@@ -112,6 +113,7 @@ export const ShikiCodeBlock = Extension.create<ShikiCodeBlockOptions>({
defaultLanguage: "text",
highlighter: null,
resolveLanguage: (language: string) => language,
+ detectLanguage: () => null,
themeDark: "github-dark",
themeLight: "github-light",
};
diff --git a/apps/web/src/components/task/header/branch-name.test.ts b/apps/web/src/components/task/header/branch-name.test.ts
new file mode 100644
index 000000000..63e2a527d
--- /dev/null
+++ b/apps/web/src/components/task/header/branch-name.test.ts
@@ -0,0 +1,21 @@
+import { describe, expect, it } from "vite-plus/test";
+import { generateBranchName } from "./branch-name";
+
+describe("generateBranchName", () => {
+ it("adds the title to the default pattern", () => {
+ expect(generateBranchName(undefined, "KAN", 42, "Add rate limiting!")).toBe(
+ "kan-42-add-rate-limiting",
+ );
+ });
+
+ it("follows a custom integration pattern", () => {
+ expect(
+ generateBranchName("feature/{number}-{title}", "KAN", 7, "Fix login"),
+ ).toBe("feature/7-fix-login");
+ });
+
+ it("needs a project slug and task number", () => {
+ expect(generateBranchName(undefined, undefined, 7, "Fix")).toBe("");
+ expect(generateBranchName(undefined, "KAN", null, "Fix")).toBe("");
+ });
+});
diff --git a/apps/web/src/components/task/header/branch-name.ts b/apps/web/src/components/task/header/branch-name.ts
new file mode 100644
index 000000000..014e33504
--- /dev/null
+++ b/apps/web/src/components/task/header/branch-name.ts
@@ -0,0 +1,26 @@
+const DEFAULT_PATTERN = "{slug}-{number}";
+
+function slugify(text: string | undefined) {
+ if (!text) return "";
+ return text
+ .toLowerCase()
+ .replace(/[^a-z0-9]+/g, "-")
+ .replace(/^-|-$/g, "")
+ .slice(0, 50);
+}
+
+export function generateBranchName(
+ pattern: string | null | undefined,
+ projectSlug: string | undefined,
+ taskNumber: number | null | undefined,
+ taskTitle: string | undefined,
+) {
+ if (!projectSlug || !taskNumber) return "";
+ const base = pattern || DEFAULT_PATTERN;
+ const resolved =
+ base === DEFAULT_PATTERN ? `${DEFAULT_PATTERN}-{title}` : base;
+ return resolved
+ .replace("{slug}", projectSlug.toLowerCase())
+ .replace("{number}", taskNumber.toString())
+ .replace("{title}", slugify(taskTitle));
+}
diff --git a/apps/web/src/components/task/header/header-icon-button.tsx b/apps/web/src/components/task/header/header-icon-button.tsx
new file mode 100644
index 000000000..b3df7b9c3
--- /dev/null
+++ b/apps/web/src/components/task/header/header-icon-button.tsx
@@ -0,0 +1,51 @@
+import type { ReactNode } from "react";
+import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
+import { Button } from "@/components/ui/button";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { cn } from "@/lib/cn";
+import type { ShortcutId } from "@/lib/shortcuts/catalog";
+
+type HeaderIconButtonProps = {
+ label: string;
+ shortcutId?: ShortcutId;
+ onClick?: () => void;
+ className?: string;
+ children: ReactNode;
+};
+
+export function HeaderIconButton({
+ label,
+ shortcutId,
+ onClick,
+ className,
+ children,
+}: HeaderIconButtonProps) {
+ return (
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label={label}
+ onClick={onClick}
+ className={cn(
+ "text-muted-foreground hover:text-foreground [&_svg]:size-[15px]",
+ className,
+ )}
+ />
+ }
+ >
+ {children}
+ </TooltipTrigger>
+ <TooltipContent className="flex items-center gap-2">
+ {label}
+ {shortcutId && <ShortcutKeys id={shortcutId} tone="tooltip" />}
+ </TooltipContent>
+ </Tooltip>
+ );
+}
diff --git a/apps/web/src/components/task/header/task-header-actions.tsx b/apps/web/src/components/task/header/task-header-actions.tsx
new file mode 100644
index 000000000..20a4ba4bc
--- /dev/null
+++ b/apps/web/src/components/task/header/task-header-actions.tsx
@@ -0,0 +1,45 @@
+import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
+import { GitBranch, Link2 } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { HeaderIconButton } from "./header-icon-button";
+import { TaskMoreMenu } from "./task-more-menu";
+import { useTaskCopyActions } from "./use-task-copy-actions";
+
+type TaskHeaderActionsProps = {
+ taskId: string;
+ projectId: string;
+ workspaceId: string;
+ deleteHandle: AlertDialogPrimitive.Handle<unknown>;
+};
+
+export function TaskHeaderActions({
+ taskId,
+ projectId,
+ workspaceId,
+ deleteHandle,
+}: TaskHeaderActionsProps) {
+ const { t } = useTranslation();
+ const actions = useTaskCopyActions({ taskId, projectId, workspaceId });
+
+ return (
+ <div className="flex items-center gap-1">
+ <HeaderIconButton
+ label={t("tasks:properties.copyTaskLink")}
+ shortcutId="copyTaskUrl"
+ onClick={actions.copyLink}
+ className="max-sm:hidden"
+ >
+ <Link2 />
+ </HeaderIconButton>
+ <HeaderIconButton
+ label={t("tasks:properties.copyTaskBranch")}
+ shortcutId="copyBranchName"
+ onClick={actions.copyBranch}
+ className="max-sm:hidden"
+ >
+ <GitBranch />
+ </HeaderIconButton>
+ <TaskMoreMenu actions={actions} deleteHandle={deleteHandle} />
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/header/task-more-menu.tsx b/apps/web/src/components/task/header/task-more-menu.tsx
new file mode 100644
index 000000000..787db1f91
--- /dev/null
+++ b/apps/web/src/components/task/header/task-more-menu.tsx
@@ -0,0 +1,96 @@
+import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
+import {
+ CopyIcon,
+ Ellipsis,
+ FileTextIcon,
+ GitBranchIcon,
+ HashIcon,
+ LinkIcon,
+ Trash2Icon,
+} from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
+import { Button } from "@/components/ui/button";
+import {
+ Menu,
+ MenuItem,
+ MenuPopup,
+ MenuSeparator,
+ MenuShortcut,
+ MenuTrigger,
+} from "@/components/ui/menu";
+import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
+import type { useTaskCopyActions } from "./use-task-copy-actions";
+
+type TaskMoreMenuProps = {
+ actions: ReturnType<typeof useTaskCopyActions>;
+ deleteHandle: AlertDialogPrimitive.Handle<unknown>;
+};
+
+export function TaskMoreMenu({ actions, deleteHandle }: TaskMoreMenuProps) {
+ const { t } = useTranslation();
+ const { canDeleteTasks } = useWorkspacePermission();
+
+ return (
+ <Menu>
+ <MenuTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ aria-label={t("tasks:bulk.moreActions")}
+ className="text-muted-foreground hover:text-foreground data-popup-open:bg-accent [&_svg]:size-[15px]"
+ />
+ }
+ >
+ <Ellipsis />
+ </MenuTrigger>
+ <MenuPopup align="end" className="min-w-56">
+ <MenuItem onClick={actions.copyLink} className="sm:hidden">
+ <LinkIcon />
+ {t("tasks:properties.copyTaskLink")}
+ </MenuItem>
+ <MenuItem onClick={actions.copyBranch} className="sm:hidden">
+ <GitBranchIcon />
+ {t("tasks:properties.copyTaskBranch")}
+ </MenuItem>
+ <MenuItem onClick={actions.copyId}>
+ <HashIcon />
+ {t("navigation:shortcuts.items.copyTaskId")}
+ <MenuShortcut>
+ <ShortcutKeys id="copyTaskId" tone="muted" />
+ </MenuShortcut>
+ </MenuItem>
+ <MenuItem onClick={actions.copyTitle}>
+ <CopyIcon />
+ {t("navigation:shortcuts.items.copyTaskTitle")}
+ <MenuShortcut>
+ <ShortcutKeys id="copyTaskTitle" tone="muted" />
+ </MenuShortcut>
+ </MenuItem>
+ <MenuItem onClick={actions.copyMarkdown}>
+ <FileTextIcon />
+ {t("navigation:shortcuts.items.copyAsMarkdown")}
+ <MenuShortcut>
+ <ShortcutKeys id="copyAsMarkdown" tone="muted" />
+ </MenuShortcut>
+ </MenuItem>
+ {canDeleteTasks() && (
+ <>
+ <MenuSeparator />
+ <MenuItem
+ variant="destructive"
+ onClick={() => deleteHandle.open(null)}
+ >
+ <Trash2Icon />
+ {t("tasks:delete.action")}
+ <MenuShortcut>
+ <ShortcutKeys id="deleteTask" tone="muted" />
+ </MenuShortcut>
+ </MenuItem>
+ </>
+ )}
+ </MenuPopup>
+ </Menu>
+ );
+}
diff --git a/apps/web/src/components/task/header/task-sheet-header.tsx b/apps/web/src/components/task/header/task-sheet-header.tsx
new file mode 100644
index 000000000..11967297c
--- /dev/null
+++ b/apps/web/src/components/task/header/task-sheet-header.tsx
@@ -0,0 +1,117 @@
+import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
+import { ChevronDown, ChevronRight, Maximize2, X } from "lucide-react";
+import type { Ref } from "react";
+import { useTranslation } from "react-i18next";
+import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
+import { Button } from "@/components/ui/button";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import icons from "@/constants/project-icons";
+import useGetProject from "@/hooks/queries/project/use-get-project";
+import useGetTask from "@/hooks/queries/task/use-get-task";
+import { HeaderIconButton } from "./header-icon-button";
+import { TaskHeaderActions } from "./task-header-actions";
+import { useTaskCopyActions } from "./use-task-copy-actions";
+
+type TaskSheetHeaderProps = {
+ taskId: string;
+ projectId: string;
+ workspaceId: string;
+ deleteHandle: AlertDialogPrimitive.Handle<unknown>;
+ onOpenFullPage: () => void;
+ onClose: () => void;
+ closeButtonRef: Ref<HTMLButtonElement>;
+};
+
+export function TaskSheetHeader({
+ taskId,
+ projectId,
+ workspaceId,
+ deleteHandle,
+ onOpenFullPage,
+ onClose,
+ closeButtonRef,
+}: TaskSheetHeaderProps) {
+ const { t } = useTranslation();
+ const { data: task } = useGetTask(taskId);
+ const { data: project } = useGetProject({ id: projectId, workspaceId });
+ const { copyId } = useTaskCopyActions({ taskId, projectId, workspaceId });
+ const ProjectIcon =
+ icons[project?.icon as keyof typeof icons] || icons.Layout;
+
+ return (
+ <div className="flex h-11 shrink-0 items-center gap-1 border-border border-b px-2 sm:h-12 sm:gap-2 sm:pr-2.5 sm:pl-5">
+ <div className="flex min-w-0 flex-1 items-center gap-1.5 max-sm:justify-center sm:gap-2">
+ <ProjectIcon
+ aria-hidden="true"
+ className="size-4 shrink-0 text-muted-foreground max-sm:hidden"
+ />
+ <span className="truncate font-medium text-[13px] text-muted-foreground">
+ {project?.name}
+ </span>
+ {project?.slug && task?.number != null && (
+ <>
+ <ChevronRight
+ aria-hidden="true"
+ className="size-3 shrink-0 text-muted-foreground/60 max-sm:hidden"
+ />
+ <span
+ aria-hidden="true"
+ className="text-[13px] text-muted-foreground/60 sm:hidden"
+ >
+ /
+ </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ onClick={copyId}
+ className="shrink-0 rounded-sm font-medium font-mono text-foreground text-xs outline-none hover:text-foreground/80 focus-visible:ring-2 focus-visible:ring-ring"
+ />
+ }
+ >
+ {project.slug}-{task.number}
+ </TooltipTrigger>
+ <TooltipContent className="flex items-center gap-2">
+ {t("navigation:shortcuts.items.copyTaskId")}
+ <ShortcutKeys id="copyTaskId" tone="tooltip" />
+ </TooltipContent>
+ </Tooltip>
+ </>
+ )}
+ </div>
+ <TaskHeaderActions
+ taskId={taskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ deleteHandle={deleteHandle}
+ />
+ <span
+ aria-hidden="true"
+ className="mx-0.5 h-4 w-px bg-border max-sm:hidden"
+ />
+ <HeaderIconButton
+ label={t("tasks:detail.openInFullPage")}
+ onClick={onOpenFullPage}
+ className="max-sm:hidden"
+ >
+ <Maximize2 />
+ </HeaderIconButton>
+ <Button
+ ref={closeButtonRef}
+ variant="ghost"
+ size="icon-sm"
+ onClick={onClose}
+ aria-label={t("common:actions.close")}
+ className="text-muted-foreground hover:text-foreground focus-visible:bg-accent focus-visible:ring-0 max-sm:order-first max-sm:size-9 max-sm:text-foreground/80 [&_svg]:size-[15px] max-sm:[&_svg]:size-4.5"
+ >
+ <ChevronDown className="sm:hidden" />
+ <X className="max-sm:hidden" />
+ </Button>
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/header/use-task-copy-actions.ts b/apps/web/src/components/task/header/use-task-copy-actions.ts
new file mode 100644
index 000000000..fb3377571
--- /dev/null
+++ b/apps/web/src/components/task/header/use-task-copy-actions.ts
@@ -0,0 +1,99 @@
+import {
+ CopyIcon,
+ FileTextIcon,
+ GitBranchIcon,
+ HashIcon,
+ LinkIcon,
+ type LucideIcon,
+} from "lucide-react";
+import { useTranslation } from "react-i18next";
+import useGetGiteaIntegration from "@/hooks/queries/gitea-integration/use-get-gitea-integration";
+import useGetGithubIntegration from "@/hooks/queries/github-integration/use-get-github-integration";
+import useGetGitlabIntegration from "@/hooks/queries/gitlab-integration/use-get-gitlab-integration";
+import useGetProject from "@/hooks/queries/project/use-get-project";
+import useGetProjects from "@/hooks/queries/project/use-get-projects";
+import useGetTask from "@/hooks/queries/task/use-get-task";
+import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";
+import { generateLink } from "@/lib/generate-link";
+import { getTaskPath } from "@/lib/task-link";
+import { toast } from "@/lib/toast";
+import { generateBranchName } from "./branch-name";
+
+type TaskCopyActionsOptions = {
+ taskId: string;
+ projectId: string;
+ workspaceId: string;
+};
+
+export function useTaskCopyActions({
+ taskId,
+ projectId,
+ workspaceId,
+}: TaskCopyActionsOptions) {
+ const { t } = useTranslation();
+ const { data: task } = useGetTask(taskId);
+ const { data: project } = useGetProject({ id: projectId, workspaceId });
+ const { data: workspace } = useActiveWorkspace();
+ const { data: workspaceProjects = [] } = useGetProjects({ workspaceId });
+ const { data: github } = useGetGithubIntegration(projectId);
+ const { data: gitea } = useGetGiteaIntegration(projectId);
+ const { data: gitlab } = useGetGitlabIntegration(projectId);
+
+ const copy = async (text: string, message: string, icon: LucideIcon) => {
+ if (!text) return;
+ try {
+ await navigator.clipboard.writeText(text);
+ toast.message(message, { icon });
+ } catch {
+ toast.error(t("tasks:shortcuts.copyFailed"));
+ }
+ };
+
+ return {
+ copyId: () => {
+ if (!project?.slug || !task?.number) return;
+ void copy(
+ `${project.slug}-${task.number}`,
+ t("tasks:shortcuts.idCopied"),
+ HashIcon,
+ );
+ },
+ copyTitle: () => {
+ if (!task) return;
+ void copy(task.title, t("tasks:shortcuts.titleCopied"), CopyIcon);
+ },
+ copyMarkdown: () => {
+ if (!task) return;
+ const markdown = [`# ${task.title}`, task.description?.trim()]
+ .filter(Boolean)
+ .join("\n\n");
+ void copy(markdown, t("tasks:shortcuts.markdownCopied"), FileTextIcon);
+ },
+ copyLink: () => {
+ if (!task) return;
+ const path = getTaskPath({
+ workspaceId,
+ workspace,
+ projectId,
+ workspaceProjects,
+ taskId,
+ taskNumber: task.number,
+ title: task.title,
+ });
+ void copy(
+ generateLink(path),
+ t("tasks:properties.taskLinkCopied"),
+ LinkIcon,
+ );
+ },
+ copyBranch: () => {
+ const pattern =
+ github?.branchPattern || gitea?.branchPattern || gitlab?.branchPattern;
+ void copy(
+ generateBranchName(pattern, project?.slug, task?.number, task?.title),
+ t("tasks:properties.taskBranchCopied"),
+ GitBranchIcon,
+ );
+ },
+ };
+}
diff --git a/apps/web/src/components/task/menus/assignee-menu-options.test.tsx b/apps/web/src/components/task/menus/assignee-menu-options.test.tsx
new file mode 100644
index 000000000..326870874
--- /dev/null
+++ b/apps/web/src/components/task/menus/assignee-menu-options.test.tsx
@@ -0,0 +1,32 @@
+import { describe, expect, it } from "vite-plus/test";
+import { assigneeMenuOptions } from "./assignee-menu-options";
+
+const members = [{ id: "user-1", name: "John Doe", email: null, image: null }];
+
+function selectedValues(current: string | null | undefined) {
+ return assigneeMenuOptions(members, current, "Unassigned")
+ .filter((option) => option.selected)
+ .map((option) => option.value);
+}
+
+describe("assigneeMenuOptions", () => {
+ it("lists unassigned first, then members", () => {
+ expect(
+ assigneeMenuOptions(members, null, "Unassigned").map(
+ (option) => option.label,
+ ),
+ ).toEqual(["Unassigned", "John Doe"]);
+ });
+
+ it("marks unassigned when nobody is assigned", () => {
+ expect(selectedValues(null)).toEqual([""]);
+ });
+
+ it("marks the assigned member", () => {
+ expect(selectedValues("user-1")).toEqual(["user-1"]);
+ });
+
+ it("marks nothing when the selection is mixed", () => {
+ expect(selectedValues(undefined)).toEqual([]);
+ });
+});
diff --git a/apps/web/src/components/task/menus/assignee-menu-options.tsx b/apps/web/src/components/task/menus/assignee-menu-options.tsx
new file mode 100644
index 000000000..65b72a201
--- /dev/null
+++ b/apps/web/src/components/task/menus/assignee-menu-options.tsx
@@ -0,0 +1,39 @@
+import type { OptionMenuItem } from "@/components/common/option-menu/option-menu-item";
+import { UnassignedAvatar } from "@/components/common/unassigned-avatar";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { getInitials } from "@/lib/get-initials";
+
+type AssignableMember = {
+ id: string;
+ name?: string | null;
+ email?: string | null;
+ image?: string | null;
+};
+
+export function assigneeMenuOptions(
+ members: AssignableMember[],
+ current: string | null | undefined,
+ unassignedLabel: string,
+): OptionMenuItem[] {
+ return [
+ {
+ value: "",
+ label: unassignedLabel,
+ icon: <UnassignedAvatar className="size-4 text-[8px]" />,
+ selected: current !== undefined && !current,
+ },
+ ...members.map((member) => ({
+ value: member.id,
+ label: member.name || member.email || "",
+ icon: (
+ <Avatar className="size-4">
+ <AvatarImage src={member.image ?? ""} alt="" />
+ <AvatarFallback className="text-[8px]">
+ {getInitials(member.name)}
+ </AvatarFallback>
+ </Avatar>
+ ),
+ selected: member.id === current,
+ })),
+ ];
+}
diff --git a/apps/web/src/components/task/menus/status-menu-options.ts b/apps/web/src/components/task/menus/status-menu-options.ts
new file mode 100644
index 000000000..2e5defe62
--- /dev/null
+++ b/apps/web/src/components/task/menus/status-menu-options.ts
@@ -0,0 +1,22 @@
+import type { OptionMenuItem } from "@/components/common/option-menu/option-menu-item";
+import { getColumnIcon } from "@/lib/column";
+import { getStatusDisplayLabel } from "@/lib/i18n/domain";
+
+type StatusColumn = {
+ slug: string;
+ name: string;
+ icon?: string | null;
+ isFinal: boolean;
+};
+
+export function statusMenuOptions(
+ columns: StatusColumn[],
+ current: string | null | undefined,
+): OptionMenuItem[] {
+ return columns.map((column) => ({
+ value: column.slug,
+ label: getStatusDisplayLabel(column.slug, column.name),
+ icon: getColumnIcon(column.slug, column.isFinal, column.icon),
+ selected: column.slug === current,
+ }));
+}
diff --git a/apps/web/src/components/task/properties/assignee-avatar.tsx b/apps/web/src/components/task/properties/assignee-avatar.tsx
new file mode 100644
index 000000000..6be3280dd
--- /dev/null
+++ b/apps/web/src/components/task/properties/assignee-avatar.tsx
@@ -0,0 +1,22 @@
+import { UnassignedAvatar } from "@/components/common/unassigned-avatar";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { getInitials } from "@/lib/get-initials";
+
+type AssigneeAvatarProps = {
+ name: string | null | undefined;
+ image: string | null | undefined;
+ assigned: boolean;
+};
+
+export function AssigneeAvatar({ name, image, assigned }: AssigneeAvatarProps) {
+ if (!assigned) return <UnassignedAvatar className="size-4.5" />;
+
+ return (
+ <Avatar className="size-4.5 shrink-0">
+ <AvatarImage src={image ?? ""} alt="" />
+ <AvatarFallback className="font-semibold text-[8px]">
+ {getInitials(name)}
+ </AvatarFallback>
+ </Avatar>
+ );
+}
diff --git a/apps/web/src/components/task/properties/due-date-text-class.ts b/apps/web/src/components/task/properties/due-date-text-class.ts
new file mode 100644
index 000000000..a09b62dd4
--- /dev/null
+++ b/apps/web/src/components/task/properties/due-date-text-class.ts
@@ -0,0 +1,8 @@
+import type { DueDateStatus } from "@/lib/due-date-status";
+
+export const dueDateTextClass: Record<DueDateStatus, string> = {
+ overdue: "text-destructive-foreground",
+ "due-soon": "text-warning-foreground",
+ "far-future": "",
+ "no-due-date": "",
+};
diff --git a/apps/web/src/components/task/properties/labels-value.tsx b/apps/web/src/components/task/properties/labels-value.tsx
new file mode 100644
index 000000000..3aeaa1eca
--- /dev/null
+++ b/apps/web/src/components/task/properties/labels-value.tsx
@@ -0,0 +1,37 @@
+import { Tag } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { resolveLabelColor } from "@/lib/label-color";
+
+type LabelsValueProps = {
+ labels: { id: string; name: string; color: string }[];
+};
+
+export function LabelsValue({ labels }: LabelsValueProps) {
+ const { t } = useTranslation();
+
+ if (labels.length === 0) {
+ return (
+ <>
+ <Tag className="text-muted-foreground" />
+ <span className="truncate text-muted-foreground">
+ {t("tasks:properties.addLabels")}
+ </span>
+ </>
+ );
+ }
+
+ return (
+ <span className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
+ {labels.map((label) => (
+ <span key={label.id} className="flex min-w-0 items-center gap-1.5">
+ <span
+ aria-hidden="true"
+ className="size-2 shrink-0 rounded-full"
+ style={{ backgroundColor: resolveLabelColor(label.color) }}
+ />
+ <span className="truncate">{label.name}</span>
+ </span>
+ ))}
+ </span>
+ );
+}
diff --git a/apps/web/src/components/task/properties/properties-rail.tsx b/apps/web/src/components/task/properties/properties-rail.tsx
new file mode 100644
index 000000000..1427e34fa
--- /dev/null
+++ b/apps/web/src/components/task/properties/properties-rail.tsx
@@ -0,0 +1,166 @@
+import { ArrowRight, Calendar, CalendarDays } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import icons from "@/constants/project-icons";
+import { getColumnIcon } from "@/lib/column";
+import { cn } from "@/lib/cn";
+import { formatDateShort } from "@/lib/format";
+import { getPriorityLabel } from "@/lib/i18n/domain";
+import { getPriorityIcon } from "@/lib/priority";
+import { TaskCustomFieldRows } from "../custom-fields/task-custom-field-rows";
+import TaskAssigneePopover from "../task-assignee-popover";
+import TaskDueDatePopover from "../task-due-date-popover";
+import TaskLabelsPopover from "../task-labels-popover";
+import TaskMovePopover from "../task-move-popover";
+import TaskPriorityPopover from "../task-priority-popover";
+import TaskStartDatePopover from "../task-start-date-popover";
+import TaskStatusPopover from "../task-status-popover";
+import { AssigneeAvatar } from "./assignee-avatar";
+import { dueDateTextClass } from "./due-date-text-class";
+import { LabelsValue } from "./labels-value";
+import { PropertyRow } from "./property-row";
+import { PropertyValue } from "./property-value";
+import { useTaskProperties } from "./use-task-properties";
+
+type PropertiesRailProps = {
+ taskId: string;
+ projectId: string;
+ workspaceId: string;
+ className?: string;
+};
+
+export function PropertiesRail({
+ taskId,
+ projectId,
+ workspaceId,
+ className,
+}: PropertiesRailProps) {
+ const { t } = useTranslation();
+ const { task, project, labels, status, assignee, dueStatus, canMoveTask } =
+ useTaskProperties(taskId, projectId, workspaceId);
+
+ if (!task) return null;
+
+ const ProjectIcon =
+ icons[project?.icon as keyof typeof icons] || icons.Layout;
+ const projectValue = (
+ <>
+ <ProjectIcon className="text-muted-foreground" />
+ <span className="truncate">{project?.name}</span>
+ </>
+ );
+
+ return (
+ <aside
+ aria-label={t("tasks:properties.title")}
+ className={cn("flex flex-col gap-4 px-3 pt-4 pb-6", className)}
+ >
+ <div className="flex flex-col gap-0.5">
+ <PropertyRow label={t("tasks:status.label")}>
+ <TaskStatusPopover task={task}>
+ <PropertyValue data-task-action="status" shortcutId="changeStatus">
+ {getColumnIcon(task.status ?? "", status.isFinal, status.icon)}
+ <span className="truncate">{status.label}</span>
+ </PropertyValue>
+ </TaskStatusPopover>
+ </PropertyRow>
+
+ <PropertyRow label={t("tasks:priority.label")}>
+ <TaskPriorityPopover task={task}>
+ <PropertyValue
+ data-task-action="priority"
+ shortcutId="changePriority"
+ >
+ {getPriorityIcon(task.priority ?? "")}
+ <span className="truncate">
+ {getPriorityLabel(task.priority ?? "")}
+ </span>
+ </PropertyValue>
+ </TaskPriorityPopover>
+ </PropertyRow>
+
+ <PropertyRow label={t("tasks:assignee.label")}>
+ <TaskAssigneePopover task={task} workspaceId={workspaceId}>
+ <PropertyValue data-task-action="assignee" shortcutId="assignTask">
+ <AssigneeAvatar
+ name={assignee?.user?.name || task.assigneeName}
+ image={assignee?.user?.image}
+ assigned={Boolean(task.userId)}
+ />
+ <span
+ className={cn(
+ "truncate",
+ !task.userId && "text-muted-foreground",
+ )}
+ >
+ {assignee?.user?.name ||
+ task.assigneeName ||
+ t("tasks:popover.assignee.unassigned")}
+ </span>
+ </PropertyValue>
+ </TaskAssigneePopover>
+ </PropertyRow>
+
+ <PropertyRow label={t("tasks:properties.labels")} align="start">
+ <TaskLabelsPopover task={task} workspaceId={workspaceId}>
+ <PropertyValue
+ data-task-action="labels"
+ shortcutId="changeLabels"
+ className="h-auto min-h-7.5 py-1.25"
+ >
+ <LabelsValue labels={labels} />
+ </PropertyValue>
+ </TaskLabelsPopover>
+ </PropertyRow>
+
+ <PropertyRow label={t("tasks:properties.dates")}>
+ <div className="flex min-w-0 items-center gap-0.5">
+ <TaskStartDatePopover task={task}>
+ <PropertyValue className="flex-none">
+ <CalendarDays className="text-muted-foreground" />
+ <span
+ className={cn(!task.startDate && "text-muted-foreground")}
+ >
+ {task.startDate
+ ? formatDateShort(task.startDate)
+ : t("tasks:properties.start")}
+ </span>
+ </PropertyValue>
+ </TaskStartDatePopover>
+ <ArrowRight className="size-3 shrink-0 text-muted-foreground/60" />
+ <TaskDueDatePopover task={task}>
+ <PropertyValue
+ data-task-action="dueDate"
+ className={cn("flex-none", dueDateTextClass[dueStatus])}
+ >
+ <Calendar
+ className={cn(!task.dueDate && "text-muted-foreground")}
+ />
+ <span className={cn(!task.dueDate && "text-muted-foreground")}>
+ {task.dueDate
+ ? formatDateShort(task.dueDate)
+ : t("tasks:dueDate.label")}
+ </span>
+ </PropertyValue>
+ </TaskDueDatePopover>
+ </div>
+ </PropertyRow>
+
+ <PropertyRow label={t("tasks:properties.project")}>
+ {canMoveTask ? (
+ <TaskMovePopover task={task} workspaceId={workspaceId}>
+ <PropertyValue data-task-action="move" shortcutId="moveToProject">
+ {projectValue}
+ </PropertyValue>
+ </TaskMovePopover>
+ ) : (
+ <div className="flex h-7.5 min-w-0 items-center gap-2 px-2 font-medium text-[13px] text-foreground [&_svg]:size-3.5 [&_svg]:shrink-0">
+ {projectValue}
+ </div>
+ )}
+ </PropertyRow>
+ </div>
+
+ <TaskCustomFieldRows taskId={taskId} projectId={projectId} />
+ </aside>
+ );
+}
diff --git a/apps/web/src/components/task/properties/property-chips.tsx b/apps/web/src/components/task/properties/property-chips.tsx
new file mode 100644
index 000000000..877b6757b
--- /dev/null
+++ b/apps/web/src/components/task/properties/property-chips.tsx
@@ -0,0 +1,163 @@
+import { ArrowRight, Calendar } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { propertyChipClass } from "@/components/custom-fields/property-chip-class";
+import icons from "@/constants/project-icons";
+import { cn } from "@/lib/cn";
+import { getColumnIcon } from "@/lib/column";
+import { formatDateShort } from "@/lib/format";
+import { getPriorityLabel } from "@/lib/i18n/domain";
+import { getPriorityIcon } from "@/lib/priority";
+import { TaskCustomFieldChips } from "../custom-fields/task-custom-field-chips";
+import TaskAssigneePopover from "../task-assignee-popover";
+import TaskDueDatePopover from "../task-due-date-popover";
+import TaskLabelsPopover from "../task-labels-popover";
+import TaskMovePopover from "../task-move-popover";
+import TaskPriorityPopover from "../task-priority-popover";
+import TaskStartDatePopover from "../task-start-date-popover";
+import TaskStatusPopover from "../task-status-popover";
+import { AssigneeAvatar } from "./assignee-avatar";
+import { dueDateTextClass } from "./due-date-text-class";
+import { LabelsValue } from "./labels-value";
+import { useTaskProperties } from "./use-task-properties";
+
+type PropertyChipsProps = {
+ taskId: string;
+ projectId: string;
+ workspaceId: string;
+ className?: string;
+};
+
+const chip = cn(
+ propertyChipClass,
+ "h-8 bg-accent/30 text-foreground [&_svg]:size-3.5 [&_svg]:shrink-0",
+);
+const dateButton =
+ "flex h-full items-center gap-1.5 rounded-[5px] px-1.5 outline-none transition-colors hover:bg-accent/60 focus-visible:bg-accent/60 data-popup-open:bg-accent";
+
+export function PropertyChips({
+ taskId,
+ projectId,
+ workspaceId,
+ className,
+}: PropertyChipsProps) {
+ const { t } = useTranslation();
+ const { task, project, labels, status, assignee, dueStatus, canMoveTask } =
+ useTaskProperties(taskId, projectId, workspaceId);
+
+ if (!task) return null;
+
+ const ProjectIcon =
+ icons[project?.icon as keyof typeof icons] || icons.Layout;
+ const projectContent = (
+ <>
+ <ProjectIcon className="text-muted-foreground" />
+ <span className="max-w-40 truncate">{project?.name}</span>
+ </>
+ );
+
+ return (
+ <div className={cn("flex flex-col gap-1.5", className)}>
+ <div className="flex flex-wrap items-center gap-1.5">
+ <TaskStatusPopover task={task}>
+ <button type="button" data-task-action="status" className={chip}>
+ {getColumnIcon(task.status ?? "", status.isFinal, status.icon)}
+ <span className="truncate">{status.label}</span>
+ </button>
+ </TaskStatusPopover>
+ <TaskPriorityPopover task={task}>
+ <button type="button" data-task-action="priority" className={chip}>
+ {getPriorityIcon(task.priority ?? "")}
+ <span className="truncate">
+ {getPriorityLabel(task.priority ?? "")}
+ </span>
+ </button>
+ </TaskPriorityPopover>
+ <TaskAssigneePopover task={task} workspaceId={workspaceId}>
+ <button
+ type="button"
+ data-task-action="assignee"
+ className={cn(chip, "pl-1.5")}
+ >
+ <AssigneeAvatar
+ name={assignee?.user?.name || task.assigneeName}
+ image={assignee?.user?.image}
+ assigned={Boolean(task.userId)}
+ />
+ <span
+ className={cn(
+ "max-w-32 truncate",
+ !task.userId && "text-muted-foreground",
+ )}
+ >
+ {assignee?.user?.name ||
+ task.assigneeName ||
+ t("tasks:popover.assignee.unassigned")}
+ </span>
+ </button>
+ </TaskAssigneePopover>
+ <div className={cn(chip, "gap-0.5 px-1 hover:bg-accent/30")}>
+ <TaskStartDatePopover task={task}>
+ <button type="button" className={dateButton}>
+ <Calendar
+ className={cn(
+ task.dueDate
+ ? dueDateTextClass[dueStatus]
+ : "text-muted-foreground",
+ )}
+ />
+ <span className="text-muted-foreground">
+ {task.startDate
+ ? formatDateShort(task.startDate)
+ : t("tasks:properties.start")}
+ </span>
+ </button>
+ </TaskStartDatePopover>
+ <ArrowRight className="text-muted-foreground/60" />
+ <TaskDueDatePopover task={task}>
+ <button
+ type="button"
+ data-task-action="dueDate"
+ className={cn(
+ dateButton,
+ task.dueDate
+ ? dueDateTextClass[dueStatus]
+ : "text-muted-foreground",
+ )}
+ >
+ {task.dueDate
+ ? formatDateShort(task.dueDate)
+ : t("tasks:dueDate.label")}
+ </button>
+ </TaskDueDatePopover>
+ </div>
+ <TaskLabelsPopover task={task} workspaceId={workspaceId}>
+ <button
+ type="button"
+ data-task-action="labels"
+ className={cn(chip, "h-auto min-h-8 py-1")}
+ >
+ <LabelsValue labels={labels} />
+ </button>
+ </TaskLabelsPopover>
+ </div>
+ <div className="flex flex-wrap items-center gap-1.5">
+ {canMoveTask ? (
+ <TaskMovePopover task={task} workspaceId={workspaceId}>
+ <button type="button" data-task-action="move" className={chip}>
+ {projectContent}
+ </button>
+ </TaskMovePopover>
+ ) : (
+ <span className={cn(chip, "hover:bg-accent/30")}>
+ {projectContent}
+ </span>
+ )}
+ <TaskCustomFieldChips
+ taskId={taskId}
+ projectId={projectId}
+ className="h-8"
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/properties/property-row.tsx b/apps/web/src/components/task/properties/property-row.tsx
new file mode 100644
index 000000000..270dbbc77
--- /dev/null
+++ b/apps/web/src/components/task/properties/property-row.tsx
@@ -0,0 +1,40 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/cn";
+
+type PropertyRowProps = {
+ label: string;
+ align?: "center" | "start";
+ children: ReactNode;
+};
+
+export function PropertyRow({
+ label,
+ align = "center",
+ children,
+}: PropertyRowProps) {
+ return (
+ <div
+ className={cn(
+ "flex min-h-8 min-w-0",
+ align === "start" ? "items-start" : "items-center",
+ )}
+ >
+ <span
+ className={cn(
+ "w-21 shrink-0 truncate pl-2 text-muted-foreground text-xs",
+ align === "start" && "flex h-8 items-center",
+ )}
+ >
+ {label}
+ </span>
+ <div
+ className={cn(
+ "flex min-w-0 flex-1 items-center",
+ align === "start" && "py-px",
+ )}
+ >
+ {children}
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/properties/property-value.tsx b/apps/web/src/components/task/properties/property-value.tsx
new file mode 100644
index 000000000..3f0495581
--- /dev/null
+++ b/apps/web/src/components/task/properties/property-value.tsx
@@ -0,0 +1,33 @@
+import type { ComponentProps } from "react";
+import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
+import { cn } from "@/lib/cn";
+import type { ShortcutId } from "@/lib/shortcuts/catalog";
+
+type PropertyValueProps = ComponentProps<"button"> & {
+ shortcutId?: ShortcutId;
+};
+
+export function PropertyValue({
+ shortcutId,
+ className,
+ children,
+ ...props
+}: PropertyValueProps) {
+ return (
+ <button
+ type="button"
+ className={cn(
+ "group/value flex h-7.5 min-w-0 flex-1 items-center gap-2 rounded-md px-2 text-left font-medium text-[13px] text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent data-popup-open:bg-accent disabled:cursor-default disabled:hover:bg-transparent [&_svg]:size-3.5 [&_svg]:shrink-0",
+ className,
+ )}
+ {...props}
+ >
+ {children}
+ {shortcutId && (
+ <span className="ms-auto hidden shrink-0 opacity-0 transition-opacity group-hover/value:opacity-100 sm:inline-flex">
+ <ShortcutKeys id={shortcutId} />
+ </span>
+ )}
+ </button>
+ );
+}
diff --git a/apps/web/src/components/task/properties/use-task-properties.ts b/apps/web/src/components/task/properties/use-task-properties.ts
new file mode 100644
index 000000000..1d5a0cc7f
--- /dev/null
+++ b/apps/web/src/components/task/properties/use-task-properties.ts
@@ -0,0 +1,46 @@
+import { useGetColumns } from "@/hooks/queries/column/use-get-columns";
+import useGetLabelsByTask from "@/hooks/queries/label/use-get-labels-by-task";
+import useGetProject from "@/hooks/queries/project/use-get-project";
+import useGetProjects from "@/hooks/queries/project/use-get-projects";
+import useGetTask from "@/hooks/queries/task/use-get-task";
+import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";
+import { getDueDateStatus, isTaskCompleted } from "@/lib/due-date-status";
+import { getStatusDisplayLabel } from "@/lib/i18n/domain";
+
+export function useTaskProperties(
+ taskId: string,
+ projectId: string,
+ workspaceId: string,
+) {
+ const { data: task } = useGetTask(taskId);
+ const { data: project } = useGetProject({ id: projectId, workspaceId });
+ const { data: columns = [] } = useGetColumns(projectId);
+ const { data: workspaceUsers } = useGetActiveWorkspaceUsers(workspaceId);
+ const { data: labels = [] } = useGetLabelsByTask(taskId);
+ const { data: workspaceProjects = [] } = useGetProjects({ workspaceId });
+
+ const statusColumn = columns.find(
+ (column) => column.slug === task?.status || column.id === task?.status,
+ );
+
+ return {
+ task,
+ project,
+ labels,
+ status: {
+ label: getStatusDisplayLabel(task?.status ?? "", statusColumn?.name),
+ isFinal: statusColumn?.isFinal ?? false,
+ icon: statusColumn?.icon,
+ },
+ assignee: workspaceUsers?.members?.find(
+ (member) => member.userId === task?.userId,
+ ),
+ dueStatus: getDueDateStatus(
+ task?.dueDate ?? null,
+ isTaskCompleted(task?.status ?? "", columns),
+ ),
+ canMoveTask:
+ Boolean(task) &&
+ workspaceProjects.some((project) => project.id !== task?.projectId),
+ };
+}
diff --git a/apps/web/src/components/task/sections/reference-assignee-button.tsx b/apps/web/src/components/task/sections/reference-assignee-button.tsx
new file mode 100644
index 000000000..40eec2e95
--- /dev/null
+++ b/apps/web/src/components/task/sections/reference-assignee-button.tsx
@@ -0,0 +1,35 @@
+import { useTranslation } from "react-i18next";
+import type Task from "@/types/task";
+import { AssigneeAvatar } from "../properties/assignee-avatar";
+import SubtaskAssigneePopover from "../subtask-assignee-popover";
+
+type ReferenceAssigneeButtonProps = {
+ tasks: Task[];
+ workspaceId: string;
+ name: string | null | undefined;
+ image: string | null | undefined;
+};
+
+export function ReferenceAssigneeButton({
+ tasks,
+ workspaceId,
+ name,
+ image,
+}: ReferenceAssigneeButtonProps) {
+ const { t } = useTranslation();
+ const assigned = Boolean(tasks[0]?.userId);
+
+ return (
+ <SubtaskAssigneePopover tasks={tasks} workspaceId={workspaceId}>
+ <button
+ type="button"
+ aria-label={
+ assigned && name ? name : t("tasks:popover.assignee.unassigned")
+ }
+ className="relative flex shrink-0 rounded-full outline-none before:absolute before:-inset-1 focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <AssigneeAvatar name={name} image={image} assigned={assigned} />
+ </button>
+ </SubtaskAssigneePopover>
+ );
+}
diff --git a/apps/web/src/components/task/sections/reference-status-button.tsx b/apps/web/src/components/task/sections/reference-status-button.tsx
new file mode 100644
index 000000000..94b68d80d
--- /dev/null
+++ b/apps/web/src/components/task/sections/reference-status-button.tsx
@@ -0,0 +1,18 @@
+import type { ComponentProps } from "react";
+import { cn } from "@/lib/cn";
+
+export function ReferenceStatusButton({
+ className,
+ ...props
+}: ComponentProps<"button">) {
+ return (
+ <button
+ type="button"
+ className={cn(
+ "relative flex size-3.5 shrink-0 items-center justify-center rounded-full outline-none before:absolute before:-inset-1.5 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default [&_svg]:size-3.5",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
diff --git a/apps/web/src/components/task/sections/relation-tag.tsx b/apps/web/src/components/task/sections/relation-tag.tsx
new file mode 100644
index 000000000..d773769f8
--- /dev/null
+++ b/apps/web/src/components/task/sections/relation-tag.tsx
@@ -0,0 +1,41 @@
+import { Ban, Link2, OctagonAlert } from "lucide-react";
+import { useTranslation } from "react-i18next";
+import { cn } from "@/lib/cn";
+
+export type RelationKind = "blocked_by" | "blocks" | "related";
+
+const tones = {
+ blocked_by: {
+ className: "bg-destructive/8 text-destructive-foreground",
+ icon: Ban,
+ labelKey: "tasks:relations.blockedBy",
+ },
+ blocks: {
+ className: "bg-warning/10 text-warning-foreground",
+ icon: OctagonAlert,
+ labelKey: "tasks:relations.blocks",
+ },
+ related: {
+ className: "bg-accent text-muted-foreground",
+ icon: Link2,
+ labelKey: "tasks:relations.related",
+ },
+} as const;
+
+export function RelationTag({ kind }: { kind: RelationKind }) {
+ const { t } = useTranslation();
+ const tone = tones[kind];
+ const Icon = tone.icon;
+
+ return (
+ <span
+ className={cn(
+ "inline-flex h-5 shrink-0 items-center gap-1.25 rounded-[5px] px-1.75 font-medium text-[11px]",
+ tone.className,
+ )}
+ >
+ <Icon aria-hidden="true" className="size-2.75" />
+ {t(tone.labelKey)}
+ </span>
+ );
+}
diff --git a/apps/web/src/components/task/sections/section-add-button.tsx b/apps/web/src/components/task/sections/section-add-button.tsx
new file mode 100644
index 000000000..8334fe1b5
--- /dev/null
+++ b/apps/web/src/components/task/sections/section-add-button.tsx
@@ -0,0 +1,21 @@
+import { Plus } from "lucide-react";
+import type { ComponentProps } from "react";
+import { cn } from "@/lib/cn";
+
+export function SectionAddButton({
+ className,
+ ...props
+}: ComponentProps<"button">) {
+ return (
+ <button
+ type="button"
+ className={cn(
+ "flex size-6.5 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent focus-visible:text-foreground disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-accent",
+ className,
+ )}
+ {...props}
+ >
+ <Plus className="size-3.5" />
+ </button>
+ );
+}
diff --git a/apps/web/src/components/task/sections/section-header.tsx b/apps/web/src/components/task/sections/section-header.tsx
new file mode 100644
index 000000000..f8268fdb9
--- /dev/null
+++ b/apps/web/src/components/task/sections/section-header.tsx
@@ -0,0 +1,18 @@
+import type { ReactNode } from "react";
+
+type SectionHeaderProps = {
+ title: ReactNode;
+ meta?: ReactNode;
+ action?: ReactNode;
+};
+
+export function SectionHeader({ title, meta, action }: SectionHeaderProps) {
+ return (
+ <div className="flex h-7 shrink-0 items-center gap-2">
+ <h3 className="font-medium text-[13px] text-foreground">{title}</h3>
+ {meta}
+ <span className="flex-1" />
+ {action}
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/sections/section-row-class.ts b/apps/web/src/components/task/sections/section-row-class.ts
new file mode 100644
index 000000000..63a6a887c
--- /dev/null
+++ b/apps/web/src/components/task/sections/section-row-class.ts
@@ -0,0 +1,5 @@
+export const sectionRowClass =
+ "group flex min-h-10 min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-accent sm:h-8.5 sm:min-h-0 sm:py-0";
+
+export const sectionIdClass =
+ "w-13 shrink-0 truncate font-mono text-muted-foreground/70 text-xs max-sm:hidden";
diff --git a/apps/web/src/components/task/sections/task-reference-row.tsx b/apps/web/src/components/task/sections/task-reference-row.tsx
new file mode 100644
index 000000000..28d9aef92
--- /dev/null
+++ b/apps/web/src/components/task/sections/task-reference-row.tsx
@@ -0,0 +1,49 @@
+import type { ComponentProps, ReactNode } from "react";
+import { cn } from "@/lib/cn";
+import { sectionIdClass, sectionRowClass } from "./section-row-class";
+
+type TaskReferenceRowProps = ComponentProps<"div"> & {
+ status: ReactNode;
+ displayId: string | null;
+ title: string;
+ done: boolean;
+ onOpen: () => void;
+ tag?: ReactNode;
+ assignee: ReactNode;
+};
+
+export function TaskReferenceRow({
+ status,
+ displayId,
+ title,
+ done,
+ onOpen,
+ tag,
+ assignee,
+ className,
+ ...props
+}: TaskReferenceRowProps) {
+ return (
+ <div
+ className={cn(sectionRowClass, "cursor-default", className)}
+ {...props}
+ >
+ {status}
+ <span className={sectionIdClass}>{displayId}</span>
+ <button
+ type="button"
+ onClick={onOpen}
+ className={cn(
+ "min-w-0 flex-1 text-left text-[13px] outline-none focus-visible:underline max-sm:line-clamp-2 sm:truncate",
+ done
+ ? "text-muted-foreground line-through"
+ : "text-foreground/85 group-hover:text-foreground",
+ )}
+ >
+ {title}
+ </button>
+ {tag}
+ {assignee}
+ </div>
+ );
+}
diff --git a/apps/web/src/components/task/sections/use-project-slugs.ts b/apps/web/src/components/task/sections/use-project-slugs.ts
new file mode 100644
index 000000000..cc7d4fc0d
--- /dev/null
+++ b/apps/web/src/components/task/sections/use-project-slugs.ts
@@ -0,0 +1,9 @@
+import useGetProjects from "@/hooks/queries/project/use-get-projects";
+
+export function useProjectSlugs(workspaceId: string) {
+ const { data: projects = [] } = useGetProjects({ workspaceId });
+ return (projectId: string, number: number | null | undefined) => {
+ const slug = projects.find((project) => project.id === projectId)?.slug;
+ return slug && number != null ? `${slug}-${number}` : null;
+ };
+}
diff --git a/apps/web/src/components/task/subtask-assignee-popover.tsx b/apps/web/src/components/task/subtask-assignee-popover.tsx
index 925f7ccfc..5787483f9 100644
--- a/apps/web/src/components/task/subtask-assignee-popover.tsx
+++ b/apps/web/src/components/task/subtask-assignee-popover.tsx
@@ -1,24 +1,17 @@
-import { Check } from "lucide-react";
-import { useCallback, useMemo, useState } from "react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import { Button } from "@/components/ui/button";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ShortcutNumber } from "@/components/ui/shortcut-number";
import { useUpdateTaskAssignee } from "@/hooks/mutations/task/use-update-task-assignee";
import useGetMembersOfProjects from "@/hooks/queries/workspace-users/use-get-members-of-projects";
-import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-import { getInitials } from "@/lib/get-initials";
import { toast } from "@/lib/toast";
import type Task from "@/types/task";
-
-const INITIAL_VISIBLE_USERS = 40;
-const VISIBLE_USERS_STEP = 40;
+import { assigneeMenuOptions } from "./menus/assignee-menu-options";
type SubtaskAssigneePopoverProps = {
tasks: Task[];
@@ -33,146 +26,48 @@ export default function SubtaskAssigneePopover({
}: SubtaskAssigneePopoverProps) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
- const [visibleUsersCount, setVisibleUsersCount] = useState(
- INITIAL_VISIBLE_USERS,
- );
const { mutateAsync: updateTaskAssignee } = useUpdateTaskAssignee();
- const { data: projectMembers } = useGetMembersOfProjects({
+ const { data: members = [] } = useGetMembersOfProjects({
workspaceId,
projectIds: tasks.map((task) => task.projectId),
});
const { canAssignTasks } = useWorkspacePermission();
- const canAssign = canAssignTasks();
-
- const usersOptions = useMemo(() => {
- return projectMembers?.map((member) => ({
- label: member.name || member.email,
- value: member.id,
- image: member.image ?? "",
- name: member.name,
- }));
- }, [projectMembers]);
-
- const allSameAssignee =
- tasks.length > 0 && tasks.every((t) => t.userId === tasks[0].userId);
- const currentAssignee = allSameAssignee ? tasks[0].userId : null;
-
- const handleAssigneeChange = useCallback(
- async (newUserId: string) => {
- try {
- await Promise.all(
- tasks.map((task) =>
- updateTaskAssignee({
- ...task,
- userId: newUserId,
- }),
- ),
- );
- setOpen(false);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : t("tasks:popover.assignee.updateError"),
- );
- }
- },
- [t, tasks, updateTaskAssignee],
- );
- const shortcutOptions = useMemo(() => {
- const unassignedOption = { onSelect: () => handleAssigneeChange("") };
- const userOptions = (usersOptions || []).slice(0, 8).map((user) => ({
- onSelect: () => handleAssigneeChange(user.value),
- }));
- return [unassignedOption, ...userOptions];
- }, [usersOptions, handleAssigneeChange]);
+ if (!canAssignTasks()) return <>{children}</>;
- const visibleUsersOptions = useMemo(() => {
- return usersOptions?.slice(0, visibleUsersCount) ?? [];
- }, [usersOptions, visibleUsersCount]);
+ const current = tasks.every((task) => task.userId === tasks[0]?.userId)
+ ? (tasks[0]?.userId ?? null)
+ : undefined;
- const handleOpenChange = useCallback((nextOpen: boolean) => {
- setOpen(nextOpen);
- if (nextOpen) {
- setVisibleUsersCount(INITIAL_VISIBLE_USERS);
+ const changeAssignee = async (userId: string) => {
+ setOpen(false);
+ try {
+ await Promise.all(
+ tasks.map((task) => updateTaskAssignee({ ...task, userId })),
+ );
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t("tasks:popover.assignee.updateError"),
+ );
}
- }, []);
-
- const handleListScroll = useCallback(
- (event: React.UIEvent<HTMLDivElement>) => {
- const target = event.currentTarget;
- const nearBottom =
- target.scrollHeight - target.scrollTop - target.clientHeight < 48;
-
- if (!nearBottom) return;
-
- setVisibleUsersCount((current) => {
- const totalUsers = usersOptions?.length ?? current;
- return Math.min(current + VISIBLE_USERS_STEP, totalUsers);
- });
- },
- [usersOptions?.length],
- );
-
- useNumberedShortcuts(open, shortcutOptions);
-
- if (!canAssign) return <>{children}</>;
+ };
return (
- <Popover open={open} onOpenChange={handleOpenChange} modal={false}>
+ <Popover open={open} onOpenChange={setOpen} modal={false}>
<PopoverTrigger asChild>{children}</PopoverTrigger>
- <PopoverContent className="w-56 p-0" align="start">
- <div
- className="max-h-80 space-y-1 overflow-y-auto p-1"
- onScroll={handleListScroll}
- >
- <Button
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2"
- onClick={() => handleAssigneeChange("")}
- >
- <div
- className="w-6 h-6 rounded-full bg-muted border border-border flex items-center justify-center"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[10px] font-medium text-muted-foreground">
- ?
- </span>
- </div>
- <span className="text-sm">
- {t("tasks:popover.assignee.unassigned")}
- </span>
- {allSameAssignee && !currentAssignee ? (
- <Check className="ml-auto h-4 w-4" />
- ) : (
- <ShortcutNumber number={1} />
- )}
- </Button>
- {visibleUsersOptions.map((user, index) => (
- <Button
- key={user.value}
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2"
- onClick={() => handleAssigneeChange(user.value)}
- >
- <Avatar className="h-6 w-6">
- <AvatarImage src={user.image ?? ""} alt={user.name || ""} />
- <AvatarFallback className="text-xs font-medium border border-border/30">
- {getInitials(user.name)}
- </AvatarFallback>
- </Avatar>
- <span className="text-sm truncate">{user.label}</span>
- {currentAssignee === user.value ? (
- <Check className="ml-auto h-4 w-4 shrink-0" />
- ) : index < 8 ? (
- <ShortcutNumber number={index + 2} />
- ) : null}
- </Button>
- ))}
- </div>
+ <PopoverContent className="w-60 p-0" align="start">
+ <OptionMenu
+ label={t("tasks:assignee.label")}
+ placeholder={t("tasks:bulk.assigneePlaceholder")}
+ options={assigneeMenuOptions(
+ members,
+ current,
+ t("tasks:popover.assignee.unassigned"),
+ )}
+ onSelect={changeAssignee}
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/subtask-row.tsx b/apps/web/src/components/task/subtask-row.tsx
index 03ecc9f51..86b51e7cf 100644
--- a/apps/web/src/components/task/subtask-row.tsx
+++ b/apps/web/src/components/task/subtask-row.tsx
@@ -1,19 +1,19 @@
import { motion, useReducedMotion } from "framer-motion";
import { useTranslation } from "react-i18next";
-import { EASE_OUT } from "@/lib/motion";
import TaskCardContextMenuContent from "@/components/kanban-board/task-card-context-menu/task-card-context-menu-content";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import { Checkbox } from "@/components/ui/checkbox";
import { ContextMenu, ContextMenuTrigger } from "@/components/ui/context-menu";
+import { cn } from "@/lib/cn";
import { getColumnIcon } from "@/lib/column";
-import { getInitials } from "@/lib/get-initials";
+import { EASE_OUT } from "@/lib/motion";
import type Task from "@/types/task";
-import SubtaskAssigneePopover from "./subtask-assignee-popover";
-import SubtaskStatusPopover from "./subtask-status-popover";
+import { ReferenceAssigneeButton } from "./sections/reference-assignee-button";
+import { ReferenceStatusButton } from "./sections/reference-status-button";
+import { TaskReferenceRow } from "./sections/task-reference-row";
type SubtaskRowProps = {
task: Task;
tasks: Task[];
+ displayId: string | null;
projectId: string;
workspaceId: string;
workspaceSlug?: string | null;
@@ -33,6 +33,7 @@ type SubtaskRowProps = {
export default function SubtaskRow({
task,
tasks,
+ displayId,
projectId,
workspaceId,
workspaceSlug,
@@ -59,68 +60,35 @@ export default function SubtaskRow({
>
<ContextMenu>
<ContextMenuTrigger asChild>
- <div
- className={`group flex items-center gap-2 py-1 px-2 ${selectionRadius} transition-colors cursor-default ${isSelected ? "bg-primary/10 hover:bg-primary/15" : "hover:bg-accent/50"} ${isFocused ? "ring-1 ring-inset ring-ring/50" : ""}`}
- >
- {/* Completion checkbox: toggles the subtask done/undone and persists it. */}
- <Checkbox
- checked={isCompleted}
- onCheckedChange={onToggleComplete}
- disabled={!canEdit}
- aria-label={t("tasks:subtasks.completeAria", {
- defaultValue: "Mark subtask complete",
- })}
- />
-
- <SubtaskStatusPopover tasks={tasks} projectId={projectId}>
- <button
- type="button"
- className="shrink-0 flex items-center justify-center rounded p-0.5 transition-colors outline-none [&_svg]:text-muted-foreground hover:[&_svg]:text-foreground"
- >
- {getColumnIcon(task.status, false)}
- </button>
- </SubtaskStatusPopover>
-
- <button
- type="button"
- className="flex-1 min-w-0 text-left outline-none"
- onClick={onNavigate}
- >
- <span
- className={`text-sm truncate block ${isCompleted ? "line-through text-muted-foreground" : "text-foreground/90"}`}
- >
- {task.title}
- </span>
- </button>
-
- <SubtaskAssigneePopover tasks={tasks} workspaceId={workspaceId}>
- <button
- type="button"
- className="shrink-0 flex items-center justify-center rounded p-0.5 transition-colors outline-none"
+ <TaskReferenceRow
+ className={cn(
+ selectionRadius,
+ isSelected && "bg-primary/10 hover:bg-primary/15",
+ isFocused && !isSelected && "bg-accent",
+ )}
+ status={
+ <ReferenceStatusButton
+ aria-pressed={isCompleted}
+ aria-label={t("tasks:subtasks.completeAria")}
+ disabled={!canEdit}
+ onClick={onToggleComplete}
>
- {task.userId && assignee ? (
- <Avatar className="h-5 w-5">
- <AvatarImage
- src={assignee?.user?.image ?? ""}
- alt={assignee?.user?.name || ""}
- />
- <AvatarFallback className="text-[9px] font-medium border border-border/30">
- {getInitials(assignee?.user?.name)}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="flex h-5 w-5 items-center justify-center rounded-full border border-dashed border-border/70"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[9px] font-medium text-muted-foreground">
- ?
- </span>
- </div>
- )}
- </button>
- </SubtaskAssigneePopover>
- </div>
+ {getColumnIcon(task.status, isCompleted)}
+ </ReferenceStatusButton>
+ }
+ displayId={displayId}
+ title={task.title}
+ done={isCompleted}
+ onOpen={onNavigate}
+ assignee={
+ <ReferenceAssigneeButton
+ tasks={tasks}
+ workspaceId={workspaceId}
+ name={assignee?.user?.name ?? task.assigneeName}
+ image={assignee?.user?.image}
+ />
+ }
+ />
</ContextMenuTrigger>
<TaskCardContextMenuContent
diff --git a/apps/web/src/components/task/subtask-status-popover.tsx b/apps/web/src/components/task/subtask-status-popover.tsx
index fba6188fe..bf5fc651d 100644
--- a/apps/web/src/components/task/subtask-status-popover.tsx
+++ b/apps/web/src/components/task/subtask-status-popover.tsx
@@ -1,21 +1,17 @@
-import { Check } from "lucide-react";
-import { useCallback, useMemo, useState } from "react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Button } from "@/components/ui/button";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ShortcutNumber } from "@/components/ui/shortcut-number";
import { useUpdateTaskStatus } from "@/hooks/mutations/task/use-update-task-status";
import { useGetColumns } from "@/hooks/queries/column/use-get-columns";
-import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-import { getColumnIcon } from "@/lib/column";
-import { getStatusDisplayLabel } from "@/lib/i18n/domain";
import { toast } from "@/lib/toast";
import type Task from "@/types/task";
+import { statusMenuOptions } from "./menus/status-menu-options";
type SubtaskStatusPopoverProps = {
tasks: Task[];
@@ -31,80 +27,40 @@ export default function SubtaskStatusPopover({
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { data: columns = [] } = useGetColumns(projectId);
- const statusOptions = columns.map((col) => ({
- value: col.slug,
- label: col.name,
- icon: col.icon,
- isFinal: col.isFinal,
- }));
const { mutateAsync: updateTaskStatus } = useUpdateTaskStatus();
const { canUpdateTasks } = useWorkspacePermission();
- const canEdit = canUpdateTasks();
- const allSameStatus =
- tasks.length > 0 && tasks.every((t) => t.status === tasks[0].status);
- const currentStatus = allSameStatus ? tasks[0].status : null;
+ if (!canUpdateTasks()) return <>{children}</>;
- const handleStatusChange = useCallback(
- async (newStatus: string) => {
- try {
- await Promise.all(
- tasks.map((task) =>
- updateTaskStatus({
- ...task,
- status: newStatus,
- }),
- ),
- );
- setOpen(false);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : t("tasks:popover.status.updateError"),
- );
- }
- },
- [t, tasks, updateTaskStatus],
- );
-
- const shortcutOptions = useMemo(
- () =>
- statusOptions.map((status) => ({
- onSelect: () => handleStatusChange(status.value),
- })),
- [handleStatusChange, statusOptions],
- );
-
- useNumberedShortcuts(open, shortcutOptions);
+ const current = tasks.every((task) => task.status === tasks[0]?.status)
+ ? tasks[0]?.status
+ : undefined;
- if (!canEdit) return <>{children}</>;
+ const changeStatus = async (status: string) => {
+ setOpen(false);
+ try {
+ await Promise.all(
+ tasks.map((task) => updateTaskStatus({ ...task, status })),
+ );
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t("tasks:popover.status.updateError"),
+ );
+ }
+ };
return (
<Popover open={open} onOpenChange={setOpen} modal={false}>
<PopoverTrigger asChild>{children}</PopoverTrigger>
- <PopoverContent className="w-48 p-0" align="start">
- <div>
- {statusOptions.map((status, index) => (
- <Button
- key={status.value}
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2 rounded-none first:rounded-t-md last:rounded-b-md"
- onClick={() => handleStatusChange(status.value)}
- >
- {getColumnIcon(status.value, status.isFinal, status.icon)}
- <span className="text-sm">
- {getStatusDisplayLabel(status.value, status.label)}
- </span>
- {currentStatus === status.value ? (
- <Check className="ml-auto h-4 w-4" />
- ) : (
- <ShortcutNumber number={index + 1} />
- )}
- </Button>
- ))}
- </div>
+ <PopoverContent className="w-60 p-0" align="start">
+ <OptionMenu
+ label={t("tasks:status.label")}
+ placeholder={t("tasks:bulk.statusPlaceholder")}
+ options={statusMenuOptions(columns, current)}
+ onSelect={changeStatus}
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-actions.tsx b/apps/web/src/components/task/task-actions.tsx
deleted file mode 100644
index 244210c25..000000000
--- a/apps/web/src/components/task/task-actions.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
-import { Copy, GitBranch } from "lucide-react";
-import { useTranslation } from "react-i18next";
-import { Button } from "@/components/ui/button";
-import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import type Task from "@/types/task";
-import TaskDeleteButton from "./task-delete-button";
-import TaskMovePopover from "./task-move-popover";
-
-type TaskActionsProps = {
- task: Task | undefined;
- workspaceId: string;
- canMoveTask: boolean;
- onCopyLink: () => void;
- onCopyBranch: () => void;
- deleteHandle: AlertDialogPrimitive.Handle<unknown>;
-};
-
-export default function TaskActions({
- task,
- workspaceId,
- canMoveTask,
- onCopyLink,
- onCopyBranch,
- deleteHandle,
-}: TaskActionsProps) {
- const { t } = useTranslation();
-
- return (
- <div className="flex *:not-first:rounded-s-none *:not-first:before:rounded-s-none *:not-last:rounded-e-none *:not-last:border-e-0 *:not-last:before:rounded-e-none">
- {task && canMoveTask && (
- <TaskMovePopover task={task} workspaceId={workspaceId} />
- )}
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="outline"
- size="sm"
- aria-label={t("tasks:properties.copyTaskLink")}
- className="text-foreground"
- onClick={onCopyLink}
- >
- <Copy className="size-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <span className="flex items-center gap-2">
- {t("tasks:properties.copyTaskLink")}
- <ShortcutKeys id="copyTaskUrl" />
- </span>
- </TooltipContent>
- </Tooltip>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="outline"
- size="sm"
- aria-label={t("tasks:properties.copyTaskBranch")}
- className="text-foreground"
- onClick={onCopyBranch}
- >
- <GitBranch className="size-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- <span className="flex items-center gap-2">
- {t("tasks:properties.copyTaskBranch")}
- <ShortcutKeys id="copyBranchName" />
- </span>
- </TooltipContent>
- </Tooltip>
- {task && <TaskDeleteButton handle={deleteHandle} />}
- </TooltipProvider>
- </div>
- );
-}
diff --git a/apps/web/src/components/task/task-activity.tsx b/apps/web/src/components/task/task-activity.tsx
new file mode 100644
index 000000000..ac145972d
--- /dev/null
+++ b/apps/web/src/components/task/task-activity.tsx
@@ -0,0 +1,53 @@
+import { useTranslation } from "react-i18next";
+import Activity from "@/components/activity";
+import CommentInput from "@/components/activity/comment-input";
+import useAuth from "@/components/providers/auth-provider/hooks/use-auth";
+import { Timeline } from "@/components/ui/timeline";
+import useGetActivitiesByTaskId from "@/hooks/queries/activity/use-get-activities-by-task-id";
+import { cn } from "@/lib/cn";
+
+type TaskActivityProps = {
+ taskId: string;
+ projectId: string;
+ className?: string;
+};
+
+export function TaskActivity({
+ taskId,
+ projectId,
+ className,
+}: TaskActivityProps) {
+ const { t } = useTranslation();
+ const { user } = useAuth();
+ const { data: newestFirst = [] } = useGetActivitiesByTaskId(taskId);
+ const activities = [...newestFirst].reverse();
+
+ return (
+ <section
+ aria-label={t("tasks:detail.activity")}
+ className={cn("flex flex-col gap-1", className)}
+ >
+ <h2 className="flex h-7 items-center pb-1 font-medium text-[13px] text-foreground">
+ {t("tasks:detail.activity")}
+ </h2>
+
+ {activities.length > 0 ? (
+ <Timeline>
+ {activities.map((activity, index) => (
+ <Activity key={activity.id} activity={activity} step={index + 1} />
+ ))}
+ </Timeline>
+ ) : (
+ <p className="px-2 py-1 text-muted-foreground text-xs">
+ {t("tasks:detail.noActivity")}
+ </p>
+ )}
+
+ {user?.id && (
+ <div className="pt-2">
+ <CommentInput taskId={taskId} projectId={projectId} />
+ </div>
+ )}
+ </section>
+ );
+}
diff --git a/apps/web/src/components/task/task-assignee-popover.tsx b/apps/web/src/components/task/task-assignee-popover.tsx
index aa204ae7d..d17a37355 100644
--- a/apps/web/src/components/task/task-assignee-popover.tsx
+++ b/apps/web/src/components/task/task-assignee-popover.tsx
@@ -1,24 +1,17 @@
-import { Check } from "lucide-react";
-import { useCallback, useMemo, useState } from "react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import { Button } from "@/components/ui/button";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ShortcutNumber } from "@/components/ui/shortcut-number";
import { useUpdateTaskAssignee } from "@/hooks/mutations/task/use-update-task-assignee";
import useGetProjectMembers from "@/hooks/queries/workspace-users/use-get-project-members";
-import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-import { getInitials } from "@/lib/get-initials";
import { toast } from "@/lib/toast";
import type Task from "@/types/task";
-
-const INITIAL_VISIBLE_USERS = 40;
-const VISIBLE_USERS_STEP = 40;
+import { assigneeMenuOptions } from "./menus/assignee-menu-options";
type TaskAssigneePopoverProps = {
task: Task;
@@ -33,138 +26,42 @@ export default function TaskAssigneePopover({
}: TaskAssigneePopoverProps) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
- const [visibleUsersCount, setVisibleUsersCount] = useState(
- INITIAL_VISIBLE_USERS,
- );
const { mutateAsync: updateTaskAssignee } = useUpdateTaskAssignee();
- const { data: projectMembers } = useGetProjectMembers({
+ const { data: members = [] } = useGetProjectMembers({
workspaceId,
projectId: task.projectId,
});
const { canAssignTasks } = useWorkspacePermission();
- const canAssign = canAssignTasks();
-
- const usersOptions = useMemo(() => {
- return projectMembers?.map((member) => ({
- label: member.name || member.email,
- value: member.id,
- image: member.image ?? "",
- name: member.name,
- }));
- }, [projectMembers]);
-
- const handleAssigneeChange = useCallback(
- async (newUserId: string) => {
- try {
- await updateTaskAssignee({
- ...task,
- userId: newUserId,
- });
- setOpen(false);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : t("tasks:popover.assignee.updateError"),
- );
- }
- },
- [t, task, updateTaskAssignee],
- );
-
- const shortcutOptions = useMemo(() => {
- const unassignedOption = { onSelect: () => handleAssigneeChange("") };
- const userOptions = (usersOptions || []).slice(0, 8).map((user) => ({
- onSelect: () => handleAssigneeChange(user.value),
- }));
- return [unassignedOption, ...userOptions];
- }, [usersOptions, handleAssigneeChange]);
- const visibleUsersOptions = useMemo(() => {
- return usersOptions?.slice(0, visibleUsersCount) ?? [];
- }, [usersOptions, visibleUsersCount]);
+ if (!canAssignTasks()) return <>{children}</>;
- const handleOpenChange = useCallback((nextOpen: boolean) => {
- setOpen(nextOpen);
- if (nextOpen) {
- setVisibleUsersCount(INITIAL_VISIBLE_USERS);
+ const changeAssignee = async (userId: string) => {
+ setOpen(false);
+ try {
+ await updateTaskAssignee({ ...task, userId });
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t("tasks:popover.assignee.updateError"),
+ );
}
- }, []);
-
- const handleListScroll = useCallback(
- (event: React.UIEvent<HTMLDivElement>) => {
- const target = event.currentTarget;
- const nearBottom =
- target.scrollHeight - target.scrollTop - target.clientHeight < 48;
-
- if (!nearBottom) return;
-
- setVisibleUsersCount((current) => {
- const totalUsers = usersOptions?.length ?? current;
- return Math.min(current + VISIBLE_USERS_STEP, totalUsers);
- });
- },
- [usersOptions?.length],
- );
-
- useNumberedShortcuts(open, shortcutOptions);
-
- if (!canAssign) return <>{children}</>;
+ };
return (
- <Popover open={open} onOpenChange={handleOpenChange}>
+ <Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>{children}</PopoverTrigger>
- <PopoverContent className="w-56 p-0" align="start">
- <div
- className="max-h-80 space-y-1 overflow-y-auto p-1"
- onScroll={handleListScroll}
- >
- <Button
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2"
- onClick={() => handleAssigneeChange("")}
- >
- <div
- className="w-6 h-6 rounded-full bg-muted border border-border flex items-center justify-center"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[10px] font-medium text-muted-foreground">
- ?
- </span>
- </div>
- <span className="text-sm">
- {t("tasks:popover.assignee.unassigned")}
- </span>
- {!task.userId ? (
- <Check className="ml-auto h-4 w-4" />
- ) : (
- <ShortcutNumber number={1} />
- )}
- </Button>
- {visibleUsersOptions.map((user, index) => (
- <Button
- key={user.value}
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2"
- onClick={() => handleAssigneeChange(user.value)}
- >
- <Avatar className="h-6 w-6">
- <AvatarImage src={user.image ?? ""} alt={user.name || ""} />
- <AvatarFallback className="text-xs font-medium border border-border/30">
- {getInitials(user.name)}
- </AvatarFallback>
- </Avatar>
- <span className="text-sm truncate">{user.label}</span>
- {task.userId === user.value ? (
- <Check className="ml-auto h-4 w-4 shrink-0" />
- ) : index < 8 ? (
- <ShortcutNumber number={index + 2} />
- ) : null}
- </Button>
- ))}
- </div>
+ <PopoverContent className="w-60 p-0" align="start">
+ <OptionMenu
+ label={t("tasks:assignee.label")}
+ placeholder={t("tasks:bulk.assigneePlaceholder")}
+ options={assigneeMenuOptions(
+ members,
+ task.userId ?? null,
+ t("tasks:popover.assignee.unassigned"),
+ )}
+ onSelect={changeAssignee}
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-delete-button.tsx b/apps/web/src/components/task/task-delete-button.tsx
deleted file mode 100644
index 13b13082b..000000000
--- a/apps/web/src/components/task/task-delete-button.tsx
+++ /dev/null
@@ -1,51 +0,0 @@
-import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
-import { Trash2 } from "lucide-react";
-import { useTranslation } from "react-i18next";
-import { AlertDialogTrigger } from "@/components/ui/alert-dialog";
-import { Button } from "@/components/ui/button";
-import { ShortcutKeys } from "@/components/shortcuts/shortcut-keys";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-
-type TaskDeleteButtonProps = {
- handle: AlertDialogPrimitive.Handle<unknown>;
-};
-
-export default function TaskDeleteButton({ handle }: TaskDeleteButtonProps) {
- const { t } = useTranslation();
- const { canDeleteTasks, isCheckingPermissions } = useWorkspacePermission();
-
- if (isCheckingPermissions || !canDeleteTasks()) {
- return null;
- }
-
- return (
- <Tooltip>
- <TooltipTrigger asChild>
- <AlertDialogTrigger
- handle={handle}
- render={
- <Button
- variant="outline"
- size="sm"
- aria-label={t("tasks:delete.action")}
- className="text-foreground hover:text-destructive-foreground"
- />
- }
- >
- <Trash2 className="size-4" />
- </AlertDialogTrigger>
- </TooltipTrigger>
- <TooltipContent>
- <span className="flex items-center gap-2">
- {t("tasks:delete.action")}
- <ShortcutKeys id="deleteTask" />
- </span>
- </TooltipContent>
- </Tooltip>
- );
-}
diff --git a/apps/web/src/components/task/task-delete-button.test.tsx b/apps/web/src/components/task/task-delete-dialog.test.tsx
similarity index 94%
rename from apps/web/src/components/task/task-delete-button.test.tsx
rename to apps/web/src/components/task/task-delete-dialog.test.tsx
index ec6860dd3..1f74406b3 100644
--- a/apps/web/src/components/task/task-delete-button.test.tsx
+++ b/apps/web/src/components/task/task-delete-dialog.test.tsx
@@ -16,7 +16,6 @@ import {
} from "vite-plus/test";
import { AlertDialogCreateHandle } from "@/components/ui/alert-dialog";
import { ShortcutTestWrapper } from "@/lib/shortcuts/shortcut-test-wrapper";
-import TaskDeleteButton from "./task-delete-button";
import TaskDeleteDialog from "./task-delete-dialog";
const mocks = vi.hoisted(() => ({
@@ -52,7 +51,9 @@ function renderTaskDelete({
const handle = AlertDialogCreateHandle();
const renderView = (taskId: string) => (
<ShortcutTestWrapper>
- <TaskDeleteButton handle={handle} />
+ <button type="button" onClick={() => handle.open(null)}>
+ tasks:delete.action
+ </button>
<TaskDeleteDialog
handle={handle}
taskId={taskId}
@@ -84,16 +85,13 @@ afterEach(() => {
vi.clearAllMocks();
});
-describe("TaskDeleteButton", () => {
- it("is only available to users with task deletion permission", async () => {
+describe("TaskDeleteDialog", () => {
+ it("keeps the shortcut off without task deletion permission", async () => {
mocks.canDeleteTasks.mockReturnValue(false);
renderTaskDelete();
fireEvent.keyDown(document, { key: "Backspace", ctrlKey: true });
- expect(
- screen.queryByRole("button", { name: "tasks:delete.action" }),
- ).toBeNull();
await waitFor(() =>
expect(screen.queryByText("tasks:delete.title")).toBeNull(),
);
diff --git a/apps/web/src/components/task/task-description.tsx b/apps/web/src/components/task/task-description.tsx
index a808aecd8..bda0dc8d5 100644
--- a/apps/web/src/components/task/task-description.tsx
+++ b/apps/web/src/components/task/task-description.tsx
@@ -1180,6 +1180,24 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {
};
}, [hoveredCodeBlock, updateHoveredCodeBlockFromElement]);
+ useEffect(() => {
+ if (!editor || !hoveredCodeBlock) return;
+ const syncAfterEdit = () => {
+ const element = hoveredCodeBlockElementRef.current;
+ if (element?.isConnected) {
+ updateHoveredCodeBlockFromElement(element);
+ return;
+ }
+ hoveredCodeBlockElementRef.current = null;
+ setHoveredCodeBlock(null);
+ setIsCodeLanguageMenuOpen(false);
+ };
+ editor.on("update", syncAfterEdit);
+ return () => {
+ editor.off("update", syncAfterEdit);
+ };
+ }, [editor, hoveredCodeBlock, updateHoveredCodeBlockFromElement]);
+
const handleEditorMouseMove = useCallback(
(event: ReactMouseEvent<HTMLElement>) => {
const target = event.target as HTMLElement;
@@ -1218,7 +1236,7 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {
data-task-action="description"
aria-label={t("tasks:detail.editor.ariaLabel")}
className={cn(
- "kaneo-tiptap-shell group",
+ "kaneo-tiptap-shell group relative",
isDragActive && "is-drag-active",
)}
onDragEnter={handleShellDragEnter}
@@ -1230,7 +1248,10 @@ export default function TaskDescription({ taskId }: TaskDescriptionProps) {
<div
role="status"
aria-live="polite"
- className="flex items-center gap-2 text-xs text-muted-foreground"
+ className={cn(
+ "absolute right-0 -top-6 flex h-6 items-center gap-2 text-muted-foreground text-xs",
+ saveState === "saved" && "sr-only",
+ )}
>
{saveState === "failed"
? t("tasks:detail.editor.saveFailed")
diff --git a/apps/web/src/components/task/task-details-content.tsx b/apps/web/src/components/task/task-details-content.tsx
index e31314769..7fd0919d5 100644
--- a/apps/web/src/components/task/task-details-content.tsx
+++ b/apps/web/src/components/task/task-details-content.tsx
@@ -1,17 +1,15 @@
import { useNavigate } from "@tanstack/react-router";
import { ArrowUpRight } from "lucide-react";
+import type { ReactNode } from "react";
import { useTranslation } from "react-i18next";
-import Activity from "@/components/activity";
-import CommentInput from "@/components/activity/comment-input";
-import { isCommentActivity } from "@/components/activity/utils";
import { ExternalLinksAccordion } from "@/components/external-links/external-links-accordion";
-import useAuth from "@/components/providers/auth-provider/hooks/use-auth";
-import { Timeline } from "@/components/ui/timeline";
-import useGetActivitiesByTaskId from "@/hooks/queries/activity/use-get-activities-by-task-id";
import useExternalLinks from "@/hooks/queries/external-link/use-external-links";
+import useGetProject from "@/hooks/queries/project/use-get-project";
import useGetTask from "@/hooks/queries/task/use-get-task";
import useGetTaskRelations from "@/hooks/queries/task-relation/use-get-task-relations";
+import { cn } from "@/lib/cn";
import type { ExternalLink } from "@/types/external-link";
+import { TaskActivity } from "./task-activity";
import TaskDescription from "./task-description";
import TaskRelations from "./task-relations";
import TaskSubtasks from "./task-subtasks";
@@ -22,6 +20,8 @@ type TaskDetailsContentProps = {
projectId: string;
workspaceId: string;
className?: string;
+ variant?: "sheet" | "page";
+ properties?: ReactNode;
};
export default function TaskDetailsContent({
@@ -29,61 +29,57 @@ export default function TaskDetailsContent({
projectId,
workspaceId,
className,
+ variant = "sheet",
+ properties,
}: TaskDetailsContentProps) {
const { t } = useTranslation();
const navigate = useNavigate();
const { data: task } = useGetTask(taskId ?? "");
- const { data: activities = [] } = useGetActivitiesByTaskId(taskId ?? "");
+ const { data: project } = useGetProject({ id: projectId, workspaceId });
const { data: externalLinks = [], isLoading: isLoadingExternalLinks } =
useExternalLinks(taskId ?? "");
const { data: relations = [] } = useGetTaskRelations(taskId ?? "");
- const { user } = useAuth();
- const parentRelation = relations.find(
+ const parentTask = relations.find(
(rel) => rel.relationType === "subtask" && rel.targetTaskId === taskId,
- );
- const parentTask = parentRelation?.sourceTask;
+ )?.sourceTask;
if (!taskId) return null;
return (
- <div className={`${className} gap-4`}>
- <div className="flex flex-col gap-2.5">
+ <div className={cn("flex flex-col", className)}>
+ <div className="flex flex-col gap-2.5 pb-4">
{parentTask && (
<button
type="button"
- className="flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors w-fit"
+ className="flex w-fit min-w-0 items-center gap-1.5 rounded-sm text-muted-foreground text-xs outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
onClick={() =>
navigate({
to: "/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId",
- params: {
- workspaceId,
- projectId,
- taskId: parentTask.id,
- },
+ params: { workspaceId, projectId, taskId: parentTask.id },
})
}
>
- <ArrowUpRight className="size-3" />
- <span>
- {t("tasks:detail.subtaskOf")}{" "}
- <span className="font-medium">{parentTask.title}</span>
+ <ArrowUpRight className="size-3 shrink-0" />
+ <span className="shrink-0">{t("tasks:detail.subtaskOf")}</span>
+ {project?.slug && parentTask.number != null && (
+ <span className="shrink-0 font-mono">
+ {project.slug}-{parentTask.number}
+ </span>
+ )}
+ <span className="truncate font-medium text-foreground/80">
+ {parentTask.title}
</span>
</button>
)}
-
- <TaskTitle taskId={taskId} />
- <TaskDescription taskId={taskId} />
+ <TaskTitle taskId={taskId} size={variant === "page" ? "lg" : "md"} />
</div>
- <div className="mt-4">
- <ExternalLinksAccordion
- taskId={taskId}
- externalLinks={externalLinks as ExternalLink[]}
- isLoading={isLoadingExternalLinks}
- />
- </div>
- <div className="mt-4">
+ {properties}
+
+ <TaskDescription taskId={taskId} />
+
+ <div className="mt-6 flex flex-col gap-6">
{task && (
<TaskSubtasks
taskId={taskId}
@@ -92,48 +88,23 @@ export default function TaskDetailsContent({
parentStatus={task.status}
/>
)}
- </div>
-
- <div className="mt-2">
<TaskRelations
taskId={taskId}
projectId={projectId}
workspaceId={workspaceId}
/>
+ <ExternalLinksAccordion
+ taskId={taskId}
+ externalLinks={externalLinks as ExternalLink[]}
+ isLoading={isLoadingExternalLinks}
+ />
</div>
- <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">{t("tasks:detail.activity")}</h1>
- {user?.id && taskId && (
- <CommentInput taskId={taskId} projectId={projectId} />
- )}
-
- {activities.length > 0 ? (
- <Timeline>
- {activities.map((activity, index) => {
- const nextActivity = activities[index + 1];
- const showConnector =
- !isCommentActivity(activity) &&
- Boolean(nextActivity) &&
- !isCommentActivity(nextActivity);
-
- return (
- <Activity
- key={activity.id}
- activity={activity}
- step={activities.length - index}
- showConnector={showConnector}
- />
- );
- })}
- </Timeline>
- ) : (
- <p className="text-sm font-medium text-muted-foreground">
- {t("tasks:detail.noActivity")}
- </p>
- )}
- </div>
+ <TaskActivity
+ taskId={taskId}
+ projectId={projectId}
+ className="mt-8 border-border border-t pt-6"
+ />
</div>
);
}
diff --git a/apps/web/src/components/task/task-details-sheet.tsx b/apps/web/src/components/task/task-details-sheet.tsx
index bd99ffaee..873928277 100644
--- a/apps/web/src/components/task/task-details-sheet.tsx
+++ b/apps/web/src/components/task/task-details-sheet.tsx
@@ -1,22 +1,13 @@
import { useNavigate } from "@tanstack/react-router";
-import { Maximize2, X } from "lucide-react";
import { useCallback, useEffect, useRef, useState } from "react";
-import { useTranslation } from "react-i18next";
import { AlertDialogCreateHandle } from "@/components/ui/alert-dialog";
-import { Button } from "@/components/ui/button";
import { Sheet, SheetContent } from "@/components/ui/sheet";
-import {
- Tooltip,
- TooltipContent,
- TooltipProvider,
- TooltipTrigger,
-} from "@/components/ui/tooltip";
-import useGetProject from "@/hooks/queries/project/use-get-project";
-import useGetTask from "@/hooks/queries/task/use-get-task";
+import { TaskSheetHeader } from "./header/task-sheet-header";
+import { PropertiesRail } from "./properties/properties-rail";
+import { PropertyChips } from "./properties/property-chips";
import TaskDeleteDialog from "./task-delete-dialog";
-import { TaskShortcuts } from "./task-shortcuts";
import TaskDetailsContent from "./task-details-content";
-import TaskPropertiesSidebar from "./task-properties-sidebar";
+import { TaskShortcuts } from "./task-shortcuts";
type TaskDetailsSheetProps = {
taskId: string | undefined;
@@ -31,16 +22,12 @@ export default function TaskDetailsSheet({
workspaceId,
onClose,
}: TaskDetailsSheetProps) {
- const { t } = useTranslation();
const navigate = useNavigate();
const [currentTaskId, setCurrentTaskId] = useState<string | undefined>(
taskId,
);
const [deleteHandle] = useState(() => AlertDialogCreateHandle());
- const { data: task } = useGetTask(currentTaskId ?? "");
- const { data: project } = useGetProject({ id: projectId, workspaceId });
-
const lastTaskIdRef = useRef(taskId);
useEffect(() => {
@@ -77,7 +64,7 @@ export default function TaskDetailsSheet({
side="right"
data-task-view
data-shortcuts="allow"
- className="w-full max-w-full sm:max-w-lg md:max-w-2xl lg:max-w-4xl p-0 gap-0 [&>button]:hidden"
+ className="w-full max-w-full gap-0 p-0 sm:max-w-lg md:max-w-2xl lg:max-w-4xl [&>button]:hidden"
// Focusing the first control would pop the "open in full page"
// tooltip over the actions every time the sheet opens on touch.
initialFocus={closeButtonRef}
@@ -87,43 +74,17 @@ export default function TaskDetailsSheet({
) ?? true
}
>
- <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}
- </span>
- </div>
- <div className="flex items-center gap-1">
- <TooltipProvider>
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="sm"
- onClick={handleOpenFullPage}
- aria-label={t("tasks:detail.openInFullPage")}
- className="text-foreground"
- >
- <Maximize2 className="size-4" />
- </Button>
- </TooltipTrigger>
- <TooltipContent>
- {t("tasks:detail.openInFullPage")}
- </TooltipContent>
- </Tooltip>
- </TooltipProvider>
- <Button
- ref={closeButtonRef}
- variant="ghost"
- size="sm"
- onClick={onClose}
- aria-label={t("common:actions.close")}
- className="text-foreground"
- >
- <X className="size-4" />
- </Button>
- </div>
- </div>
+ {currentTaskId && (
+ <TaskSheetHeader
+ taskId={currentTaskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ deleteHandle={deleteHandle}
+ onOpenFullPage={handleOpenFullPage}
+ onClose={onClose}
+ closeButtonRef={closeButtonRef}
+ />
+ )}
{currentTaskId && (
<TaskShortcuts
@@ -141,33 +102,35 @@ export default function TaskDetailsSheet({
shortcutEnabled={Boolean(taskId)}
/>
)}
- <div
- // Phones scroll properties and content together so the property
- // block doesn't pin a quarter of the screen.
- className="flex flex-col flex-1 min-h-0 overflow-y-auto sm: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 shrink-0 sm:overflow-y-auto"
- compact={true}
- deleteHandle={deleteHandle}
- shortcutsEnabled={Boolean(taskId)}
- />
-
- <div className="sm:flex-1 sm:overflow-y-auto sm:min-h-0">
- <div className="px-4 py-4">
+ {currentTaskId && (
+ <div
+ key={currentTaskId}
+ className="flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden"
+ >
+ <div className="min-w-0 flex-1 lg:overflow-y-auto">
<TaskDetailsContent
taskId={currentTaskId}
projectId={projectId}
workspaceId={workspaceId}
- className="flex flex-col gap-3"
+ className="px-5 pt-5 pb-10 lg:px-9 lg:pt-7"
+ properties={
+ <PropertyChips
+ taskId={currentTaskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ className="pb-5 lg:hidden"
+ />
+ }
/>
</div>
+ <PropertiesRail
+ taskId={currentTaskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ className="hidden w-73 shrink-0 overflow-y-auto border-border border-l lg:flex"
+ />
</div>
- </div>
+ )}
</SheetContent>
</Sheet>
);
diff --git a/apps/web/src/components/task/task-labels-popover.tsx b/apps/web/src/components/task/task-labels-popover.tsx
index 216a40f58..0275112db 100644
--- a/apps/web/src/components/task/task-labels-popover.tsx
+++ b/apps/web/src/components/task/task-labels-popover.tsx
@@ -1,8 +1,8 @@
import { useQueryClient } from "@tanstack/react-query";
-import { Check, Plus, Search, X, TagIcon } from "lucide-react";
-import { useEffect, useMemo, useRef, useState } from "react";
+import { Plus, TagIcon } from "lucide-react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Input } from "@/components/ui/input";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
@@ -14,7 +14,6 @@ import useDetachLabelFromTask from "@/hooks/mutations/label/use-detach-label-fro
import useGetLabelsByTask from "@/hooks/queries/label/use-get-labels-by-task";
import useGetLabelsByWorkspace from "@/hooks/queries/label/use-get-labels-by-workspace";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-import { cn } from "@/lib/cn";
import { getTaskLabelOptions } from "@/lib/get-task-label-options";
import { resolveLabelColor } from "@/lib/label-color";
import { toast } from "@/lib/toast";
@@ -32,122 +31,74 @@ const labelColors = [
{ value: "red", key: "crimson", color: "var(--color-red-600)" },
];
-type LabelColor =
- | "gray"
- | "dark-gray"
- | "purple"
- | "teal"
- | "green"
- | "yellow"
- | "orange"
- | "pink"
- | "red";
+const CREATE_LABEL = ":create";
type TaskLabelsPopoverProps = {
task: Task;
workspaceId: string;
children: React.ReactNode;
- triggerNativeButton?: boolean;
};
-type PopoverStep = "select" | "color";
+function ColorDot({ color }: { color: string }) {
+ return (
+ <span
+ className="size-2 shrink-0 rounded-full"
+ style={{ backgroundColor: color }}
+ />
+ );
+}
export default function TaskLabelsPopover({
task,
workspaceId,
children,
- triggerNativeButton = true,
}: TaskLabelsPopoverProps) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
- const [step, setStep] = useState<PopoverStep>("select");
- const [searchValue, setSearchValue] = useState("");
- const [selectedColor, setSelectedColor] = useState<LabelColor>("gray");
- const [newLabelName, setNewLabelName] = useState("");
-
- const searchInputRef = useRef<HTMLInputElement>(null);
+ const [query, setQuery] = useState("");
+ const [newLabelName, setNewLabelName] = useState<string | null>(null);
const queryClient = useQueryClient();
const { mutateAsync: attachLabel } = useAttachLabelToTask();
const { mutateAsync: createLabel } = useCreateLabel();
const { mutateAsync: detachLabel } = useDetachLabelFromTask();
const { canCreateLabels, canUpdateLabels } = useWorkspacePermission();
- const canCreate = canCreateLabels();
- const canEdit = canUpdateLabels();
const { data: taskLabels = [] } = useGetLabelsByTask(task.id);
const { data: workspaceLabels = [] } = useGetLabelsByWorkspace(workspaceId);
- const taskLabelNames = useMemo(
- () => taskLabels.map((label) => label.name),
- [taskLabels],
- );
-
- const workspaceLevelLabels = useMemo(
- () => workspaceLabels.filter((label) => label.taskId === null),
- [workspaceLabels],
- );
-
- const filteredLabels = useMemo(() => {
- const selectableLabels = getTaskLabelOptions(workspaceLabels, task.id);
- return selectableLabels.filter((label) =>
- label.name.toLowerCase().includes(searchValue.toLowerCase()),
+ if (!canUpdateLabels()) return <>{children}</>;
+
+ const name = query.trim();
+ const assignedNames = new Set(taskLabels.map((label) => label.name));
+ const canCreateLabel =
+ canCreateLabels() &&
+ Boolean(name) &&
+ !workspaceLabels.some(
+ (label) =>
+ label.taskId === null &&
+ label.name.toLowerCase() === name.toLowerCase(),
);
- }, [workspaceLabels, searchValue, task.id]);
- const isCreatingNewLabel = useMemo(
- () =>
- searchValue &&
- !workspaceLevelLabels.some(
- (label) => label.name.toLowerCase() === searchValue.toLowerCase(),
- ),
- [workspaceLevelLabels, searchValue],
- );
-
- useEffect(() => {
- if (open && step === "select" && searchInputRef.current) {
- setTimeout(() => searchInputRef.current?.focus(), 100);
- }
- }, [open, step]);
+ const refreshTasks = () =>
+ queryClient.invalidateQueries({ queryKey: ["tasks", task.projectId] });
- const resetPopover = () => {
- setStep("select");
- setSearchValue("");
- setNewLabelName("");
- setSelectedColor("gray");
- };
-
- const handleClose = () => {
- setOpen(false);
- setTimeout(resetPopover, 200);
- };
-
- const handleToggleLabel = async (labelId: string) => {
+ const toggleLabel = async (labelId: string) => {
+ const workspaceLabel = workspaceLabels.find(
+ (label) => label.id === labelId,
+ );
+ if (!workspaceLabel) return;
try {
- const workspaceLabel = workspaceLabels.find((l) => l.id === labelId);
- if (!workspaceLabel) return;
-
- const isCurrentlyAssigned = taskLabelNames.includes(workspaceLabel.name);
-
- if (isCurrentlyAssigned) {
- // Remove label from task - find by name since IDs are different
+ if (assignedNames.has(workspaceLabel.name)) {
const taskLabel = taskLabels.find(
- (l) => l.name === workspaceLabel.name,
+ (label) => label.name === workspaceLabel.name,
);
- if (taskLabel?.id) {
- await detachLabel({ labelId: taskLabel.id });
- }
+ if (taskLabel?.id) await detachLabel({ labelId: taskLabel.id });
} else {
if (workspaceLabel.taskId !== null) return;
- await attachLabel({
- labelId: workspaceLabel.id,
- taskId: task.id,
- });
+ await attachLabel({ labelId: workspaceLabel.id, taskId: task.id });
}
-
- await queryClient.invalidateQueries({
- queryKey: ["tasks", task.projectId],
- });
+ await refreshTasks();
} catch (error) {
toast.error(
error instanceof Error
@@ -157,36 +108,18 @@ export default function TaskLabelsPopover({
}
};
- const handleCreateNewClick = () => {
- setNewLabelName(searchValue);
- setStep("color");
- };
-
- const handleColorSelect = async (color: LabelColor) => {
- setSelectedColor(color);
-
- // Create the label immediately
- if (!newLabelName.trim()) return;
-
+ const createWithColor = async (color: string) => {
+ if (!newLabelName) return;
+ setOpen(false);
try {
- // First create the label in the workspace
- const createdLabel = await createLabel({
- name: newLabelName.trim(),
- color: color,
+ const created = await createLabel({
+ name: newLabelName,
+ color,
workspaceId,
});
-
- await attachLabel({
- labelId: createdLabel.id,
- taskId: task.id,
- });
-
- await queryClient.invalidateQueries({
- queryKey: ["tasks", task.projectId],
- });
-
+ await attachLabel({ labelId: created.id, taskId: task.id });
+ await refreshTasks();
toast.success(t("tasks:popover.labels.createSuccess"), { icon: TagIcon });
- handleClose();
} catch (error) {
toast.error(
error instanceof Error
@@ -196,130 +129,61 @@ export default function TaskLabelsPopover({
}
};
- const renderSelectStep = () => (
- <div className="w-auto">
- <div className="flex items-center gap-2 p-2 border-b border-border">
- <Search className="w-3 h-3 text-muted-foreground" />
- <Input
- ref={searchInputRef}
- value={searchValue}
- onChange={(e) => setSearchValue(e.target.value)}
- placeholder={t("tasks:popover.labels.searchPlaceholder")}
- className="border-none p-0 h-auto focus-visible:ring-0 shadow-none !bg-transparent"
- />
- </div>
-
- <div className="py-1">
- {filteredLabels.length === 0 && searchValue.length === 0 && (
- <span className="text-xs text-muted-foreground px-2">
- {t("tasks:popover.labels.empty")}
- </span>
- )}
- {filteredLabels.map((label) => (
- <button
- key={label.id}
- type="button"
- className="w-full flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-accent/50 text-left"
- onClick={() => handleToggleLabel(label.id)}
- >
- <div className="flex-shrink-0 w-3 flex justify-center">
- {taskLabelNames.includes(label.name) && (
- <Check className="w-3 h-3" />
- )}
- </div>
- <span
- className="w-2 h-2 rounded-full flex-shrink-0"
- style={{
- backgroundColor: resolveLabelColor(label.color),
- }}
- />
- <span className="max-w-20 truncate">{label.name}</span>
- </button>
- ))}
-
- {canCreate && isCreatingNewLabel && filteredLabels.length > 0 && (
- <div className="border-t border-border my-1" />
- )}
- {canCreate && isCreatingNewLabel && (
- <button
- type="button"
- className="w-full flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-accent/50 text-left"
- onClick={handleCreateNewClick}
- >
- <div className="flex-shrink-0 w-3 flex justify-center">
- <Plus className="w-3 h-3" />
- </div>
- <span
- className="w-2 h-2 rounded-full flex-shrink-0"
- style={{
- backgroundColor:
- labelColors.find((c) => c.value === selectedColor)?.color ||
- "var(--color-neutral-400)",
- }}
- />
- <span className="truncate">
- {t("tasks:popover.labels.create", { name: searchValue })}
- </span>
- </button>
- )}
- </div>
- </div>
- );
-
- const renderColorStep = () => (
- <div className="w-auto">
- <div className="flex items-center justify-between p-2 border-b border-border">
- <span className="text-xs font-medium">
- {t("tasks:popover.labels.chooseColor")}
- </span>
- <button
- type="button"
- onClick={() => setStep("select")}
- className="w-4 h-4 flex items-center justify-center hover:bg-accent/50 rounded"
- >
- <X className="h-3 w-3" />
- </button>
- </div>
-
- <div className="py-1">
- {labelColors.map((color) => (
- <button
- key={color.value}
- type="button"
- className={cn(
- "w-full flex items-center gap-2 px-2 py-1.5 text-xs hover:bg-accent/50 text-left",
- selectedColor === color.value && "bg-accent/30",
- )}
- onClick={() => handleColorSelect(color.value as LabelColor)}
- >
- <span
- className="w-2 h-2 rounded-full flex-shrink-0"
- style={{ backgroundColor: color.color }}
- />
- <span className="truncate">
- {t(`tasks:popover.labels.colors.${color.key}`)}
- </span>
- {selectedColor === color.value && (
- <Check className="w-3 h-3 ml-auto" />
- )}
- </button>
- ))}
- </div>
- </div>
- );
-
- // Without label-update permission the trigger renders as a plain element,
- // so users can still see the existing labels without opening edit controls.
- if (!canEdit) return <>{children}</>;
+ const labelOptions = [
+ ...getTaskLabelOptions(workspaceLabels, task.id).map((label) => ({
+ value: label.id,
+ label: label.name,
+ icon: <ColorDot color={resolveLabelColor(label.color)} />,
+ selected: assignedNames.has(label.name),
+ })),
+ ...(canCreateLabel
+ ? [
+ {
+ value: CREATE_LABEL,
+ label: t("tasks:popover.labels.create", { name }),
+ icon: <Plus />,
+ },
+ ]
+ : []),
+ ];
return (
- <Popover open={open} onOpenChange={setOpen}>
- <PopoverTrigger asChild nativeButton={triggerNativeButton}>
- {children}
- </PopoverTrigger>
- <PopoverContent className="p-0" align="start">
- {step === "select" && renderSelectStep()}
- {step === "color" && renderColorStep()}
+ <Popover
+ open={open}
+ onOpenChange={(next) => {
+ setOpen(next);
+ if (next) return;
+ setQuery("");
+ setNewLabelName(null);
+ }}
+ >
+ <PopoverTrigger asChild>{children}</PopoverTrigger>
+ <PopoverContent className="w-60 p-0" align="start">
+ {newLabelName === null ? (
+ <OptionMenu
+ key="labels"
+ label={t("tasks:properties.labels")}
+ placeholder={t("tasks:popover.labels.searchPlaceholder")}
+ options={labelOptions}
+ onQueryChange={setQuery}
+ onSelect={(value) => {
+ if (value === CREATE_LABEL) setNewLabelName(name);
+ else void toggleLabel(value);
+ }}
+ />
+ ) : (
+ <OptionMenu
+ key="colors"
+ label={t("tasks:popover.labels.chooseColor")}
+ placeholder={t("tasks:popover.labels.chooseColor")}
+ options={labelColors.map((color) => ({
+ value: color.value,
+ label: t(`tasks:popover.labels.colors.${color.key}`),
+ icon: <ColorDot color={color.color} />,
+ }))}
+ onSelect={createWithColor}
+ />
+ )}
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-move-popover.test.tsx b/apps/web/src/components/task/task-move-popover.test.tsx
new file mode 100644
index 000000000..e552e66b9
--- /dev/null
+++ b/apps/web/src/components/task/task-move-popover.test.tsx
@@ -0,0 +1,112 @@
+import {
+ act,
+ cleanup,
+ fireEvent,
+ render,
+ screen,
+} from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vite-plus/test";
+import type Task from "@/types/task";
+import TaskMovePopover from "./task-move-popover";
+
+const mocks = vi.hoisted(() => ({
+ navigate: vi.fn(),
+ moveTask: vi.fn(),
+ fetchQuery: vi.fn(),
+ columns: [] as { slug: string; name: string; isFinal: boolean }[],
+}));
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+vi.mock("@tanstack/react-router", () => ({
+ useNavigate: () => mocks.navigate,
+}));
+vi.mock("@/hooks/queries/project/use-get-projects", () => ({
+ default: () => ({
+ data: [
+ { id: "project-1", name: "Website", icon: null },
+ { id: "project-2", name: "Mobile app", icon: null },
+ ],
+ }),
+}));
+vi.mock("@/hooks/queries/column/use-get-columns", () => ({
+ useGetColumns: () => ({
+ data: mocks.columns,
+ isLoading: false,
+ isError: false,
+ }),
+}));
+vi.mock("@/hooks/mutations/task/use-move-task", () => ({
+ useMoveTask: () => ({ mutateAsync: mocks.moveTask }),
+}));
+vi.mock("@/query-client", () => ({
+ default: { fetchQuery: mocks.fetchQuery },
+}));
+vi.mock("@/fetchers/column/get-columns", () => ({ default: vi.fn() }));
+vi.mock("@/lib/i18n/domain", () => ({
+ getStatusDisplayLabel: (_slug: string, name: string) => name,
+}));
+
+afterEach(() => {
+ cleanup();
+ vi.clearAllMocks();
+});
+
+const task = {
+ id: "task-1",
+ title: "Fix login",
+ number: 1,
+ status: "in-review",
+ projectId: "project-1",
+} as Task;
+
+async function pickMobileApp() {
+ render(
+ <TaskMovePopover task={task} workspaceId="workspace-1">
+ <button type="button">Move</button>
+ </TaskMovePopover>,
+ );
+ fireEvent.click(screen.getByRole("button", { name: "Move" }));
+ await act(async () => {
+ fireEvent.click(await screen.findByRole("option", { name: /Mobile app/ }));
+ });
+}
+
+describe("TaskMovePopover", () => {
+ it("moves right away when the destination has the same status", async () => {
+ mocks.fetchQuery.mockResolvedValue([
+ { slug: "in-review", name: "In Review", isFinal: false },
+ ]);
+ mocks.moveTask.mockResolvedValue({ task: { projectId: "project-2" } });
+
+ await pickMobileApp();
+
+ expect(mocks.moveTask).toHaveBeenCalledWith({
+ taskId: "task-1",
+ destinationProjectId: "project-2",
+ destinationStatus: "in-review",
+ });
+ });
+
+ it("asks for a status when the destination workflow lacks it", async () => {
+ mocks.fetchQuery.mockResolvedValue([
+ { slug: "to-do", name: "To Do", isFinal: false },
+ ]);
+ mocks.columns = [{ slug: "to-do", name: "To Do", isFinal: false }];
+ mocks.moveTask.mockResolvedValue({ task: { projectId: "project-2" } });
+
+ await pickMobileApp();
+ expect(mocks.moveTask).not.toHaveBeenCalled();
+
+ await act(async () => {
+ fireEvent.click(await screen.findByRole("option", { name: /To Do/ }));
+ });
+
+ expect(mocks.moveTask).toHaveBeenCalledWith({
+ taskId: "task-1",
+ destinationProjectId: "project-2",
+ destinationStatus: "to-do",
+ });
+ });
+});
diff --git a/apps/web/src/components/task/task-move-popover.tsx b/apps/web/src/components/task/task-move-popover.tsx
index 5fbf5bdec..9c328ecb2 100644
--- a/apps/web/src/components/task/task-move-popover.tsx
+++ b/apps/web/src/components/task/task-move-popover.tsx
@@ -1,239 +1,130 @@
import { useNavigate } from "@tanstack/react-router";
-import { ArrowRightLeft } from "lucide-react";
-import { useEffect, useMemo, useState, useTransition } from "react";
+import { type ReactNode, useState, useTransition } from "react";
import { useTranslation } from "react-i18next";
-import { Button } from "@/components/ui/button";
-import { Label } from "@/components/ui/label";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
+import icons from "@/constants/project-icons";
+import getColumns from "@/fetchers/column/get-columns";
import { useMoveTask } from "@/hooks/mutations/task/use-move-task";
+import { useGetColumns } from "@/hooks/queries/column/use-get-columns";
import useGetProjects from "@/hooks/queries/project/use-get-projects";
-import { useGetTasks } from "@/hooks/queries/task/use-get-tasks";
-import { getStatusLabel } from "@/lib/i18n/domain";
+import queryClient from "@/query-client";
import type Task from "@/types/task";
+import { statusMenuOptions } from "./menus/status-menu-options";
type TaskMovePopoverProps = {
task: Task;
workspaceId: string;
+ children: ReactNode;
};
export default function TaskMovePopover({
task,
workspaceId,
+ children,
}: TaskMovePopoverProps) {
const { t } = useTranslation();
const navigate = useNavigate();
const [open, setOpen] = useState(false);
- const [isPending, startTransition] = useTransition();
- const [selectedProjectId, setSelectedProjectId] = useState("");
- const [selectedStatus, setSelectedStatus] = useState("");
+ const [projectId, setProjectId] = useState<string | null>(null);
+ const [, startTransition] = useTransition();
const { data: projects = [] } = useGetProjects({ workspaceId });
- const { mutateAsync: moveTask, isPending: isMovePending } = useMoveTask();
- const destinationProjectId = selectedProjectId || "";
const {
- data: destinationProject,
- isLoading: isProjectLoading,
- isError: isProjectError,
- } = useGetTasks(destinationProjectId);
-
- const destinationProjects = useMemo(
- () => projects.filter((project) => project.id !== task.projectId),
- [projects, task.projectId],
- );
-
- const selectedProject = useMemo(
- () => destinationProjects.find((p) => p.id === selectedProjectId),
- [destinationProjects, selectedProjectId],
- );
-
- const destinationColumns = useMemo(
- () => destinationProject?.columns ?? [],
- [destinationProject?.columns],
- );
- const canKeepCurrentStatus = destinationColumns.some(
- (column) => column.id === task.status,
+ data: columns = [],
+ isLoading,
+ isError,
+ } = useGetColumns(projectId ?? "");
+ const { mutateAsync: moveTask } = useMoveTask();
+
+ const destinations = projects.filter(
+ (project) => project.id !== task.projectId,
);
- const fallbackStatus = destinationColumns[0]?.id ?? "";
- const effectiveStatus = canKeepCurrentStatus
- ? task.status
- : selectedStatus || fallbackStatus;
- const selectedStatusLabel = useMemo(() => {
- if (!effectiveStatus || destinationColumns.length === 0) return null;
- const column = destinationColumns.find((c) => c.id === effectiveStatus);
- return column?.name || getStatusLabel(effectiveStatus) || null;
- }, [destinationColumns, effectiveStatus]);
-
- useEffect(() => {
- if (!open) {
- setSelectedProjectId("");
- setSelectedStatus("");
- }
- }, [open]);
-
- useEffect(() => {
- if (!selectedProjectId) {
- setSelectedStatus("");
- return;
- }
-
- if (canKeepCurrentStatus) {
- setSelectedStatus(task.status);
- return;
- }
-
- setSelectedStatus(fallbackStatus);
- }, [canKeepCurrentStatus, fallbackStatus, selectedProjectId, task.status]);
-
- const handleMove = async () => {
- if (!selectedProjectId || !effectiveStatus) return;
-
- try {
- const result = await moveTask({
- taskId: task.id,
- destinationProjectId: selectedProjectId,
- destinationStatus: effectiveStatus,
+ if (destinations.length === 0) return <>{children}</>;
+
+ const moveTo = async (destinationProjectId: string, status: string) => {
+ setOpen(false);
+ const result = await moveTask({
+ taskId: task.id,
+ destinationProjectId,
+ destinationStatus: status,
+ }).catch(() => null);
+ if (!result) return;
+ startTransition(() => {
+ navigate({
+ to: "/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId",
+ params: {
+ workspaceId,
+ projectId: result.task.projectId,
+ taskId: task.id,
+ },
});
+ });
+ };
- setOpen(false);
- startTransition(() => {
- navigate({
- to: "/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId",
- params: {
- workspaceId,
- projectId: result.task.projectId,
- taskId: task.id,
- },
- });
- });
- } catch {
- // toast is handled by useMoveTask's onError
+ const pickProject = async (id: string) => {
+ const destinationColumns = await queryClient
+ .fetchQuery({
+ queryKey: ["columns", id],
+ queryFn: () => getColumns(id),
+ staleTime: 0,
+ })
+ .catch(() => null);
+ if (destinationColumns?.some((column) => column.slug === task.status)) {
+ void moveTo(id, task.status);
+ return;
}
+ setProjectId(id);
};
- if (destinationProjects.length === 0) {
- return null;
- }
-
return (
- <Popover open={open} onOpenChange={setOpen}>
- <PopoverTrigger asChild>
- <Button
- type="button"
- data-task-action="move"
- variant="outline"
- size="sm"
- className="text-foreground"
- title={t("tasks:move.title")}
- aria-label={t("tasks:move.title")}
- >
- <ArrowRightLeft className="size-4" />
- </Button>
- </PopoverTrigger>
- <PopoverContent className="w-80 p-3" align="end" sideOffset={4}>
- <div className="flex flex-col gap-3">
- <p className="text-sm font-medium text-foreground">
- {t("tasks:move.title")}
- </p>
-
- <div className="flex flex-col gap-1.5">
- <Label className="text-xs text-muted-foreground">
- {t("tasks:move.projectLabel")}
- </Label>
- <Select
- value={selectedProjectId}
- onValueChange={(value) =>
- setSelectedProjectId(String(value ?? ""))
- }
- >
- <SelectTrigger className="w-full">
- <SelectValue placeholder={t("tasks:move.projectPlaceholder")}>
- {selectedProject?.name}
- </SelectValue>
- </SelectTrigger>
- <SelectContent>
- {destinationProjects.map((project) => (
- <SelectItem key={project.id} value={project.id}>
- {project.name}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </div>
-
- {selectedProjectId && isProjectLoading && (
- <div className="flex items-center justify-center py-2">
- <span className="text-xs text-muted-foreground">
- {t("tasks:move.statusLabel")}…
- </span>
- </div>
- )}
-
- {selectedProjectId && isProjectError && (
- <p className="text-xs text-destructive">{t("tasks:move.error")}</p>
- )}
-
- {selectedProjectId &&
- !isProjectLoading &&
- !isProjectError &&
- destinationColumns.length > 0 && (
- <div className="flex flex-col gap-1.5">
- <Label className="text-xs text-muted-foreground">
- {t("tasks:move.statusLabel")}
- </Label>
- <Select
- value={effectiveStatus || undefined}
- onValueChange={(value) =>
- setSelectedStatus(String(value ?? ""))
- }
- disabled={canKeepCurrentStatus}
- >
- <SelectTrigger className="w-full">
- <SelectValue>{selectedStatusLabel}</SelectValue>
- </SelectTrigger>
- <SelectContent>
- {destinationColumns.map((column) => (
- <SelectItem key={column.id} value={column.id}>
- {column.name || getStatusLabel(column.id)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- <p className="text-xs text-muted-foreground">
- {canKeepCurrentStatus
- ? t("tasks:move.statusHintKeep")
- : t("tasks:move.statusHintAdjust")}
- </p>
- </div>
- )}
-
- <Button
- variant="outline"
- size="sm"
- onClick={() => void handleMove()}
- disabled={
- !selectedProjectId ||
- !effectiveStatus ||
- isMovePending ||
- isPending ||
- isProjectLoading ||
- isProjectError
+ <Popover
+ open={open}
+ onOpenChange={(next) => {
+ setOpen(next);
+ if (!next) setProjectId(null);
+ }}
+ >
+ <PopoverTrigger asChild>{children}</PopoverTrigger>
+ <PopoverContent className="w-60 p-0" align="start">
+ {projectId === null ? (
+ <OptionMenu
+ key="projects"
+ label={t("tasks:move.title")}
+ placeholder={t("tasks:move.projectPlaceholder")}
+ options={destinations.map((project) => {
+ const ProjectIcon =
+ icons[project.icon as keyof typeof icons] || icons.Layout;
+ return {
+ value: project.id,
+ label: project.name,
+ icon: <ProjectIcon className="text-muted-foreground" />,
+ };
+ })}
+ onSelect={(id) => void pickProject(id)}
+ />
+ ) : (
+ <OptionMenu
+ key="statuses"
+ label={t("tasks:move.statusLabel")}
+ placeholder={t("tasks:move.statusLabel")}
+ options={statusMenuOptions(columns, null)}
+ onSelect={(status) => void moveTo(projectId, status)}
+ status={
+ isLoading ? (
+ t("common:empty.loading")
+ ) : isError ? (
+ <span className="text-destructive-foreground">
+ {t("tasks:move.error")}
+ </span>
+ ) : undefined
}
- className="w-full font-medium"
- >
- {t("tasks:move.action")}
- </Button>
- </div>
+ />
+ )}
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-page-skeleton.tsx b/apps/web/src/components/task/task-page-skeleton.tsx
index ac84dcd6c..fe779885d 100644
--- a/apps/web/src/components/task/task-page-skeleton.tsx
+++ b/apps/web/src/components/task/task-page-skeleton.tsx
@@ -50,36 +50,15 @@ export function TaskDetailsSkeleton({ className }: TaskDetailsSkeletonProps) {
);
}
-type TaskPropertiesSidebarSkeletonProps = {
- className?: string;
-};
-
-export function TaskPropertiesSidebarSkeleton({
- className,
-}: TaskPropertiesSidebarSkeletonProps) {
+export function TaskPropertiesRailSkeleton() {
return (
- <div
- className={cn(
- "h-full w-full lg:w-72 xl:w-80 flex flex-col gap-2 p-3",
- className,
- )}
- >
- <div className="rounded-xl border border-border/80 bg-card/70 p-3">
- <div className="space-y-3">
- <Skeleton className="h-4 w-24" />
- <Skeleton className="h-8 w-full rounded-md" />
- <Skeleton className="h-8 w-full rounded-md" />
- <Skeleton className="h-8 w-full rounded-md" />
- <Skeleton className="h-24 w-full rounded-md" />
+ <div className="flex w-80 shrink-0 flex-col gap-0.5 px-3 pt-4">
+ {[0, 1, 2, 3, 4, 5].map((row) => (
+ <div key={row} className="flex h-8 items-center gap-3 pl-2">
+ <Skeleton className="h-3 w-14" />
+ <Skeleton className="h-4 w-28" />
</div>
- </div>
- <div className="rounded-xl border border-border/80 bg-card/70 p-3">
- <div className="space-y-2">
- <Skeleton className="h-4 w-20" />
- <Skeleton className="h-6 w-full rounded-md" />
- <Skeleton className="h-6 w-3/4 rounded-md" />
- </div>
- </div>
+ ))}
</div>
);
}
diff --git a/apps/web/src/components/task/task-priority-popover.tsx b/apps/web/src/components/task/task-priority-popover.tsx
index 032410cd8..fbd6eb63a 100644
--- a/apps/web/src/components/task/task-priority-popover.tsx
+++ b/apps/web/src/components/task/task-priority-popover.tsx
@@ -1,15 +1,12 @@
-import { Check } from "lucide-react";
-import { useCallback, useMemo, useState } from "react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Button } from "@/components/ui/button";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ShortcutNumber } from "@/components/ui/shortcut-number";
import { useUpdateTaskPriority } from "@/hooks/mutations/task/use-update-task-status-priority";
-import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { getPriorityLabel } from "@/lib/i18n/domain";
import { getPriorityIcon } from "@/lib/priority";
@@ -21,13 +18,7 @@ type TaskPriorityPopoverProps = {
children: React.ReactNode;
};
-const priorityOptions = [
- { value: "no-priority" },
- { value: "low" },
- { value: "medium" },
- { value: "high" },
- { value: "urgent" },
-];
+const priorities = ["no-priority", "low", "medium", "high", "urgent"];
export default function TaskPriorityPopover({
task,
@@ -37,66 +28,37 @@ export default function TaskPriorityPopover({
const [open, setOpen] = useState(false);
const { mutateAsync: updateTaskPriority } = useUpdateTaskPriority();
const { canUpdateTasks } = useWorkspacePermission();
- const canEdit = canUpdateTasks();
- const handlePriorityChange = useCallback(
- async (newPriority: string) => {
- try {
- await updateTaskPriority({
- ...task,
- priority: newPriority,
- });
- setOpen(false);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : t("tasks:popover.priority.updateError"),
- );
- }
- },
- [t, task, updateTaskPriority],
- );
-
- const shortcutOptions = useMemo(
- () =>
- priorityOptions.map((priority) => ({
- onSelect: () => handlePriorityChange(priority.value),
- })),
- [handlePriorityChange],
- );
-
- useNumberedShortcuts(open, shortcutOptions);
+ if (!canUpdateTasks()) return <>{children}</>;
- // Read-only role: render the trigger child as a plain element so the user
- // still sees the current priority but can't open the popover.
- if (!canEdit) return <>{children}</>;
+ const changePriority = async (priority: string) => {
+ setOpen(false);
+ try {
+ await updateTaskPriority({ ...task, priority });
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t("tasks:popover.priority.updateError"),
+ );
+ }
+ };
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>{children}</PopoverTrigger>
- <PopoverContent className="w-48 p-0" align="start">
- <div>
- {priorityOptions.map((priority, index) => (
- <Button
- key={priority.value}
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2 rounded-none first:rounded-t-md last:rounded-b-md"
- onClick={() => handlePriorityChange(priority.value)}
- >
- {getPriorityIcon(priority.value)}
- <span className="text-sm">
- {getPriorityLabel(priority.value)}
- </span>
- {task.priority === priority.value ? (
- <Check className="ml-auto h-4 w-4" />
- ) : (
- <ShortcutNumber number={index + 1} />
- )}
- </Button>
- ))}
- </div>
+ <PopoverContent className="w-60 p-0" align="start">
+ <OptionMenu
+ label={t("tasks:priority.label")}
+ placeholder={t("tasks:bulk.priorityPlaceholder")}
+ options={priorities.map((priority) => ({
+ value: priority,
+ label: getPriorityLabel(priority),
+ icon: getPriorityIcon(priority),
+ selected: (task.priority || "no-priority") === priority,
+ }))}
+ onSelect={changePriority}
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-properties-sidebar.tsx b/apps/web/src/components/task/task-properties-sidebar.tsx
deleted file mode 100644
index 5d922d204..000000000
--- a/apps/web/src/components/task/task-properties-sidebar.tsx
+++ /dev/null
@@ -1,694 +0,0 @@
-import type { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
-import {
- Calendar,
- CalendarClock,
- CalendarDays,
- CalendarX,
- Plus,
- GitBranchIcon,
- LinkIcon,
-} from "lucide-react";
-import { useTranslation } from "react-i18next";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { useGetColumns } from "@/hooks/queries/column/use-get-columns";
-import useGetGiteaIntegration from "@/hooks/queries/gitea-integration/use-get-gitea-integration";
-import useGetGithubIntegration from "@/hooks/queries/github-integration/use-get-github-integration";
-import useGetGitlabIntegration from "@/hooks/queries/gitlab-integration/use-get-gitlab-integration";
-import useGetLabelsByTask from "@/hooks/queries/label/use-get-labels-by-task";
-import useGetProject from "@/hooks/queries/project/use-get-project";
-import useGetProjects from "@/hooks/queries/project/use-get-projects";
-import useGetTask from "@/hooks/queries/task/use-get-task";
-import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";
-import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";
-import { useTaskCopyShortcuts } from "@/hooks/use-task-copy-shortcuts";
-import { getColumnIcon } from "@/lib/column";
-import {
- dueDateStatusColors,
- getDueDateStatus,
- isTaskCompleted,
-} from "@/lib/due-date-status";
-import { formatDateShort } from "@/lib/format";
-import { generateLink } from "@/lib/generate-link";
-import { getInitials } from "@/lib/get-initials";
-import { getPriorityLabel, getStatusDisplayLabel } from "@/lib/i18n/domain";
-import { resolveLabelColor } from "@/lib/label-color";
-import { getPriorityIcon } from "@/lib/priority";
-import { getTaskPath } from "@/lib/task-link";
-import { toast } from "@/lib/toast";
-import { TaskCustomFieldChips } from "./custom-fields/task-custom-field-chips";
-import { TaskCustomFieldRows } from "./custom-fields/task-custom-field-rows";
-import TaskActions from "./task-actions";
-import TaskAssigneePopover from "./task-assignee-popover";
-import TaskDueDatePopover from "./task-due-date-popover";
-import TaskLabelsPopover from "./task-labels-popover";
-import TaskPriorityPopover from "./task-priority-popover";
-import TaskStartDatePopover from "./task-start-date-popover";
-import TaskStatusPopover from "./task-status-popover";
-
-function slugify(text: string | undefined): string {
- if (!text) return "";
- return text
- .toLowerCase()
- .replace(/[^a-z0-9]+/g, "-")
- .replace(/^-|-$/g, "")
- .slice(0, 50);
-}
-
-function generateBranchName(
- pattern: string,
- projectSlug: string | undefined,
- taskNumber: number | null | undefined,
- taskTitle: string | undefined,
-): string {
- if (!projectSlug || !taskNumber) return "";
- return pattern
- .replace("{slug}", projectSlug.toLowerCase())
- .replace("{number}", taskNumber.toString())
- .replace("{title}", slugify(taskTitle));
-}
-
-type TaskPropertiesSidebarProps = {
- taskId: string | undefined;
- projectId: string;
- workspaceId: string;
- className?: string;
- compact?: boolean;
- deleteHandle: AlertDialogPrimitive.Handle<unknown>;
- shortcutsEnabled?: boolean;
-};
-
-export default function TaskPropertiesSidebar({
- taskId,
- projectId,
- workspaceId,
- className,
- compact = false,
- deleteHandle,
- shortcutsEnabled = true,
-}: TaskPropertiesSidebarProps) {
- const { t } = useTranslation();
- const { data: task } = useGetTask(taskId ?? "");
- const { data: project } = useGetProject({ id: projectId, workspaceId });
- const { data: workspace } = useActiveWorkspace();
- const { data: columns = [] } = useGetColumns(projectId);
- const taskIsCompleted = isTaskCompleted(task?.status ?? "", columns);
- const { data: workspaceUsers } = useGetActiveWorkspaceUsers(workspaceId);
- const { data: taskLabels = [] } = useGetLabelsByTask(taskId ?? "");
- const { data: githubIntegration } = useGetGithubIntegration(projectId);
- const { data: giteaIntegration } = useGetGiteaIntegration(projectId);
- const { data: gitlabIntegration } = useGetGitlabIntegration(projectId);
- const { data: workspaceProjects = [] } = useGetProjects({ workspaceId });
- const canMoveTask =
- Boolean(task) && workspaceProjects.some((p) => p.id !== task?.projectId);
- const statusColumn = columns.find(
- (column) => column.slug === task?.status || column.id === task?.status,
- );
- const statusLabel = getStatusDisplayLabel(
- task?.status ?? "",
- statusColumn?.name,
- );
- const statusIsFinal = statusColumn?.isFinal ?? false;
- const statusIcon = statusColumn?.icon;
-
- const projectSlug = project?.slug;
- const taskNumber = task?.number;
- const branchPattern =
- githubIntegration?.branchPattern ||
- giteaIntegration?.branchPattern ||
- gitlabIntegration?.branchPattern ||
- "{slug}-{number}";
- const copiedBranchPattern =
- branchPattern === "{slug}-{number}"
- ? "{slug}-{number}-{title}"
- : branchPattern;
-
- const assignee = workspaceUsers?.members?.find(
- (member) => member.userId === task?.userId,
- );
-
- const handleCopyTaskLink = () => {
- if (!taskId) return;
- navigator.clipboard.writeText(
- generateLink(
- getTaskPath({
- workspaceId,
- workspace,
- projectId,
- workspaceProjects,
- taskId,
- taskNumber,
- title: task?.title,
- }),
- ),
- );
- toast.message(t("tasks:properties.taskLinkCopied"), { icon: LinkIcon });
- };
-
- const handleCopyTaskBranch = () => {
- const branchName = generateBranchName(
- copiedBranchPattern,
- projectSlug,
- taskNumber,
- task?.title,
- );
- navigator.clipboard.writeText(branchName);
- toast.message(t("tasks:properties.taskBranchCopied"), {
- icon: GitBranchIcon,
- });
- };
-
- useTaskCopyShortcuts({
- enabled: Boolean(task) && shortcutsEnabled,
- onCopyLink: handleCopyTaskLink,
- onCopyBranch: handleCopyTaskBranch,
- });
-
- return (
- <div className={className}>
- <div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
- {/* 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 px-3 py-2">
- <TaskActions
- task={task}
- workspaceId={workspaceId}
- canMoveTask={canMoveTask}
- onCopyLink={handleCopyTaskLink}
- onCopyBranch={handleCopyTaskBranch}
- deleteHandle={deleteHandle}
- />
- </div>
-
- <div className="flex flex-row flex-wrap gap-1.5 items-center p-2 w-full">
- {task && (
- <TaskStatusPopover task={task}>
- <Button
- data-task-action="status"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {getColumnIcon(
- task.status ?? "",
- statusIsFinal,
- statusIcon,
- )}
- <span className="text-xs font-semibold truncate">
- {statusLabel}
- </span>
- </Button>
- </TaskStatusPopover>
- )}
- {task && (
- <TaskPriorityPopover task={task}>
- <Button
- data-task-action="priority"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {getPriorityIcon(task.priority ?? "")}
- <span className="text-xs font-semibold truncate">
- {getPriorityLabel(task.priority ?? "")}
- </span>
- </Button>
- </TaskPriorityPopover>
- )}
- {task && (
- <TaskAssigneePopover task={task} workspaceId={workspaceId}>
- <Button
- data-task-action="assignee"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {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]">
- {getInitials(
- assignee?.user?.name || task.assigneeName,
- )}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center flex-shrink-0"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[8px] font-medium">?</span>
- </div>
- )}
- <span className="text-xs font-semibold truncate max-w-[100px]">
- {assignee?.user?.name ||
- task.assigneeName ||
- t("tasks:popover.assignee.unassigned")}
- </span>
- </Button>
- </TaskAssigneePopover>
- )}
- {task && (
- <TaskStartDatePopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- <CalendarDays className="w-3.5 h-3.5 text-muted-foreground" />
- <span
- className={`text-xs font-semibold ${task.startDate ? "" : "text-muted-foreground"}`}
- >
- {task.startDate
- ? formatDateShort(task.startDate)
- : t("tasks:properties.start")}
- </span>
- </Button>
- </TaskStartDatePopover>
- )}
- {task && (
- <TaskDueDatePopover task={task}>
- <Button
- data-task-action="dueDate"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {task.dueDate ? (
- <>
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "overdue" && (
- <CalendarX
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "due-soon" && (
- <CalendarClock
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {(getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "far-future" ||
- getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "no-due-date") && (
- <Calendar
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- <span className="text-xs font-semibold">
- {formatDateShort(task.dueDate)}
- </span>
- </>
- ) : (
- <>
- <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
- <span className="text-xs font-semibold text-muted-foreground">
- {t("tasks:properties.noDate")}
- </span>
- </>
- )}
- </Button>
- </TaskDueDatePopover>
- )}
- {taskId && (
- <TaskCustomFieldChips taskId={taskId} projectId={projectId} />
- )}
- </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 px-3 py-2">
- <TaskActions
- task={task}
- workspaceId={workspaceId}
- canMoveTask={canMoveTask}
- onCopyLink={handleCopyTaskLink}
- onCopyBranch={handleCopyTaskBranch}
- deleteHandle={deleteHandle}
- />
- </div>
-
- <div className="flex flex-row flex-wrap gap-1.5 items-center p-2 w-full">
- {task && (
- <TaskStatusPopover task={task}>
- <Button
- data-task-action="status"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {getColumnIcon(
- task.status ?? "",
- statusIsFinal,
- statusIcon,
- )}
- <span className="text-xs font-semibold truncate">
- {statusLabel}
- </span>
- </Button>
- </TaskStatusPopover>
- )}
- {task && (
- <TaskPriorityPopover task={task}>
- <Button
- data-task-action="priority"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {getPriorityIcon(task.priority ?? "")}
- <span className="text-xs font-semibold truncate">
- {getPriorityLabel(task.priority ?? "")}
- </span>
- </Button>
- </TaskPriorityPopover>
- )}
- {task && (
- <TaskAssigneePopover task={task} workspaceId={workspaceId}>
- <Button
- data-task-action="assignee"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {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]">
- {getInitials(
- assignee?.user?.name || task.assigneeName,
- )}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center shrink-0"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[8px] font-medium">?</span>
- </div>
- )}
- <span className="text-xs font-semibold truncate max-w-[100px]">
- {assignee?.user?.name ||
- task.assigneeName ||
- t("tasks:popover.assignee.unassigned")}
- </span>
- </Button>
- </TaskAssigneePopover>
- )}
- {task && (
- <TaskStartDatePopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- <CalendarDays className="w-3.5 h-3.5 text-muted-foreground" />
- <span
- className={`text-xs font-semibold ${task.startDate ? "" : "text-muted-foreground"}`}
- >
- {task.startDate
- ? formatDateShort(task.startDate)
- : t("tasks:properties.start")}
- </span>
- </Button>
- </TaskStartDatePopover>
- )}
- {task && (
- <TaskDueDatePopover task={task}>
- <Button
- data-task-action="dueDate"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-2.5 gap-1.5 rounded-md border-border hover:bg-accent/50"
- >
- {task.dueDate ? (
- <>
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "overdue" && (
- <CalendarX
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "due-soon" && (
- <CalendarClock
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {(getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "far-future" ||
- getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "no-due-date") && (
- <Calendar
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- <span className="text-xs font-semibold">
- {formatDateShort(task.dueDate)}
- </span>
- </>
- ) : (
- <>
- <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
- <span className="text-xs font-semibold text-muted-foreground">
- {t("tasks:properties.noDate")}
- </span>
- </>
- )}
- </Button>
- </TaskDueDatePopover>
- )}
- {taskId && (
- <TaskCustomFieldChips taskId={taskId} projectId={projectId} />
- )}
- </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-foreground/70 flex-1">
- {t("tasks:properties.title")}
- </p>
- <TaskActions
- task={task}
- workspaceId={workspaceId}
- canMoveTask={canMoveTask}
- onCopyLink={handleCopyTaskLink}
- onCopyBranch={handleCopyTaskBranch}
- deleteHandle={deleteHandle}
- />
- </div>
-
- <div className="flex flex-col gap-1 px-3 py-3">
- {task && (
- <TaskStatusPopover task={task}>
- <Button
- data-task-action="status"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1.5 w-full"
- >
- {getColumnIcon(
- task.status ?? "",
- statusIsFinal,
- statusIcon,
- )}
- <span className="text-xs font-semibold truncate">
- {statusLabel}
- </span>
- </Button>
- </TaskStatusPopover>
- )}
- {task && (
- <TaskPriorityPopover task={task}>
- <Button
- data-task-action="priority"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1.5 w-full"
- >
- {getPriorityIcon(task.priority ?? "")}
- <span className="text-xs font-semibold truncate">
- {getPriorityLabel(task.priority ?? "")}
- </span>
- </Button>
- </TaskPriorityPopover>
- )}
- {task && (
- <TaskAssigneePopover task={task} workspaceId={workspaceId}>
- <Button
- data-task-action="assignee"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1.5 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]">
- {getInitials(
- assignee?.user?.name || task.assigneeName,
- )}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="w-[16px] h-[16px] rounded-full bg-muted border border-border flex items-center justify-center shrink-0"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[8px] font-medium">?</span>
- </div>
- )}
- <span className="text-xs font-semibold truncate max-w-[100px]">
- {assignee?.user?.name ||
- task.assigneeName ||
- t("tasks:popover.assignee.unassigned")}
- </span>
- </Button>
- </TaskAssigneePopover>
- )}
- {task && (
- <TaskStartDatePopover task={task}>
- <Button
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1.5 w-full"
- >
- <CalendarDays className="w-3.5 h-3.5 text-muted-foreground" />
- <span
- className={`text-xs font-semibold ${task.startDate ? "" : "text-muted-foreground"}`}
- >
- {task.startDate
- ? formatDateShort(task.startDate)
- : t("tasks:properties.startDate")}
- </span>
- </Button>
- </TaskStartDatePopover>
- )}
- {task && (
- <TaskDueDatePopover task={task}>
- <Button
- data-task-action="dueDate"
- variant="ghost"
- size="sm"
- className="justify-start h-7 px-1.5 gap-1.5 w-full"
- >
- {task.dueDate ? (
- <>
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "overdue" && (
- <CalendarX
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "due-soon" && (
- <CalendarClock
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- {(getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "far-future" ||
- getDueDateStatus(task.dueDate, taskIsCompleted) ===
- "no-due-date") && (
- <Calendar
- className={`w-3.5 h-3.5 ${dueDateStatusColors[getDueDateStatus(task.dueDate, taskIsCompleted)]}`}
- />
- )}
- <span className="text-xs font-semibold">
- {formatDateShort(task.dueDate)}
- </span>
- </>
- ) : (
- <>
- <Calendar className="w-3.5 h-3.5 text-muted-foreground" />
- <span className="text-xs font-semibold text-muted-foreground">
- {t("tasks:properties.noDate")}
- </span>
- </>
- )}
- </Button>
- </TaskDueDatePopover>
- )}
- </div>
- </div>
- </>
- )}
-
- <div className="flex px-3 flex-col gap-3 p-2">
- <div className="flex flex-col gap-1">
- <span className="text-xs font-medium text-foreground/70 px-2">
- {t("tasks:properties.labels")}
- </span>
- <div className="flex flex-wrap items-center gap-1.5 px-2">
- {task &&
- taskLabels.length > 0 &&
- taskLabels.map(
- (label: { id: string; name: string; color: string }) => (
- <TaskLabelsPopover
- key={`edit-${label.id}`}
- task={task}
- workspaceId={workspaceId}
- triggerNativeButton={false}
- >
- <Badge
- variant="outline"
- className="flex items-center gap-1 px-1.5 py-0.5 cursor-pointer hover:bg-accent/50 transition-colors text-[10px]"
- >
- <span
- className="w-1.5 h-1.5 rounded-full flex-shrink-0"
- style={{
- backgroundColor: resolveLabelColor(label.color),
- }}
- />
- <span className="truncate max-w-[60px]">
- {label.name}
- </span>
- </Badge>
- </TaskLabelsPopover>
- ),
- )}
-
- {task && (
- <TaskLabelsPopover task={task} workspaceId={workspaceId}>
- <Button
- data-task-action="labels"
- variant="ghost"
- size="sm"
- aria-label={t("tasks:popover.labels.editLabels")}
- className="h-5 w-5 p-0 rounded-full"
- >
- <Plus className="h-3 w-3" />
- </Button>
- </TaskLabelsPopover>
- )}
- </div>
- </div>
- {!compact && taskId && (
- <div className="hidden lg:block">
- <TaskCustomFieldRows taskId={taskId} projectId={projectId} />
- </div>
- )}
- </div>
- </div>
- </div>
- );
-}
diff --git a/apps/web/src/components/task/task-relations.tsx b/apps/web/src/components/task/task-relations.tsx
index d2215d1b2..2ead5b02b 100644
--- a/apps/web/src/components/task/task-relations.tsx
+++ b/apps/web/src/components/task/task-relations.tsx
@@ -1,13 +1,5 @@
import { useNavigate } from "@tanstack/react-router";
-import {
- Ban,
- ChevronDown,
- ChevronRight,
- Link2,
- Plus,
- Search,
- X,
-} from "lucide-react";
+import { Ban, Link2, Search, X } from "lucide-react";
import { Fragment, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import {
@@ -19,13 +11,6 @@ import {
type RelationPickerMode,
useRelationPickerStore,
} from "./task-relation-picker-store";
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
-import { Button } from "@/components/ui/button";
-import {
- Collapsible,
- CollapsibleContent,
- CollapsibleTrigger,
-} from "@/components/ui/collapsible";
import {
Command,
CommandCollection,
@@ -57,12 +42,23 @@ import useActiveWorkspace from "@/hooks/queries/workspace/use-active-workspace";
import { useGetActiveWorkspaceUsers } from "@/hooks/queries/workspace-users/use-get-active-workspace-users";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { getColumnIcon } from "@/lib/column";
-import { getInitials } from "@/lib/get-initials";
import { toast } from "@/lib/toast";
import type Task from "@/types/task";
-import SubtaskAssigneePopover from "./subtask-assignee-popover";
+import { ReferenceAssigneeButton } from "./sections/reference-assignee-button";
+import { ReferenceStatusButton } from "./sections/reference-status-button";
+import { type RelationKind, RelationTag } from "./sections/relation-tag";
+import { SectionAddButton } from "./sections/section-add-button";
+import { SectionHeader } from "./sections/section-header";
+import { TaskReferenceRow } from "./sections/task-reference-row";
+import { useProjectSlugs } from "./sections/use-project-slugs";
import SubtaskStatusPopover from "./subtask-status-popover";
+const relationOrder: Record<RelationKind, number> = {
+ blocked_by: 0,
+ blocks: 1,
+ related: 2,
+};
+
type TaskRelationsProps = {
taskId: string;
projectId: string;
@@ -89,7 +85,6 @@ export default function TaskRelations({
}: TaskRelationsProps) {
const { t } = useTranslation();
const navigate = useNavigate();
- const [isOpen, setIsOpen] = useState(true);
const [commandOpen, setCommandOpen] = useState(false);
const [searchQuery, setSearchQuery] = useState("");
const [selectedRelationType, setSelectedRelationType] =
@@ -108,6 +103,7 @@ export default function TaskRelations({
const deleteRelation = useDeleteTaskRelation(taskId);
const { canUpdateTasks } = useWorkspacePermission();
const canEdit = canUpdateTasks();
+ const displayIdOf = useProjectSlugs(workspaceId);
useEffect(() => {
if (!relationRequest || relationRequest.taskId !== taskId) return;
@@ -127,39 +123,20 @@ export default function TaskRelations({
(rel) => rel.relationType !== "subtask",
);
- const groupedRelations = useMemo(() => {
- const groups: Record<
- string,
- Array<{
- id: string;
- relationType: string;
- task: NonNullable<(typeof nonSubtaskRelations)[number]["sourceTask"]>;
- }>
- > = {};
-
- for (const rel of nonSubtaskRelations) {
+ const linkedRelations = nonSubtaskRelations
+ .flatMap((rel) => {
const isSource = rel.sourceTaskId === taskId;
const linkedTask = isSource ? rel.targetTask : rel.sourceTask;
- if (!linkedTask) continue;
-
- // "blocks" is directional: when the current task is the target it is the
- // one being blocked, so group it under a distinct "blocked_by" key.
- const type =
- rel.relationType === "blocks" && !isSource
- ? "blocked_by"
- : rel.relationType;
- if (!groups[type]) {
- groups[type] = [];
- }
- groups[type].push({
- id: rel.id,
- relationType: rel.relationType,
- task: linkedTask,
- });
- }
-
- return groups;
- }, [nonSubtaskRelations, taskId]);
+ if (!linkedTask) return [];
+ const kind: RelationKind =
+ rel.relationType === "blocks"
+ ? isSource
+ ? "blocks"
+ : "blocked_by"
+ : "related";
+ return [{ id: rel.id, kind, task: linkedTask }];
+ })
+ .sort((a, b) => relationOrder[a.kind] - relationOrder[b.kind]);
const existingRelatedTaskIds = unpickableTaskIds(
selectedRelationType,
@@ -286,150 +263,100 @@ export default function TaskRelations({
return (
<>
- <Collapsible open={isOpen} onOpenChange={setIsOpen} className="w-full">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-1.5">
- <CollapsibleTrigger asChild>
- <button
- type="button"
- className="flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors"
- >
- {isOpen ? (
- <ChevronDown className="size-4" />
- ) : (
- <ChevronRight className="size-4" />
- )}
- <span>{t("tasks:relations.title")}</span>
- </button>
- </CollapsibleTrigger>
- {totalCount > 0 && (
- <span className="text-xs text-muted-foreground">
+ <section className="flex flex-col gap-1">
+ <SectionHeader
+ title={t("tasks:relations.title")}
+ meta={
+ totalCount > 0 && (
+ <span className="text-muted-foreground text-xs tabular-nums">
{totalCount}
</span>
- )}
- </div>
- {canEdit && (
- <Button
- variant="ghost"
- size="xs"
- className="text-muted-foreground"
- onClick={() => setCommandOpen(true)}
- >
- <Plus className="size-3.5" />
- </Button>
- )}
- </div>
-
- <CollapsibleContent>
- {Object.entries(groupedRelations).map(([type, items]) => (
- <div key={type} className="mt-1.5">
- <span className="text-[11px] text-muted-foreground/70 px-2">
- {t(`tasks:relations.types.${type}`, {
- defaultValue: type.replace(/_/g, " "),
- })}
- </span>
- <div className="flex flex-col mt-0.5">
- {items.map((item) => {
- const assignee = getAssignee(item.task.userId);
- const taskObj = buildTaskObject(item);
-
- return (
- <ContextMenu key={item.id}>
- <ContextMenuTrigger asChild>
- <div className="group flex items-center gap-2 py-1 px-2 rounded-md hover:bg-accent/50 transition-colors cursor-default">
- <SubtaskStatusPopover
- tasks={[taskObj]}
- projectId={projectId}
- >
- <button
- type="button"
- className="shrink-0 flex items-center justify-center rounded p-0.5 transition-colors outline-none [&_svg]:text-muted-foreground hover:[&_svg]:text-foreground"
- >
- {getColumnIcon(
- item.task.status,
- finalStatusSlugs.has(item.task.status),
- columnIconBySlug.get(item.task.status),
- )}
- </button>
- </SubtaskStatusPopover>
-
- <button
- type="button"
- className="flex-1 min-w-0 text-left outline-none"
- onClick={() => handleNavigateToTask(item.task.id)}
- >
- <span
- className={`text-sm truncate block ${finalStatusSlugs.has(item.task.status) ? "line-through text-muted-foreground" : "text-foreground/90"}`}
- >
- {item.task.title}
- </span>
- </button>
-
- <SubtaskAssigneePopover
- tasks={[taskObj]}
- workspaceId={workspaceId}
- >
- <button
- type="button"
- className="shrink-0 flex items-center justify-center rounded p-0.5 transition-colors outline-none"
- >
- {item.task.userId && assignee ? (
- <Avatar className="h-5 w-5">
- <AvatarImage
- src={assignee?.user?.image ?? ""}
- alt={assignee?.user?.name || ""}
- />
- <AvatarFallback className="text-[9px] font-medium border border-border/30">
- {getInitials(assignee?.user?.name)}
- </AvatarFallback>
- </Avatar>
- ) : (
- <div
- className="flex h-5 w-5 items-center justify-center rounded-full border border-dashed border-border/70"
- title={t("tasks:popover.assignee.unassigned")}
- >
- <span className="text-[9px] font-medium text-muted-foreground">
- ?
- </span>
- </div>
- )}
- </button>
- </SubtaskAssigneePopover>
- </div>
- </ContextMenuTrigger>
-
- <ContextMenuContent className="w-40">
- <ContextMenuItem
- onClick={() => handleNavigateToTask(item.task.id)}
+ )
+ }
+ action={
+ canEdit && (
+ <SectionAddButton
+ aria-label={`${t("tasks:subtasks.addAction")} ${t("tasks:relations.title")}`}
+ onClick={() => setCommandOpen(true)}
+ />
+ )
+ }
+ />
+
+ <div className="flex flex-col">
+ {linkedRelations.map((item) => {
+ const assignee = getAssignee(item.task.userId);
+ const taskObj = buildTaskObject(item);
+ const isFinal = finalStatusSlugs.has(item.task.status);
+
+ return (
+ <ContextMenu key={item.id}>
+ <ContextMenuTrigger asChild>
+ <TaskReferenceRow
+ status={
+ <SubtaskStatusPopover
+ tasks={[taskObj]}
+ projectId={item.task.projectId}
+ >
+ <ReferenceStatusButton
+ aria-label={t("tasks:status.label")}
>
- <span>{t("tasks:relations.openTask")}</span>
- </ContextMenuItem>
- {canEdit && (
- <>
- <ContextMenuSeparator />
- <ContextMenuItem
- className="text-destructive"
- onClick={() => handleRemoveRelation(item.id)}
- >
- <span>{t("tasks:relations.removeRelation")}</span>
- </ContextMenuItem>
- </>
- )}
- </ContextMenuContent>
- </ContextMenu>
- );
- })}
- </div>
- </div>
- ))}
+ {getColumnIcon(
+ item.task.status,
+ isFinal,
+ columnIconBySlug.get(item.task.status),
+ )}
+ </ReferenceStatusButton>
+ </SubtaskStatusPopover>
+ }
+ displayId={displayIdOf(
+ item.task.projectId,
+ item.task.number,
+ )}
+ title={item.task.title}
+ done={isFinal}
+ onOpen={() => handleNavigateToTask(item.task.id)}
+ tag={<RelationTag kind={item.kind} />}
+ assignee={
+ <ReferenceAssigneeButton
+ tasks={[taskObj]}
+ workspaceId={workspaceId}
+ name={assignee?.user?.name ?? item.task.assigneeName}
+ image={assignee?.user?.image}
+ />
+ }
+ />
+ </ContextMenuTrigger>
+
+ <ContextMenuContent className="w-40">
+ <ContextMenuItem
+ onClick={() => handleNavigateToTask(item.task.id)}
+ >
+ <span>{t("tasks:relations.openTask")}</span>
+ </ContextMenuItem>
+ {canEdit && (
+ <>
+ <ContextMenuSeparator />
+ <ContextMenuItem
+ className="text-destructive"
+ onClick={() => handleRemoveRelation(item.id)}
+ >
+ <span>{t("tasks:relations.removeRelation")}</span>
+ </ContextMenuItem>
+ </>
+ )}
+ </ContextMenuContent>
+ </ContextMenu>
+ );
+ })}
{totalCount === 0 && (
- <p className="text-xs text-muted-foreground px-2 py-1">
+ <p className="px-2 py-1 text-muted-foreground text-xs">
{t("tasks:relations.empty")}
</p>
)}
- </CollapsibleContent>
- </Collapsible>
+ </div>
+ </section>
<CommandDialog open={commandOpen} onOpenChange={setCommandOpen}>
<CommandDialogPopup>
diff --git a/apps/web/src/components/task/task-shortcuts.test.tsx b/apps/web/src/components/task/task-shortcuts.test.tsx
index ca177dece..3e2d4e6ac 100644
--- a/apps/web/src/components/task/task-shortcuts.test.tsx
+++ b/apps/web/src/components/task/task-shortcuts.test.tsx
@@ -66,6 +66,27 @@ vi.mock("@/hooks/queries/task/use-get-task", () => ({
vi.mock("@/hooks/queries/project/use-get-project", () => ({
default: () => ({ data: { slug: "KAN" } }),
}));
+vi.mock("@/hooks/queries/project/use-get-projects", () => ({
+ default: () => ({ data: [] }),
+}));
+vi.mock("@/hooks/queries/workspace/use-active-workspace", () => ({
+ default: () => ({ data: undefined }),
+}));
+vi.mock(
+ "@/hooks/queries/github-integration/use-get-github-integration",
+ () => ({
+ default: () => ({ data: undefined }),
+ }),
+);
+vi.mock("@/hooks/queries/gitea-integration/use-get-gitea-integration", () => ({
+ default: () => ({ data: undefined }),
+}));
+vi.mock(
+ "@/hooks/queries/gitlab-integration/use-get-gitlab-integration",
+ () => ({
+ default: () => ({ data: undefined }),
+ }),
+);
vi.mock("@/hooks/queries/task-relation/use-get-task-relations", () => ({
default: () => ({ data: mocks.relations }),
}));
diff --git a/apps/web/src/components/task/task-shortcuts.tsx b/apps/web/src/components/task/task-shortcuts.tsx
index 4fcbe0341..e7e17ea6a 100644
--- a/apps/web/src/components/task/task-shortcuts.tsx
+++ b/apps/web/src/components/task/task-shortcuts.tsx
@@ -1,15 +1,15 @@
import { useNavigate } from "@tanstack/react-router";
-import { CopyIcon, FileTextIcon, HashIcon, UserRoundIcon } from "lucide-react";
+import { UserRoundIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import useAuth from "@/components/providers/auth-provider/hooks/use-auth";
import { useUpdateTaskAssignee } from "@/hooks/mutations/task/use-update-task-assignee";
import { useUpdateTaskDueDate } from "@/hooks/mutations/task/use-update-task-due-date";
-import useGetProject from "@/hooks/queries/project/use-get-project";
import useGetTask from "@/hooks/queries/task/use-get-task";
import useGetTaskRelations from "@/hooks/queries/task-relation/use-get-task-relations";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { useShortcut } from "@/lib/shortcuts/use-shortcut";
import { toast } from "@/lib/toast";
+import { useTaskCopyActions } from "./header/use-task-copy-actions";
import { clickTaskAction, focusTaskAction } from "./task-action-target";
import { useRelationPickerStore } from "./task-relation-picker-store";
@@ -30,7 +30,7 @@ export function TaskShortcuts({
const navigate = useNavigate();
const { user } = useAuth();
const { data: task } = useGetTask(taskId);
- const { data: project } = useGetProject({ id: projectId, workspaceId });
+ const copyActions = useTaskCopyActions({ taskId, projectId, workspaceId });
const { data: relations = [] } = useGetTaskRelations(taskId);
const { mutateAsync: updateAssignee } = useUpdateTaskAssignee();
const { mutateAsync: updateDueDate } = useUpdateTaskDueDate();
@@ -40,15 +40,6 @@ export function TaskShortcuts({
const editable = { enabled: active.enabled && canUpdateTasks() };
const assignable = { enabled: active.enabled && canAssignTasks() };
- const copy = async (text: string, message: string, icon: typeof CopyIcon) => {
- try {
- await navigator.clipboard.writeText(text);
- toast.message(message, { icon });
- } catch {
- toast.error(t("tasks:shortcuts.copyFailed"));
- }
- };
-
const openTask = (id: string | undefined) => {
if (!id) return;
navigate({
@@ -157,37 +148,11 @@ export function TaskShortcuts({
active,
);
- useShortcut(
- "copyTaskId",
- () => {
- if (!task || !project) return;
- void copy(
- `${project.slug}-${task.number}`,
- t("tasks:shortcuts.idCopied"),
- HashIcon,
- );
- },
- active,
- );
- useShortcut(
- "copyTaskTitle",
- () => {
- if (!task) return;
- void copy(task.title, t("tasks:shortcuts.titleCopied"), CopyIcon);
- },
- active,
- );
- useShortcut(
- "copyAsMarkdown",
- () => {
- if (!task) return;
- const markdown = [`# ${task.title}`, task.description?.trim()]
- .filter(Boolean)
- .join("\n\n");
- void copy(markdown, t("tasks:shortcuts.markdownCopied"), FileTextIcon);
- },
- active,
- );
+ useShortcut("copyTaskId", copyActions.copyId, active);
+ useShortcut("copyTaskTitle", copyActions.copyTitle, active);
+ useShortcut("copyAsMarkdown", copyActions.copyMarkdown, active);
+ useShortcut("copyTaskUrl", copyActions.copyLink, active);
+ useShortcut("copyBranchName", copyActions.copyBranch, active);
return null;
}
diff --git a/apps/web/src/components/task/task-status-popover.test.tsx b/apps/web/src/components/task/task-status-popover.test.tsx
index 80ded853d..a5e8d17db 100644
--- a/apps/web/src/components/task/task-status-popover.test.tsx
+++ b/apps/web/src/components/task/task-status-popover.test.tsx
@@ -19,10 +19,6 @@ vi.mock("@/hooks/mutations/task/use-update-task-status", () => ({
useUpdateTaskStatus: () => ({ mutateAsync: vi.fn() }),
}));
-vi.mock("@/hooks/use-numbered-shortcuts", () => ({
- useNumberedShortcuts: vi.fn(),
-}));
-
vi.mock("@/hooks/use-workspace-permission", () => ({
useWorkspacePermission: () => ({ canUpdateTasks: () => true }),
}));
@@ -71,11 +67,11 @@ describe("TaskStatusPopover", () => {
);
expect(useGetColumns).toHaveBeenCalledWith("project-1");
- expect(screen.queryByRole("button", { name: /Ready/ })).toBeNull();
+ expect(screen.queryByRole("option", { name: /Ready/ })).toBeNull();
fireEvent.click(screen.getByRole("button", { name: "Status" }));
- expect(await screen.findByRole("button", { name: /Ready/ })).toBeVisible();
+ expect(await screen.findByRole("option", { name: /Ready/ })).toBeVisible();
});
it("shows loading feedback while status options are loading", async () => {
diff --git a/apps/web/src/components/task/task-status-popover.tsx b/apps/web/src/components/task/task-status-popover.tsx
index fab5eb388..b031adb14 100644
--- a/apps/web/src/components/task/task-status-popover.tsx
+++ b/apps/web/src/components/task/task-status-popover.tsx
@@ -1,21 +1,17 @@
-import { Check } from "lucide-react";
-import { useCallback, useMemo, useState } from "react";
+import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { Button } from "@/components/ui/button";
+import { OptionMenu } from "@/components/common/option-menu/option-menu";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
-import { ShortcutNumber } from "@/components/ui/shortcut-number";
import { useUpdateTaskStatus } from "@/hooks/mutations/task/use-update-task-status";
import { useGetColumns } from "@/hooks/queries/column/use-get-columns";
-import { useNumberedShortcuts } from "@/hooks/use-numbered-shortcuts";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
-import { getColumnIcon } from "@/lib/column";
-import { getStatusDisplayLabel } from "@/lib/i18n/domain";
import { toast } from "@/lib/toast";
import type Task from "@/types/task";
+import { statusMenuOptions } from "./menus/status-menu-options";
type TaskStatusPopoverProps = {
task: Task;
@@ -28,87 +24,48 @@ export default function TaskStatusPopover({
}: TaskStatusPopoverProps) {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
- const { data: columns, isLoading, isError } = useGetColumns(task.projectId);
- const statusOptions = useMemo(
- () =>
- (columns ?? []).map((col) => ({
- value: col.slug,
- label: col.name,
- icon: col.icon,
- isFinal: col.isFinal,
- })),
- [columns],
- );
+ const {
+ data: columns = [],
+ isLoading,
+ isError,
+ } = useGetColumns(task.projectId);
const { mutateAsync: updateTaskStatus } = useUpdateTaskStatus();
const { canUpdateTasks } = useWorkspacePermission();
- const canEdit = canUpdateTasks();
-
- const handleStatusChange = useCallback(
- async (newStatus: string) => {
- try {
- await updateTaskStatus({
- ...task,
- status: newStatus,
- });
- setOpen(false);
- } catch (error) {
- toast.error(
- error instanceof Error
- ? error.message
- : t("tasks:popover.status.updateError"),
- );
- }
- },
- [t, task, updateTaskStatus],
- );
-
- const shortcutOptions = useMemo(
- () =>
- statusOptions.map((status) => ({
- onSelect: () => handleStatusChange(status.value),
- })),
- [handleStatusChange, statusOptions],
- );
- useNumberedShortcuts(open, shortcutOptions);
+ if (!canUpdateTasks()) return <>{children}</>;
- if (!canEdit) return <>{children}</>;
+ const changeStatus = async (status: string) => {
+ setOpen(false);
+ try {
+ await updateTaskStatus({ ...task, status });
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : t("tasks:popover.status.updateError"),
+ );
+ }
+ };
return (
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>{children}</PopoverTrigger>
- <PopoverContent className="w-48 p-0" align="start">
- <div>
- {isLoading ? (
- <div className="p-3 text-center text-sm text-muted-foreground">
- {t("common:empty.loading")}
- </div>
- ) : isError ? (
- <div className="p-3 text-center text-sm text-destructive">
- {t("common:error.title")}
- </div>
- ) : (
- statusOptions.map((status, index) => (
- <Button
- key={status.value}
- variant="ghost"
- size="sm"
- className="w-full justify-start gap-2 h-8 px-2 rounded-none first:rounded-t-md last:rounded-b-md"
- onClick={() => handleStatusChange(status.value)}
- >
- {getColumnIcon(status.value, status.isFinal, status.icon)}
- <span className="text-sm">
- {getStatusDisplayLabel(status.value, status.label)}
- </span>
- {task.status === status.value ? (
- <Check className="ml-auto h-4 w-4" />
- ) : (
- <ShortcutNumber number={index + 1} />
- )}
- </Button>
- ))
- )}
- </div>
+ <PopoverContent className="w-60 p-0" align="start">
+ <OptionMenu
+ label={t("tasks:status.label")}
+ placeholder={t("tasks:bulk.statusPlaceholder")}
+ options={statusMenuOptions(columns, task.status)}
+ onSelect={changeStatus}
+ status={
+ isLoading ? (
+ t("common:empty.loading")
+ ) : isError ? (
+ <span className="text-destructive-foreground">
+ {t("common:error.title")}
+ </span>
+ ) : undefined
+ }
+ />
</PopoverContent>
</Popover>
);
diff --git a/apps/web/src/components/task/task-subtasks.test.tsx b/apps/web/src/components/task/task-subtasks.test.tsx
index 5c406219f..c8f2543e6 100644
--- a/apps/web/src/components/task/task-subtasks.test.tsx
+++ b/apps/web/src/components/task/task-subtasks.test.tsx
@@ -67,6 +67,9 @@ vi.mock(
useGetActiveWorkspaceUsers: () => ({ data: { members: [] } }),
}),
);
+vi.mock("@/hooks/queries/project/use-get-projects", () => ({
+ default: () => ({ data: [] }),
+}));
vi.mock("@/hooks/use-workspace-permission", () => ({
useWorkspacePermission: () => ({
canCreateTasks: mocks.canCreateTasks,
diff --git a/apps/web/src/components/task/task-subtasks.tsx b/apps/web/src/components/task/task-subtasks.tsx
index 55b22bf77..670177bbc 100644
--- a/apps/web/src/components/task/task-subtasks.tsx
+++ b/apps/web/src/components/task/task-subtasks.tsx
@@ -1,6 +1,6 @@
import { useNavigate } from "@tanstack/react-router";
import { AnimatePresence } from "framer-motion";
-import { ChevronDown, ChevronRight, Plus, Trash2Icon } from "lucide-react";
+import { Trash2Icon } from "lucide-react";
import { useCallback, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import {
@@ -14,11 +14,6 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import CircularProgress from "@/components/ui/circular-progress";
-import {
- Collapsible,
- CollapsibleContent,
- CollapsibleTrigger,
-} from "@/components/ui/collapsible";
import { Input } from "@/components/ui/input";
import getColumns from "@/fetchers/column/get-columns";
import useCreateTask from "@/hooks/mutations/task/use-create-task";
@@ -33,6 +28,9 @@ import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { toast } from "@/lib/toast";
import queryClient from "@/query-client";
import type Task from "@/types/task";
+import { SectionAddButton } from "./sections/section-add-button";
+import { SectionHeader } from "./sections/section-header";
+import { useProjectSlugs } from "./sections/use-project-slugs";
import SubtaskRow from "./subtask-row";
type TaskSubtasksProps = {
@@ -50,7 +48,6 @@ export default function TaskSubtasks({
}: TaskSubtasksProps) {
const { t } = useTranslation();
const navigate = useNavigate();
- const [isOpen, setIsOpen] = useState(true);
const [isAdding, setIsAdding] = useState(false);
const [newTitle, setNewTitle] = useState("");
const [deleteTaskId, setDeleteTaskId] = useState<string | null>(null);
@@ -71,6 +68,7 @@ export default function TaskSubtasks({
const { data: columns = [], isLoading: isLoadingColumns } =
useGetColumns(projectId);
const { canCreateTasks, canUpdateTasks } = useWorkspacePermission();
+ const displayIdOf = useProjectSlugs(workspaceId);
const canEdit = canUpdateTasks();
const canCreate = canCreateTasks();
@@ -320,148 +318,135 @@ export default function TaskSubtasks({
return (
<>
- <Collapsible open={isOpen} onOpenChange={setIsOpen} className="w-full">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-1.5">
- <CollapsibleTrigger asChild>
- <button
- type="button"
- className="flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors"
- >
- {isOpen ? (
- <ChevronDown className="size-4" />
- ) : (
- <ChevronRight className="size-4" />
- )}
- <span>{t("tasks:subtasks.title")}</span>
- </button>
- </CollapsibleTrigger>
- {totalCount > 0 && (
- <span className="flex items-center gap-1.5 ml-0.5">
+ <section className="flex flex-col gap-1">
+ <SectionHeader
+ title={t("tasks:subtasks.title")}
+ meta={
+ totalCount > 0 && (
+ <span className="flex items-center gap-1.5 text-muted-foreground text-xs tabular-nums">
<CircularProgress
completed={completedCount}
total={totalCount}
+ size={14}
/>
- <span className="text-xs text-muted-foreground">
- {completedCount}/{totalCount}
- </span>
+ {completedCount}/{totalCount}
</span>
- )}
- </div>
- {canEdit && canCreate && (
- <Button
- variant="ghost"
- size="xs"
- className="text-muted-foreground"
- data-task-action="addSubtask"
- aria-label={`${t("tasks:subtasks.addAction")} ${t("tasks:subtasks.title")}`}
- onClick={() => setIsAdding(true)}
- disabled={!canCreateSubtask}
- >
- <Plus className="size-3.5" />
- </Button>
- )}
- </div>
+ )
+ }
+ action={
+ canEdit &&
+ canCreate && (
+ <SectionAddButton
+ data-task-action="addSubtask"
+ aria-label={`${t("tasks:subtasks.addAction")} ${t("tasks:subtasks.title")}`}
+ onClick={() => setIsAdding(true)}
+ disabled={!canCreateSubtask}
+ />
+ )
+ }
+ />
- <CollapsibleContent>
- {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- keyboard nav managed via document listener */}
- <div
- ref={containerRef}
- className="flex flex-col mt-1"
- onMouseDown={() => {
- if (focusedIndex === -1 && !hasSelection) {
- setFocusedIndex(0);
- }
- }}
+ {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions -- keyboard nav managed via document listener */}
+ <div
+ ref={containerRef}
+ className="flex flex-col"
+ onMouseDown={() => {
+ if (focusedIndex === -1 && !hasSelection) {
+ setFocusedIndex(0);
+ }
+ }}
+ >
+ <AnimatePresence
+ key={relationsLoaded ? "loaded" : "loading"}
+ initial={false}
>
- <AnimatePresence
- key={relationsLoaded ? "loaded" : "loading"}
- initial={false}
- >
- {subtasks.map((subtask, index) => {
- const taskObj = buildTaskObject(subtask);
- const isSelected = selectedIds.has(subtask.task.id);
+ {subtasks.map((subtask, index) => {
+ const taskObj = buildTaskObject(subtask);
+ const isSelected = selectedIds.has(subtask.task.id);
- return (
- <SubtaskRow
- key={subtask.task.id}
- task={taskObj}
- tasks={getTargetTasks(taskObj)}
- projectId={subtask.task.projectId}
- workspaceId={workspace?.id ?? workspaceId}
- workspaceSlug={workspace?.slug}
- isSelected={isSelected}
- isFocused={focusedIndex === index}
- isCompleted={subtask.task.isCompleted}
- canEdit={canEdit}
- selectionRadius={getSelectionRadius(index, isSelected)}
- assignee={getAssignee(subtask.task.userId)}
- onToggleComplete={() => handleToggleComplete(taskObj)}
- onNavigate={() =>
- navigate({
- to: "/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId",
- params: {
- workspaceId,
- projectId: subtask.task.projectId,
- taskId: subtask.task.id,
- },
- })
- }
- onDeleteClick={() => setDeleteTaskId(subtask.task.id)}
- />
- );
- })}
- </AnimatePresence>
- </div>
-
- {isAdding && canEdit && canCreate && (
- <div className="flex items-center gap-2 mt-2">
- <Input
- size="sm"
- placeholder={t("tasks:subtasks.inputPlaceholder")}
- value={newTitle}
- onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
- setNewTitle(e.target.value)
- }
- onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === "Enter") handleAddSubtask();
- if (e.key === "Escape") {
- e.stopPropagation();
- setIsAdding(false);
- setNewTitle("");
+ return (
+ <SubtaskRow
+ key={subtask.task.id}
+ task={taskObj}
+ tasks={getTargetTasks(taskObj)}
+ displayId={displayIdOf(
+ subtask.task.projectId,
+ subtask.task.number,
+ )}
+ projectId={subtask.task.projectId}
+ workspaceId={workspace?.id ?? workspaceId}
+ workspaceSlug={workspace?.slug}
+ isSelected={isSelected}
+ isFocused={focusedIndex === index}
+ isCompleted={subtask.task.isCompleted}
+ canEdit={canEdit}
+ selectionRadius={getSelectionRadius(index, isSelected)}
+ assignee={getAssignee(subtask.task.userId)}
+ onToggleComplete={() => handleToggleComplete(taskObj)}
+ onNavigate={() =>
+ navigate({
+ to: "/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId",
+ params: {
+ workspaceId,
+ projectId: subtask.task.projectId,
+ taskId: subtask.task.id,
+ },
+ })
}
- }}
- autoFocus
- />
- <Button
- size="xs"
- onClick={handleAddSubtask}
- disabled={
- !newTitle.trim() || createTask.isPending || !canCreateSubtask
- }
- >
- {t("tasks:subtasks.addAction")}
- </Button>
- <Button
- variant="ghost"
- size="xs"
- onClick={() => {
+ onDeleteClick={() => setDeleteTaskId(subtask.task.id)}
+ />
+ );
+ })}
+ </AnimatePresence>
+ </div>
+
+ {isAdding && canEdit && canCreate && (
+ <div className="flex items-center gap-2 px-1 pt-1">
+ <Input
+ size="sm"
+ placeholder={t("tasks:subtasks.inputPlaceholder")}
+ value={newTitle}
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
+ setNewTitle(e.target.value)
+ }
+ onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {
+ if (e.key === "Enter") handleAddSubtask();
+ if (e.key === "Escape") {
+ e.stopPropagation();
setIsAdding(false);
setNewTitle("");
- }}
- >
- {t("common:actions.cancel")}
- </Button>
- </div>
- )}
+ }
+ }}
+ autoFocus
+ />
+ <Button
+ size="xs"
+ onClick={handleAddSubtask}
+ disabled={
+ !newTitle.trim() || createTask.isPending || !canCreateSubtask
+ }
+ >
+ {t("tasks:subtasks.addAction")}
+ </Button>
+ <Button
+ variant="ghost"
+ size="xs"
+ onClick={() => {
+ setIsAdding(false);
+ setNewTitle("");
+ }}
+ >
+ {t("common:actions.cancel")}
+ </Button>
+ </div>
+ )}
- {!isAdding && totalCount === 0 && (
- <p className="text-xs text-muted-foreground px-2 py-1">
- {t("tasks:subtasks.empty")}
- </p>
- )}
- </CollapsibleContent>
- </Collapsible>
+ {!isAdding && totalCount === 0 && (
+ <p className="px-2 py-1 text-muted-foreground text-xs">
+ {t("tasks:subtasks.empty")}
+ </p>
+ )}
+ </section>
<AlertDialog
open={!!deleteTaskId}
diff --git a/apps/web/src/components/task/task-title.tsx b/apps/web/src/components/task/task-title.tsx
index ccd1c20a4..45466dd7c 100644
--- a/apps/web/src/components/task/task-title.tsx
+++ b/apps/web/src/components/task/task-title.tsx
@@ -7,14 +7,16 @@ import { useUpdateTaskTitle } from "@/hooks/mutations/task/use-update-task-title
import useGetTask from "@/hooks/queries/task/use-get-task";
import { useAutoGrowTextarea } from "@/hooks/use-auto-grow-textarea";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
+import { cn } from "@/lib/cn";
import debounce from "@/lib/debounce";
import { stripLineBreaks } from "@/lib/strip-line-breaks";
type TaskTitleProps = {
taskId: string;
+ size?: "md" | "lg";
};
-export default function TaskTitle({ taskId }: TaskTitleProps) {
+export default function TaskTitle({ taskId, size = "md" }: TaskTitleProps) {
const { t } = useTranslation();
const { data: task } = useGetTask(taskId);
const { mutateAsync: updateTaskTitle } = useUpdateTaskTitle();
@@ -96,7 +98,10 @@ export default function TaskTitle({ taskId }: TaskTitleProps) {
rows={1}
placeholder={t("tasks:detail.titlePlaceholder")}
readOnly={!canEdit}
- className="block h-auto w-full resize-none appearance-none overflow-hidden border-0 bg-transparent p-0 font-heading text-2xl leading-[1.15] font-semibold tracking-[-0.02em] text-foreground outline-none placeholder:text-foreground/45 sm:text-[2rem]"
+ className={cn(
+ "block h-auto w-full resize-none appearance-none overflow-hidden border-0 bg-transparent p-0 font-heading font-semibold text-2xl text-foreground leading-[1.25] tracking-[-0.02em] outline-none placeholder:text-foreground/45",
+ size === "lg" && "sm:text-[1.75rem] sm:leading-[1.2]",
+ )}
onKeyDown={(e) => {
// Titles are single-line; Enter commits instead of adding a break.
if (e.key === "Enter" && !e.nativeEvent.isComposing) {
diff --git a/apps/web/src/components/ui/shortcut-number.tsx b/apps/web/src/components/ui/shortcut-number.tsx
deleted file mode 100644
index 2216d761d..000000000
--- a/apps/web/src/components/ui/shortcut-number.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { cn } from "@/lib/cn";
-
-type ShortcutNumberProps = {
- number: number;
- className?: string;
-};
-
-export function ShortcutNumber({ number, className }: ShortcutNumberProps) {
- return (
- <span
- className={cn(
- "ml-auto text-[11px] font-medium text-muted-foreground/40",
- "select-none pointer-events-none",
- className,
- )}
- aria-hidden="true"
- >
- {number}
- </span>
- );
-}
diff --git a/apps/web/src/hooks/use-numbered-shortcuts.ts b/apps/web/src/hooks/use-numbered-shortcuts.ts
deleted file mode 100644
index 803170042..000000000
--- a/apps/web/src/hooks/use-numbered-shortcuts.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { useEffect } from "react";
-
-type NumberedShortcutOption = {
- onSelect: () => void;
-};
-
-export function useNumberedShortcuts(
- isOpen: boolean,
- options: NumberedShortcutOption[],
- maxNumbers = 9,
-) {
- useEffect(() => {
- if (!isOpen) return;
-
- const handleKeyDown = (e: KeyboardEvent) => {
- const target = e.target as HTMLElement;
- const isTypingInInput =
- target.tagName === "INPUT" ||
- target.tagName === "TEXTAREA" ||
- target.contentEditable === "true";
-
- if (isTypingInInput) return;
-
- const num = Number.parseInt(e.key, 10);
- const isValidNumber =
- !Number.isNaN(num) &&
- num >= 1 &&
- num <= Math.min(options.length, maxNumbers);
-
- if (isValidNumber) {
- e.preventDefault();
- e.stopPropagation();
- options[num - 1].onSelect();
- }
- };
-
- document.addEventListener("keydown", handleKeyDown, { capture: true });
-
- return () => {
- document.removeEventListener("keydown", handleKeyDown, { capture: true });
- };
- }, [isOpen, options, maxNumbers]);
-}
diff --git a/apps/web/src/hooks/use-task-copy-shortcuts.test.tsx b/apps/web/src/hooks/use-task-copy-shortcuts.test.tsx
deleted file mode 100644
index 01b0c752f..000000000
--- a/apps/web/src/hooks/use-task-copy-shortcuts.test.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { cleanup, fireEvent, renderHook } from "@testing-library/react";
-import { afterEach, describe, expect, it, vi } from "vite-plus/test";
-import { ShortcutTestWrapper } from "@/lib/shortcuts/shortcut-test-wrapper";
-import { useTaskCopyShortcuts } from "./use-task-copy-shortcuts";
-
-afterEach(cleanup);
-
-function renderCopyShortcuts(enabled: boolean) {
- const onCopyLink = vi.fn();
- const onCopyBranch = vi.fn();
- const view = renderHook(
- (props: { enabled: boolean }) =>
- useTaskCopyShortcuts({ ...props, onCopyLink, onCopyBranch }),
- { initialProps: { enabled }, wrapper: ShortcutTestWrapper },
- );
- return { ...view, onCopyLink, onCopyBranch };
-}
-
-describe("useTaskCopyShortcuts", () => {
- it("copies the link and branch with Ctrl+Shift+C and Ctrl+Shift+G", () => {
- const { onCopyLink, onCopyBranch } = renderCopyShortcuts(true);
-
- fireEvent.keyDown(document.body, {
- key: "<",
- code: "Comma",
- ctrlKey: true,
- shiftKey: true,
- });
- fireEvent.keyDown(document.body, {
- key: ">",
- code: "Period",
- ctrlKey: true,
- shiftKey: true,
- });
-
- expect(onCopyLink).toHaveBeenCalledOnce();
- expect(onCopyBranch).toHaveBeenCalledOnce();
- });
-
- it("stops copying once the view disables its shortcuts", () => {
- const { onCopyLink, onCopyBranch, rerender } = renderCopyShortcuts(true);
-
- rerender({ enabled: false });
- fireEvent.keyDown(document.body, {
- key: "<",
- code: "Comma",
- ctrlKey: true,
- shiftKey: true,
- });
- fireEvent.keyDown(document.body, {
- key: ">",
- code: "Period",
- ctrlKey: true,
- shiftKey: true,
- });
-
- expect(onCopyLink).not.toHaveBeenCalled();
- expect(onCopyBranch).not.toHaveBeenCalled();
- });
-
- it("settles and uses the latest handlers when callers pass new ones on every render", () => {
- const firstLink = vi.fn();
- const latestLink = vi.fn();
- let renders = 0;
- const { rerender } = renderHook(
- (props: { onCopyLink: () => void }) => {
- renders += 1;
- useTaskCopyShortcuts({
- enabled: true,
- onCopyLink: () => props.onCopyLink(),
- onCopyBranch: () => {},
- });
- },
- {
- initialProps: { onCopyLink: firstLink },
- wrapper: ShortcutTestWrapper,
- },
- );
-
- rerender({ onCopyLink: latestLink });
- fireEvent.keyDown(document.body, {
- key: "<",
- code: "Comma",
- ctrlKey: true,
- shiftKey: true,
- });
-
- expect(renders).toBeLessThan(10);
- expect(firstLink).not.toHaveBeenCalled();
- expect(latestLink).toHaveBeenCalledOnce();
- });
-});
diff --git a/apps/web/src/hooks/use-task-copy-shortcuts.ts b/apps/web/src/hooks/use-task-copy-shortcuts.ts
deleted file mode 100644
index 060ccfe25..000000000
--- a/apps/web/src/hooks/use-task-copy-shortcuts.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { useShortcut } from "@/lib/shortcuts/use-shortcut";
-
-type TaskCopyShortcutsOptions = {
- enabled: boolean;
- onCopyLink: () => void;
- onCopyBranch: () => void;
-};
-
-export function useTaskCopyShortcuts({
- enabled,
- onCopyLink,
- onCopyBranch,
-}: TaskCopyShortcutsOptions) {
- useShortcut("copyTaskUrl", onCopyLink, { enabled });
- useShortcut("copyBranchName", onCopyBranch, { enabled });
-}
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 d29b0c34a..d167ebf02 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
@@ -6,11 +6,13 @@ import TaskLayout from "@/components/common/task-layout";
import PageTitle from "@/components/page-title";
import TaskDeleteDialog from "@/components/task/task-delete-dialog";
import TaskDetailsContent from "@/components/task/task-details-content";
+import { TaskHeaderActions } from "@/components/task/header/task-header-actions";
+import { PropertiesRail } from "@/components/task/properties/properties-rail";
+import { PropertyChips } from "@/components/task/properties/property-chips";
import {
TaskDetailsSkeleton,
- TaskPropertiesSidebarSkeleton,
+ TaskPropertiesRailSkeleton,
} from "@/components/task/task-page-skeleton";
-import TaskPropertiesSidebar from "@/components/task/task-properties-sidebar";
import { AlertDialogCreateHandle } from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import useGetActivitiesByTaskId from "@/hooks/queries/activity/use-get-activities-by-task-id";
@@ -77,16 +79,25 @@ function RouteComponent() {
taskId={taskId}
projectId={projectId}
workspaceId={workspaceId}
- rightSidebar={
+ headerActions={
+ !isLoading && task ? (
+ <TaskHeaderActions
+ taskId={taskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ deleteHandle={deleteHandle}
+ />
+ ) : null
+ }
+ rail={
isLoading ? (
- <TaskPropertiesSidebarSkeleton className="h-full w-full lg:w-72 xl:w-80 flex flex-col gap-2" />
+ <TaskPropertiesRailSkeleton />
) : isTaskError || !task ? null : (
- <TaskPropertiesSidebar
+ <PropertiesRail
taskId={taskId}
projectId={projectId}
workspaceId={workspaceId}
- className="h-full w-full lg:w-72 xl:w-80 flex flex-col gap-2"
- deleteHandle={deleteHandle}
+ className="w-80 shrink-0"
/>
)
}
@@ -147,7 +158,16 @@ function RouteComponent() {
taskId={taskId}
projectId={projectId}
workspaceId={workspaceId}
- className="mx-auto flex h-full min-h-0 w-full max-w-3xl flex-col gap-2 px-3 pb-16 pt-3 sm:px-4 xl:pb-20 xl:pt-8"
+ variant="page"
+ className="mx-auto w-full max-w-2xl px-4 pt-6 pb-16 sm:px-6 xl:pt-12 xl:pb-20"
+ properties={
+ <PropertyChips
+ taskId={taskId}
+ projectId={projectId}
+ workspaceId={workspaceId}
+ className="pb-5 lg:hidden"
+ />
+ }
/>
)}
</TaskLayout>
diff --git a/i18n/az-AZ.json b/i18n/az-AZ.json
index dd981a230..47736b0e2 100644
--- a/i18n/az-AZ.json
+++ b/i18n/az-AZ.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Xüsusiyyətlər",
"labels": "Etiketlər",
+ "addLabels": "Etiket əlavə et",
"copyTaskLink": "Tapşırığın keçidini kopyala",
"copyTaskBranch": "Tapşırığın budağını kopyala",
"taskLinkCopied": "Tapşırıq keçidi kopyalandı",
"taskBranchCopied": "Branch adı kopyalandı",
"start": "Başlat",
"startDate": "Başlama tarixi",
- "noDate": "Tarix yoxdur"
+ "noDate": "Tarix yoxdur",
+ "dates": "Tarixlər",
+ "project": "Layihə"
},
"move": {
"title": "Tapşırığı köçür",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} məcburi sahə boşdur",
"saveError": "{{field}} saxlanılmadı",
"moreFields_one": "Daha {{count}} sahə",
- "moreFields_other": "Daha {{count}} sahə"
+ "moreFields_other": "Daha {{count}} sahə",
+ "manage": "Sahələri idarə et"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/de-DE.json b/i18n/de-DE.json
index 2aace2a87..66c8f3982 100644
--- a/i18n/de-DE.json
+++ b/i18n/de-DE.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Eigenschaften",
"labels": "Labels",
+ "addLabels": "Labels hinzufügen",
"copyTaskLink": "Aufgabenlink kopieren",
"copyTaskBranch": "Aufgaben-Branch kopieren",
"taskLinkCopied": "Aufgabenlink kopiert",
"taskBranchCopied": "Branch-Name kopiert",
"start": "Start",
"startDate": "Startdatum",
- "noDate": "Kein Datum"
+ "noDate": "Kein Datum",
+ "dates": "Termine",
+ "project": "Projekt"
},
"move": {
"title": "Aufgabe verschieben",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} Pflichtfelder sind leer",
"saveError": "{{field}} konnte nicht gespeichert werden",
"moreFields_one": "{{count}} weiteres Feld",
- "moreFields_other": "{{count}} weitere Felder"
+ "moreFields_other": "{{count}} weitere Felder",
+ "manage": "Felder verwalten"
},
"board": {
"reorderFailed": "Die Reihenfolge konnte nicht gespeichert werden.",
diff --git a/i18n/el-GR.json b/i18n/el-GR.json
index a87edb77d..fafac352b 100644
--- a/i18n/el-GR.json
+++ b/i18n/el-GR.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Ιδιότητες",
"labels": "Ετικέτες",
+ "addLabels": "Προσθήκη ετικετών",
"copyTaskLink": "Αντιγραφή συνδέσμου εργασίας",
"copyTaskBranch": "Αντιγραφή κλάδου εργασίας",
"taskLinkCopied": "Ο σύνδεσμος της εργασίας αντιγράφηκε",
"taskBranchCopied": "Το όνομα του branch αντιγράφηκε",
"start": "Έναρξη",
"startDate": "Ημερομηνία έναρξης",
- "noDate": "Χωρίς ημερομηνία"
+ "noDate": "Χωρίς ημερομηνία",
+ "dates": "Ημερομηνίες",
+ "project": "Έργο"
},
"move": {
"title": "Μετακίνηση εργασίας",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} υποχρεωτικά πεδία είναι κενά",
"saveError": "Δεν ήταν δυνατή η αποθήκευση του πεδίου {{field}}",
"moreFields_one": "{{count}} ακόμη πεδίο",
- "moreFields_other": "{{count}} ακόμη πεδία"
+ "moreFields_other": "{{count}} ακόμη πεδία",
+ "manage": "Διαχείριση πεδίων"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/en-US.json b/i18n/en-US.json
index 0342ce896..5db4333b1 100644
--- a/i18n/en-US.json
+++ b/i18n/en-US.json
@@ -2946,13 +2946,16 @@
"properties": {
"title": "Properties",
"labels": "Labels",
+ "addLabels": "Add labels",
"copyTaskLink": "Copy task link",
"copyTaskBranch": "Copy task branch",
"taskLinkCopied": "Copied task link",
"taskBranchCopied": "Copied branch name",
"start": "Start",
"startDate": "Start date",
- "noDate": "No date"
+ "noDate": "No date",
+ "dates": "Dates",
+ "project": "Project"
},
"move": {
"title": "Move task",
@@ -3222,7 +3225,8 @@
"missingRequired_other": "{{count}} required fields are empty",
"saveError": "Couldn't save {{field}}",
"moreFields_one": "{{count}} more field",
- "moreFields_other": "{{count}} more fields"
+ "moreFields_other": "{{count}} more fields",
+ "manage": "Manage fields"
},
"descriptionSearchLoading": "Searching full descriptions…",
"descriptionSearchError": "Description search failed. Results may be incomplete.",
diff --git a/i18n/es-ES.json b/i18n/es-ES.json
index e59ab3297..4c92f58cc 100644
--- a/i18n/es-ES.json
+++ b/i18n/es-ES.json
@@ -2992,13 +2992,16 @@
"properties": {
"title": "Propiedades",
"labels": "Etiquetas",
+ "addLabels": "Añadir etiquetas",
"copyTaskLink": "Copiar enlace a tarea",
"copyTaskBranch": "Copiar la rama de la tarea",
"taskLinkCopied": "Enlace de la tarea copiado",
"taskBranchCopied": "Nombre de la rama copiado",
"start": "Comenzar",
"startDate": "Fecha de inicio",
- "noDate": "Sin fecha"
+ "noDate": "Sin fecha",
+ "dates": "Fechas",
+ "project": "Proyecto"
},
"popover": {
"assignee": {
@@ -3279,7 +3282,8 @@
"saveError": "No se pudo guardar {{field}}",
"moreFields_one": "{{count}} campo más",
"moreFields_many": "{{count}} campos más",
- "moreFields_other": "{{count}} campos más"
+ "moreFields_other": "{{count}} campos más",
+ "manage": "Gestionar campos"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/fr-FR.json b/i18n/fr-FR.json
index 4c710ec2f..c27252906 100644
--- a/i18n/fr-FR.json
+++ b/i18n/fr-FR.json
@@ -2992,13 +2992,16 @@
"properties": {
"title": "Propriétés",
"labels": "Labels",
+ "addLabels": "Ajouter des étiquettes",
"copyTaskLink": "Copier le lien de la tâche",
"copyTaskBranch": "Copier la branche de la tâche",
"taskLinkCopied": "Lien de la tâche copié",
"taskBranchCopied": "Nom de la branche copié",
"start": "Début",
"startDate": "Date de début",
- "noDate": "Pas de date"
+ "noDate": "Pas de date",
+ "dates": "Dates",
+ "project": "Projet"
},
"move": {
"title": "Déplacer la tâche",
@@ -3279,7 +3282,8 @@
"saveError": "Impossible d'enregistrer {{field}}",
"moreFields_one": "{{count}} champ de plus",
"moreFields_many": "{{count}} champs de plus",
- "moreFields_other": "{{count}} champs de plus"
+ "moreFields_other": "{{count}} champs de plus",
+ "manage": "Gérer les champs"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/hi-IN.json b/i18n/hi-IN.json
index 43ecddcd8..5c5b9af3d 100644
--- a/i18n/hi-IN.json
+++ b/i18n/hi-IN.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "गुण",
"labels": "लेबल",
+ "addLabels": "लेबल जोड़ें",
"copyTaskLink": "कार्य लिंक कॉपी करें",
"copyTaskBranch": "कार्य शाखा कॉपी करें",
"taskLinkCopied": "कार्य का लिंक कॉपी किया गया",
"taskBranchCopied": "ब्रांच का नाम कॉपी किया गया",
"start": "शुरू",
"startDate": "शुरू की तारीख",
- "noDate": "कोई तारीख नहीं"
+ "noDate": "कोई तारीख नहीं",
+ "dates": "तारीखें",
+ "project": "प्रोजेक्ट"
},
"move": {
"title": "कार्य ले जाएँ",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} आवश्यक फ़ील्ड खाली हैं",
"saveError": "{{field}} सहेजा नहीं जा सका",
"moreFields_one": "{{count}} और फ़ील्ड",
- "moreFields_other": "{{count}} और फ़ील्ड"
+ "moreFields_other": "{{count}} और फ़ील्ड",
+ "manage": "फ़ील्ड प्रबंधित करें"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/id-ID.json b/i18n/id-ID.json
index ca0bc5692..c0e125032 100644
--- a/i18n/id-ID.json
+++ b/i18n/id-ID.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "Properti",
"labels": "Label",
+ "addLabels": "Tambahkan label",
"copyTaskLink": "Salin tautan tugas",
"copyTaskBranch": "Salin branch tugas",
"taskLinkCopied": "Tautan tugas disalin",
"taskBranchCopied": "Nama branch disalin",
"start": "Mulai",
"startDate": "Tanggal mulai",
- "noDate": "Tanpa tanggal"
+ "noDate": "Tanpa tanggal",
+ "dates": "Tanggal",
+ "project": "Proyek"
},
"move": {
"title": "Pindahkan tugas",
@@ -3175,7 +3178,8 @@
"noMatches": "Tidak ada opsi yang cocok",
"missingRequired_other": "{{count}} kolom wajib masih kosong",
"saveError": "Gagal menyimpan {{field}}",
- "moreFields_other": "{{count}} kolom lainnya"
+ "moreFields_other": "{{count}} kolom lainnya",
+ "manage": "Kelola kolom"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/it-IT.json b/i18n/it-IT.json
index f42247278..f069cb375 100644
--- a/i18n/it-IT.json
+++ b/i18n/it-IT.json
@@ -2992,13 +2992,16 @@
"properties": {
"title": "Proprietà",
"labels": "Etichette",
+ "addLabels": "Aggiungi etichette",
"copyTaskLink": "Copia link attività",
"copyTaskBranch": "Copia ramo attività",
"taskLinkCopied": "Link dell'attività copiato",
"taskBranchCopied": "Nome del branch copiato",
"start": "Inizio",
"startDate": "Data inizio",
- "noDate": "Nessuna data"
+ "noDate": "Nessuna data",
+ "dates": "Date",
+ "project": "Progetto"
},
"move": {
"title": "Sposta attività",
@@ -3279,7 +3282,8 @@
"saveError": "Impossibile salvare {{field}}",
"moreFields_one": "Altro {{count}} campo",
"moreFields_many": "Altri {{count}} campi",
- "moreFields_other": "Altri {{count}} campi"
+ "moreFields_other": "Altri {{count}} campi",
+ "manage": "Gestisci campi"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/ja-JP.json b/i18n/ja-JP.json
index fc6d2d777..e9bbdae65 100644
--- a/i18n/ja-JP.json
+++ b/i18n/ja-JP.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "プロパティ",
"labels": "ラベル",
+ "addLabels": "ラベルを追加",
"copyTaskLink": "タスクのリンクをコピー",
"copyTaskBranch": "タスクのブランチ名をコピー",
"taskLinkCopied": "タスクのリンクをコピーしました",
"taskBranchCopied": "ブランチ名をコピーしました",
"start": "開始",
"startDate": "開始日",
- "noDate": "日付なし"
+ "noDate": "日付なし",
+ "dates": "日付",
+ "project": "プロジェクト"
},
"move": {
"title": "タスクを移動",
@@ -3175,7 +3178,8 @@
"noMatches": "一致するオプションがありません",
"missingRequired_other": "必須フィールドが {{count}} 件未入力です",
"saveError": "{{field}}を保存できませんでした",
- "moreFields_other": "ほか {{count}} 件のフィールド"
+ "moreFields_other": "ほか {{count}} 件のフィールド",
+ "manage": "フィールドを管理"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/ko-KR.json b/i18n/ko-KR.json
index 9a361cf86..eb9f64203 100644
--- a/i18n/ko-KR.json
+++ b/i18n/ko-KR.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "속성",
"labels": "라벨",
+ "addLabels": "라벨 추가",
"copyTaskLink": "작업 링크 복사",
"copyTaskBranch": "작업 브랜치 복사",
"taskLinkCopied": "작업 링크를 복사했습니다",
"taskBranchCopied": "브랜치 이름을 복사했습니다",
"start": "시작",
"startDate": "시작일",
- "noDate": "날짜 없음"
+ "noDate": "날짜 없음",
+ "dates": "날짜",
+ "project": "프로젝트"
},
"move": {
"title": "작업 이동",
@@ -3175,7 +3178,8 @@
"noMatches": "일치하는 옵션이 없습니다",
"missingRequired_other": "필수 필드 {{count}}개가 비어 있습니다",
"saveError": "{{field}}을(를) 저장하지 못했습니다",
- "moreFields_other": "필드 {{count}}개 더 보기"
+ "moreFields_other": "필드 {{count}}개 더 보기",
+ "manage": "필드 관리"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/mk-MK.json b/i18n/mk-MK.json
index 3926474de..b47819bcf 100644
--- a/i18n/mk-MK.json
+++ b/i18n/mk-MK.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Својства",
"labels": "Етикети",
+ "addLabels": "Додај ознаки",
"copyTaskLink": "Копирај линк на задача",
"copyTaskBranch": "Копирај гранка на задача",
"taskLinkCopied": "Врската до задачата е копирана",
"taskBranchCopied": "Името на гранката е копирано",
"start": "Почеток",
"startDate": "Почетен датум",
- "noDate": "Без датум"
+ "noDate": "Без датум",
+ "dates": "Датуми",
+ "project": "Проект"
},
"move": {
"title": "Премести задача",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} задолжителни полиња се празни",
"saveError": "{{field}} не може да се зачува",
"moreFields_one": "Уште {{count}} поле",
- "moreFields_other": "Уште {{count}} полиња"
+ "moreFields_other": "Уште {{count}} полиња",
+ "manage": "Управувај со полиња"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/nl-NL.json b/i18n/nl-NL.json
index f40d32c1a..5cbf5d994 100644
--- a/i18n/nl-NL.json
+++ b/i18n/nl-NL.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Eigenschappen",
"labels": "Labels",
+ "addLabels": "Labels toevoegen",
"copyTaskLink": "Taaklink kopiëren",
"copyTaskBranch": "Taakbranch kopiëren",
"taskLinkCopied": "Taaklink gekopieerd",
"taskBranchCopied": "Branchnaam gekopieerd",
"start": "Start",
"startDate": "Startdatum",
- "noDate": "Geen datum"
+ "noDate": "Geen datum",
+ "dates": "Datums",
+ "project": "Project"
},
"popover": {
"assignee": {
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} verplichte velden zijn leeg",
"saveError": "{{field}} kon niet worden opgeslagen",
"moreFields_one": "Nog {{count}} veld",
- "moreFields_other": "Nog {{count}} velden"
+ "moreFields_other": "Nog {{count}} velden",
+ "manage": "Velden beheren"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/pl-PL.json b/i18n/pl-PL.json
index f4b4a7921..1d25b2740 100644
--- a/i18n/pl-PL.json
+++ b/i18n/pl-PL.json
@@ -3512,10 +3512,13 @@
"taskBranchCopied": "Skopiowano nazwę gałęzi",
"copyTaskLink": "Kopiuj link do zadania",
"labels": "Etykiety",
+ "addLabels": "Dodaj etykiety",
"noDate": "Brak daty",
"start": "Początek",
"startDate": "Data rozpoczęcia",
- "title": "Właściwości"
+ "title": "Właściwości",
+ "dates": "Daty",
+ "project": "Projekt"
},
"relations": {
"blocks": "Blokuje",
@@ -3613,7 +3616,8 @@
"moreFields_one": "Jeszcze {{count}} pole",
"moreFields_few": "Jeszcze {{count}} pola",
"moreFields_many": "Jeszcze {{count}} pól",
- "moreFields_other": "Jeszcze {{count}} pola"
+ "moreFields_other": "Jeszcze {{count}} pola",
+ "manage": "Zarządzaj polami"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/pt-BR.json b/i18n/pt-BR.json
index f7dd9525e..a289deda0 100644
--- a/i18n/pt-BR.json
+++ b/i18n/pt-BR.json
@@ -2992,13 +2992,16 @@
"properties": {
"title": "Propriedades",
"labels": "Etiquetas",
+ "addLabels": "Adicionar etiquetas",
"copyTaskLink": "Copiar link da tarefa",
"copyTaskBranch": "Copiar branch da tarefa",
"taskLinkCopied": "Link da tarefa copiado",
"taskBranchCopied": "Nome da branch copiado",
"start": "Início",
"startDate": "Data de início",
- "noDate": "Sem data"
+ "noDate": "Sem data",
+ "dates": "Datas",
+ "project": "Projeto"
},
"move": {
"title": "Mover tarefa",
@@ -3279,7 +3282,8 @@
"saveError": "Não foi possível salvar {{field}}",
"moreFields_one": "Mais {{count}} campo",
"moreFields_many": "Mais {{count}} campos",
- "moreFields_other": "Mais {{count}} campos"
+ "moreFields_other": "Mais {{count}} campos",
+ "manage": "Gerenciar campos"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/ru-RU.json b/i18n/ru-RU.json
index 5389e77eb..f1faed886 100644
--- a/i18n/ru-RU.json
+++ b/i18n/ru-RU.json
@@ -3047,13 +3047,16 @@
"properties": {
"title": "Свойства",
"labels": "Метки",
+ "addLabels": "Добавить метки",
"copyTaskLink": "Скопировать ссылку на задачу",
"copyTaskBranch": "Скопировать ветку задачи",
"taskLinkCopied": "Ссылка на задачу скопирована",
"taskBranchCopied": "Название ветки скопировано",
"start": "Начало",
"startDate": "Дата начала",
- "noDate": "Без даты"
+ "noDate": "Без даты",
+ "dates": "Даты",
+ "project": "Проект"
},
"move": {
"title": "Переместить задачу",
@@ -3383,7 +3386,8 @@
"moreFields_one": "Ещё {{count}} поле",
"moreFields_few": "Ещё {{count}} поля",
"moreFields_many": "Ещё {{count}} полей",
- "moreFields_other": "Ещё {{count}} поля"
+ "moreFields_other": "Ещё {{count}} поля",
+ "manage": "Управлять полями"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/tr-TR.json b/i18n/tr-TR.json
index 3f0443670..597b9e361 100644
--- a/i18n/tr-TR.json
+++ b/i18n/tr-TR.json
@@ -2945,13 +2945,16 @@
"properties": {
"title": "Özellikler",
"labels": "Etiketler",
+ "addLabels": "Etiket ekle",
"copyTaskLink": "Talep bağlantısını kopyala",
"copyTaskBranch": "Talep dalını kopyala",
"taskLinkCopied": "Görev bağlantısı kopyalandı",
"taskBranchCopied": "Branch adı kopyalandı",
"start": "Başlat",
"startDate": "Başlangıç tarihi",
- "noDate": "Tarih yok"
+ "noDate": "Tarih yok",
+ "dates": "Tarihler",
+ "project": "Proje"
},
"move": {
"title": "Talebi taşı",
@@ -3227,7 +3230,8 @@
"missingRequired_other": "{{count}} zorunlu alan boş",
"saveError": "{{field}} kaydedilemedi",
"moreFields_one": "{{count}} alan daha",
- "moreFields_other": "{{count}} alan daha"
+ "moreFields_other": "{{count}} alan daha",
+ "manage": "Alanları yönet"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/uk-UA.json b/i18n/uk-UA.json
index ab12e9810..7f4f45f37 100644
--- a/i18n/uk-UA.json
+++ b/i18n/uk-UA.json
@@ -3039,13 +3039,16 @@
"properties": {
"title": "Властивості",
"labels": "Мітки",
+ "addLabels": "Додати мітки",
"copyTaskLink": "Копіювати посилання на завдання",
"copyTaskBranch": "Копіювати гілку завдання",
"taskLinkCopied": "Посилання на завдання скопійовано",
"taskBranchCopied": "Назву гілки скопійовано",
"start": "Початок",
"startDate": "Дата початку",
- "noDate": "Немає дати"
+ "noDate": "Немає дати",
+ "dates": "Дати",
+ "project": "Проєкт"
},
"move": {
"title": "Перемістити завдання",
@@ -3331,7 +3334,8 @@
"moreFields_one": "Ще {{count}} поле",
"moreFields_few": "Ще {{count}} поля",
"moreFields_many": "Ще {{count}} полів",
- "moreFields_other": "Ще {{count}} поля"
+ "moreFields_other": "Ще {{count}} поля",
+ "manage": "Керувати полями"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/vi-VN.json b/i18n/vi-VN.json
index b58293834..3ea8b73bb 100644
--- a/i18n/vi-VN.json
+++ b/i18n/vi-VN.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "Thuộc tính",
"labels": "Nhãn",
+ "addLabels": "Thêm nhãn",
"copyTaskLink": "Sao chép liên kết công việc",
"copyTaskBranch": "Sao chép nhánh công việc",
"taskLinkCopied": "Đã sao chép liên kết công việc",
"taskBranchCopied": "Đã sao chép tên nhánh",
"start": "Bắt đầu",
"startDate": "Ngày bắt đầu",
- "noDate": "Không có ngày"
+ "noDate": "Không có ngày",
+ "dates": "Ngày",
+ "project": "Dự án"
},
"move": {
"title": "Di chuyển công việc",
@@ -3175,7 +3178,8 @@
"noMatches": "Không có tùy chọn phù hợp",
"missingRequired_other": "{{count}} trường bắt buộc còn trống",
"saveError": "Không thể lưu {{field}}",
- "moreFields_other": "Thêm {{count}} trường"
+ "moreFields_other": "Thêm {{count}} trường",
+ "manage": "Quản lý trường"
},
"board": {
"reorderFailed": "Could not move task. Please try again.",
diff --git a/i18n/zh-CN.json b/i18n/zh-CN.json
index ff61d51b8..334f64c9f 100644
--- a/i18n/zh-CN.json
+++ b/i18n/zh-CN.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "属性",
"labels": "标签",
+ "addLabels": "添加标签",
"copyTaskLink": "复制任务链接",
"copyTaskBranch": "复制任务分支",
"taskLinkCopied": "已复制任务链接",
"taskBranchCopied": "已复制分支名称",
"start": "开始",
"startDate": "开始日期",
- "noDate": "无日期"
+ "noDate": "无日期",
+ "dates": "日期",
+ "project": "项目"
},
"move": {
"title": "移动任务",
@@ -3175,7 +3178,8 @@
"noMatches": "没有匹配的选项",
"missingRequired_other": "有 {{count}} 个必填字段为空",
"saveError": "无法保存{{field}}",
- "moreFields_other": "另外 {{count}} 个字段"
+ "moreFields_other": "另外 {{count}} 个字段",
+ "manage": "管理字段"
},
"board": {
"reorderFailed": "无法移动任务,请重试。",
diff --git a/i18n/zh-TW.json b/i18n/zh-TW.json
index f7301ff3a..be8b4f3d4 100644
--- a/i18n/zh-TW.json
+++ b/i18n/zh-TW.json
@@ -2898,13 +2898,16 @@
"properties": {
"title": "屬性",
"labels": "標籤",
+ "addLabels": "新增標籤",
"copyTaskLink": "複製任務連結",
"copyTaskBranch": "複製任務分支",
"taskLinkCopied": "已複製任務連結",
"taskBranchCopied": "已複製分支名稱",
"start": "開始",
"startDate": "開始日期",
- "noDate": "無日期"
+ "noDate": "無日期",
+ "dates": "日期",
+ "project": "專案"
},
"move": {
"title": "移動任務",
@@ -3175,7 +3178,8 @@
"noMatches": "沒有符合的選項",
"missingRequired_other": "有 {{count}} 個必填欄位是空的",
"saveError": "無法儲存{{field}}",
- "moreFields_other": "另外 {{count}} 個欄位"
+ "moreFields_other": "另外 {{count}} 個欄位",
+ "manage": "管理欄位"
},
"board": {
"reorderFailed": "無法移動任務,請再試一次。",