diff --git a/ui/src/components/IssueProperties.tsx b/ui/src/components/IssueProperties.tsx index 1074a1be..299de898 100644 --- a/ui/src/components/IssueProperties.tsx +++ b/ui/src/components/IssueProperties.tsx @@ -3,6 +3,7 @@ import { Link } from "react-router-dom"; import type { Issue } from "@paperclip/shared"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { agentsApi } from "../api/agents"; +import { authApi } from "../api/auth"; import { issuesApi } from "../api/issues"; import { projectsApi } from "../api/projects"; import { useCompany } from "../context/CompanyContext"; @@ -107,6 +108,12 @@ export function IssueProperties({ issue, onUpdate, inline }: IssuePropertiesProp const [newLabelName, setNewLabelName] = useState(""); const [newLabelColor, setNewLabelColor] = useState("#6366f1"); + const { data: session } = useQuery({ + queryKey: queryKeys.auth.session, + queryFn: () => authApi.getSession(), + }); + const currentUserId = session?.user?.id ?? session?.session?.userId; + const { data: agents } = useQuery({ queryKey: queryKeys.agents.list(companyId!), queryFn: () => agentsApi.list(companyId!), @@ -166,6 +173,16 @@ export function IssueProperties({ issue, onUpdate, inline }: IssuePropertiesProp const assignee = issue.assigneeAgentId ? agents?.find((a) => a.id === issue.assigneeAgentId) : null; + const userLabel = (userId: string | null | undefined) => + userId + ? userId === "local-board" + ? "Board" + : currentUserId && userId === currentUserId + ? "Me" + : userId.slice(0, 5) + : null; + const assigneeUserLabel = userLabel(issue.assigneeUserId); + const creatorUserLabel = userLabel(issue.createdByUserId); const labelsTrigger = (issue.labels ?? []).length > 0 ? (