Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

refactor(ui): comprehensive UI craft review — sidebar, headers, detail panels (#1087)

Naiyuan Qingc38af55a8e45
diff --git a/packages/ui/components/ui/sidebar.tsx b/packages/ui/components/ui/sidebar.tsx
index e4b64762e4..a40e263dc1 100644
--- a/packages/ui/components/ui/sidebar.tsx
+++ b/packages/ui/components/ui/sidebar.tsx
@@ -353,7 +353,7 @@ function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
<main
data-slot="sidebar-inset"
className={cn(
- "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
+ "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
className
)}
{...props}
diff --git a/packages/ui/components/ui/tooltip.tsx b/packages/ui/components/ui/tooltip.tsx
index 588cb8681f..a6d020e145 100644
--- a/packages/ui/components/ui/tooltip.tsx
+++ b/packages/ui/components/ui/tooltip.tsx
@@ -5,7 +5,7 @@ import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
import { cn } from "@multica/ui/lib/utils"
function TooltipProvider({
- delay = 0,
+ delay = 200,
...props
}: TooltipPrimitive.Provider.Props) {
return (
@@ -50,13 +50,12 @@ function TooltipContent({
<TooltipPrimitive.Popup
data-slot="tooltip-content"
className={cn(
- "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-lg border border-border bg-popover px-2.5 py-1 text-xs text-popover-foreground has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
className
)}
{...props}
>
{children}
- <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
</TooltipPrimitive.Popup>
</TooltipPrimitive.Positioner>
</TooltipPrimitive.Portal>
diff --git a/packages/ui/styles/tokens.css b/packages/ui/styles/tokens.css
index 67d09fe858..a0804490ce 100644
--- a/packages/ui/styles/tokens.css
+++ b/packages/ui/styles/tokens.css
@@ -27,7 +27,6 @@
--color-brand: var(--brand);
--color-brand-foreground: var(--brand-foreground);
--color-priority: var(--priority);
- --color-canvas: var(--canvas);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
@@ -86,7 +85,6 @@
--sidebar-ring: oklch(0.705 0.015 286.067);
--brand: oklch(0.55 0.16 255);
--brand-foreground: oklch(0.985 0 0);
- --canvas: oklch(0.95 0.002 286);
--success: oklch(0.55 0.16 145);
--warning: oklch(0.75 0.16 85);
--info: oklch(0.55 0.18 250);
@@ -130,7 +128,6 @@
--sidebar-ring: oklch(0.552 0.016 285.938);
--brand: oklch(0.65 0.16 255);
--brand-foreground: oklch(0.985 0 0);
- --canvas: oklch(0.2 0.005 286);
--success: oklch(0.65 0.15 145);
--warning: oklch(0.70 0.16 85);
--info: oklch(0.65 0.18 250);
diff --git a/packages/views/agents/components/agents-page.tsx b/packages/views/agents/components/agents-page.tsx
index 28be4cc1cf..d1665cce2c 100644
--- a/packages/views/agents/components/agents-page.tsx
+++ b/packages/views/agents/components/agents-page.tsx
@@ -18,6 +18,7 @@ import { runtimeListOptions } from "@multica/core/runtimes/queries";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useWorkspaceId } from "@multica/core/hooks";
import { agentListOptions, memberListOptions, workspaceKeys } from "@multica/core/workspace/queries";
+import { PageHeader } from "../../layout/page-header";
import { CreateAgentDialog } from "./create-agent-dialog";
import { AgentListItem } from "./agent-list-item";
import { AgentDetail } from "./agent-detail";
@@ -140,28 +141,28 @@ export function AgentsPage() {
<ResizablePanel id="list" defaultSize={280} minSize={240} maxSize={400} groupResizeBehavior="preserve-pixel-size">
{/* Left column — agent list */}
<div className="overflow-y-auto h-full border-r">
- <div className="flex h-12 items-center justify-between border-b px-4">
+ <PageHeader className="justify-between">
<h1 className="text-sm font-semibold">Agents</h1>
<div className="flex items-center gap-1">
{archivedCount > 0 && (
<Button
variant={showArchived ? "secondary" : "ghost"}
- size="icon-xs"
+ size="icon-sm"
onClick={() => setShowArchived(!showArchived)}
title={showArchived ? "Show active agents" : "Show archived agents"}
>
- <Archive className="h-4 w-4 text-muted-foreground" />
+ <Archive className="text-muted-foreground" />
</Button>
)}
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={() => setShowCreate(true)}
>
- <Plus className="h-4 w-4 text-muted-foreground" />
+ <Plus className="text-muted-foreground" />
</Button>
</div>
- </div>
+ </PageHeader>
{filteredAgents.length === 0 ? (
<div className="flex flex-col items-center justify-center px-4 py-12">
<Bot className="h-8 w-8 text-muted-foreground/40" />
diff --git a/packages/views/agents/components/tabs/skills-tab.tsx b/packages/views/agents/components/tabs/skills-tab.tsx
index def6b4011c..af41e53428 100644
--- a/packages/views/agents/components/tabs/skills-tab.tsx
+++ b/packages/views/agents/components/tabs/skills-tab.tsx
@@ -125,7 +125,7 @@ export function SkillsTab({
</div>
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={() => handleRemove(skill.id)}
disabled={saving}
className="text-muted-foreground hover:text-destructive"
diff --git a/packages/views/autopilots/components/autopilot-detail-page.tsx b/packages/views/autopilots/components/autopilot-detail-page.tsx
index d107eed3bc..4cce1bc5a3 100644
--- a/packages/views/autopilots/components/autopilot-detail-page.tsx
+++ b/packages/views/autopilots/components/autopilot-detail-page.tsx
@@ -15,6 +15,7 @@ import { agentListOptions } from "@multica/core/workspace/queries";
import { useWorkspaceId } from "@multica/core/hooks";
import { useActorName } from "@multica/core/workspace/hooks";
import { useNavigation, AppLink } from "../../navigation";
+import { PageHeader } from "../../layout/page-header";
import { ActorAvatar } from "../../common/actor-avatar";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { Button } from "@multica/ui/components/ui/button";
@@ -414,7 +415,7 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
return (
<div className="flex h-full flex-col">
{/* Header */}
- <div className="flex h-12 shrink-0 items-center justify-between border-b px-5">
+ <PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<AppLink href="/autopilots" className="text-muted-foreground hover:text-foreground transition-colors">
<Zap className="h-4 w-4" />
@@ -447,7 +448,7 @@ export function AutopilotDetailPage({ autopilotId }: { autopilotId: string }) {
{triggerAutopilot.isPending ? "Running..." : "Run now"}
</Button>
</div>
- </div>
+ </PageHeader>
<div className="flex-1 overflow-y-auto">
<div className="max-w-4xl mx-auto p-6 space-y-8">
diff --git a/packages/views/autopilots/components/autopilots-page.tsx b/packages/views/autopilots/components/autopilots-page.tsx
index b098cdfee3..71ae286df9 100644
--- a/packages/views/autopilots/components/autopilots-page.tsx
+++ b/packages/views/autopilots/components/autopilots-page.tsx
@@ -10,6 +10,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { useActorName } from "@multica/core/workspace/hooks";
import { AppLink } from "../../navigation";
import { ActorAvatar } from "../../common/actor-avatar";
+import { PageHeader } from "../../layout/page-header";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { Button } from "@multica/ui/components/ui/button";
import { cn } from "@multica/ui/lib/utils";
@@ -346,7 +347,7 @@ export function AutopilotsPage() {
return (
<div className="flex h-full flex-col">
{/* Header */}
- <div className="flex h-12 shrink-0 items-center justify-between border-b px-5">
+ <PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<Zap className="h-4 w-4 text-muted-foreground" />
<h1 className="text-sm font-medium">Autopilot</h1>
@@ -358,7 +359,7 @@ export function AutopilotsPage() {
<Plus className="h-3.5 w-3.5 mr-1" />
New autopilot
</Button>
- </div>
+ </PageHeader>
{/* Table */}
<div className="flex-1 overflow-y-auto">
diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsx
index 9d923d56f9..9dd6251905 100644
--- a/packages/views/inbox/components/inbox-page.tsx
+++ b/packages/views/inbox/components/inbox-page.tsx
@@ -44,6 +44,7 @@ import {
DropdownMenuSeparator,
} from "@multica/ui/components/ui/dropdown-menu";
import { useIsMobile } from "@multica/ui/hooks/use-mobile";
+import { PageHeader } from "../../layout/page-header";
import { InboxListItem, timeAgo } from "./inbox-list-item";
import { typeLabels } from "./inbox-detail-label";
@@ -133,7 +134,7 @@ export function InboxPage() {
// -- Shared sub-components --------------------------------------------------
const listHeader = (
- <div className="flex h-12 shrink-0 items-center justify-between border-b px-4">
+ <PageHeader className="justify-between">
<div className="flex items-center gap-2">
<h1 className="text-sm font-semibold">Inbox</h1>
{unreadCount > 0 && (
@@ -147,7 +148,7 @@ export function InboxPage() {
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
className="text-muted-foreground"
/>
}
@@ -174,7 +175,7 @@ export function InboxPage() {
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
- </div>
+ </PageHeader>
);
const listBody = items.length === 0 ? (
diff --git a/packages/views/issues/components/comment-card.tsx b/packages/views/issues/components/comment-card.tsx
index 03cc44d773..8adb13cc5a 100644
--- a/packages/views/issues/components/comment-card.tsx
+++ b/packages/views/issues/components/comment-card.tsx
@@ -223,7 +223,7 @@ function CommentRow({
<DropdownMenu>
<DropdownMenuTrigger
render={
- <Button variant="ghost" size="icon-xs" className="text-muted-foreground">
+ <Button variant="ghost" size="icon-sm" className="text-muted-foreground">
<MoreHorizontal className="h-4 w-4" />
</Button>
}
@@ -434,7 +434,7 @@ function CommentCard({
<DropdownMenu>
<DropdownMenuTrigger
render={
- <Button variant="ghost" size="icon-xs" className="text-muted-foreground">
+ <Button variant="ghost" size="icon-sm" className="text-muted-foreground">
<MoreHorizontal className="h-4 w-4" />
</Button>
}
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index 20a73b18a9..a95899f787 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -21,6 +21,7 @@ import {
UserMinus,
Users,
} from "lucide-react";
+import { PageHeader } from "../../layout/page-header";
import { toast } from "sonner";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import {
@@ -45,6 +46,8 @@ import {
DropdownMenuSubContent,
} from "@multica/ui/components/ui/dropdown-menu";
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@multica/ui/components/ui/resizable";
+import { Sheet, SheetContent } from "@multica/ui/components/ui/sheet";
+import { useIsMobile } from "@multica/ui/hooks/use-mobile";
import { ContentEditor, type ContentEditorRef, TitleEditor, useFileDropZone, FileDropOverlay } from "../../editor";
import { FileUploadButton } from "@multica/ui/components/common/file-upload-button";
import {
@@ -333,21 +336,28 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
const { data: agents = [] } = useQuery(agentListOptions(wsId));
const currentMemberRole = members.find((m) => m.user_id === user?.id)?.role;
const { data: allIssues = [] } = useQuery(issueListOptions(wsId));
- const currentIndex = allIssues.findIndex((i) => i.id === id);
- const prevIssue = currentIndex > 0 ? allIssues[currentIndex - 1] : null;
- const nextIssue = currentIndex < allIssues.length - 1 ? allIssues[currentIndex + 1] : null;
const { getActorName } = useActorName();
const { uploadWithToast } = useFileUpload(api);
const { defaultLayout, onLayoutChanged } = useDefaultLayout({
id: layoutId,
});
const sidebarRef = usePanelRef();
+ const isMobile = useIsMobile();
const [sidebarOpen, setSidebarOpen] = useState(defaultSidebarOpen);
+
+ useEffect(() => {
+ if (isMobile) {
+ setSidebarOpen(false);
+ sidebarRef.current?.collapse();
+ }
+ }, [isMobile]);
const [deleting, setDeleting] = useState(false);
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [backlogHintOpen, setBacklogHintOpen] = useState(false);
const [propertiesOpen, setPropertiesOpen] = useState(true);
const [detailsOpen, setDetailsOpen] = useState(true);
+ const [parentIssueOpen, setParentIssueOpen] = useState(true);
+ const [tokenUsageOpen, setTokenUsageOpen] = useState(true);
const scrollContainerRef = useRef<HTMLDivElement>(null);
const [highlightedId, setHighlightedId] = useState<string | null>(null);
const didHighlightRef = useRef<string | null>(null);
@@ -550,89 +560,143 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
);
}
+ const sidebarContent = (
+ <div className="space-y-5">
+ {/* Properties */}
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setPropertiesOpen(!propertiesOpen)}
+ >
+ Properties
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
+ </button>
+ {propertiesOpen && <div className="space-y-0.5 pl-2">
+ <PropRow label="Status">
+ <StatusPicker status={issue.status} onUpdate={handleUpdateField} align="start" />
+ </PropRow>
+ <PropRow label="Priority">
+ <PriorityPicker priority={issue.priority} onUpdate={handleUpdateField} align="start" />
+ </PropRow>
+ <PropRow label="Assignee">
+ <AssigneePicker assigneeType={issue.assignee_type} assigneeId={issue.assignee_id} onUpdate={handleUpdateField} align="start" />
+ </PropRow>
+ <PropRow label="Due date">
+ <DueDatePicker dueDate={issue.due_date} onUpdate={handleUpdateField} />
+ </PropRow>
+ <PropRow label="Project">
+ <ProjectPicker projectId={issue.project_id} onUpdate={handleUpdateField} />
+ </PropRow>
+ </div>}
+ </div>
+
+ {/* Parent issue */}
+ {parentIssue && (
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${parentIssueOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setParentIssueOpen(!parentIssueOpen)}
+ >
+ Parent issue
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${parentIssueOpen ? "rotate-90" : ""}`} />
+ </button>
+ {parentIssueOpen && <div className="pl-2">
+ <AppLink
+ href={`/issues/${parentIssue.id}`}
+ className="flex items-center gap-1.5 rounded-md px-2 py-1.5 -mx-2 text-xs hover:bg-accent/50 transition-colors group"
+ >
+ <StatusIcon status={parentIssue.status} className="h-3.5 w-3.5 shrink-0" />
+ <span className="text-muted-foreground shrink-0">{parentIssue.identifier}</span>
+ <span className="truncate group-hover:text-foreground">{parentIssue.title}</span>
+ </AppLink>
+ </div>}
+ </div>
+ )}
+
+ {/* Details */}
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${detailsOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setDetailsOpen(!detailsOpen)}
+ >
+ Details
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${detailsOpen ? "rotate-90" : ""}`} />
+ </button>
+ {detailsOpen && <div className="space-y-0.5 pl-2">
+ <PropRow label="Created by">
+ <ActorAvatar actorType={issue.creator_type} actorId={issue.creator_id} size={18} />
+ <span className="truncate">{getActorName(issue.creator_type, issue.creator_id)}</span>
+ </PropRow>
+ <PropRow label="Created">
+ <span className="text-muted-foreground">{shortDate(issue.created_at)}</span>
+ </PropRow>
+ <PropRow label="Updated">
+ <span className="text-muted-foreground">{shortDate(issue.updated_at)}</span>
+ </PropRow>
+ </div>}
+ </div>
+
+ {/* Token usage */}
+ {usage && usage.task_count > 0 && (
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${tokenUsageOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setTokenUsageOpen(!tokenUsageOpen)}
+ >
+ Token usage
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${tokenUsageOpen ? "rotate-90" : ""}`} />
+ </button>
+ {tokenUsageOpen && <div className="space-y-0.5 pl-2">
+ <PropRow label="Input">
+ <span className="text-muted-foreground">{formatTokenCount(usage.total_input_tokens)}</span>
+ </PropRow>
+ <PropRow label="Output">
+ <span className="text-muted-foreground">{formatTokenCount(usage.total_output_tokens)}</span>
+ </PropRow>
+ {(usage.total_cache_read_tokens > 0 || usage.total_cache_write_tokens > 0) && (
+ <PropRow label="Cache">
+ <span className="text-muted-foreground">
+ {formatTokenCount(usage.total_cache_read_tokens)} read / {formatTokenCount(usage.total_cache_write_tokens)} write
+ </span>
+ </PropRow>
+ )}
+ <PropRow label="Runs">
+ <span className="text-muted-foreground">{usage.task_count}</span>
+ </PropRow>
+ </div>}
+ </div>
+ )}
+ </div>
+ );
+
return (
<ResizablePanelGroup orientation="horizontal" className="flex-1 min-h-0" defaultLayout={defaultLayout} onLayoutChanged={onLayoutChanged}>
<ResizablePanel id="content" minSize="50%">
- {/* LEFT: Content area */}
<div className="flex h-full flex-col">
- {/* Header bar */}
- <div className="flex h-12 shrink-0 items-center justify-between border-b bg-background px-4 text-sm">
- <div className="flex items-center gap-1.5 min-w-0">
+ <PageHeader className="gap-2 bg-background text-sm">
+ <div className="flex flex-1 items-center gap-1.5 min-w-0">
{workspace && (
<>
<AppLink
href="/issues"
- className="text-muted-foreground hover:text-foreground transition-colors truncate shrink-0"
+ className="text-muted-foreground hover:text-foreground transition-colors shrink-0"
>
{workspace.name}
</AppLink>
<ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
</>
)}
- {parentIssue && (
- <>
- <AppLink
- href={`/issues/${parentIssue.id}`}
- className="text-muted-foreground hover:text-foreground transition-colors truncate shrink-0"
- >
- {parentIssue.identifier}
- </AppLink>
- <ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
- </>
- )}
- <span className="truncate text-muted-foreground">
+ <span className="shrink-0">
{issue.identifier}
</span>
- <ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
- <span className="truncate">{issue.title}</span>
</div>
<div className="flex items-center gap-1 shrink-0">
- {/* Issue navigation */}
- {allIssues.length > 1 && (
- <div className="flex items-center gap-0.5 mr-1">
- <Tooltip>
- <TooltipTrigger
- render={
- <Button
- variant="ghost"
- size="icon-xs"
- className="text-muted-foreground"
- disabled={!prevIssue}
- onClick={() => prevIssue && router.push(`/issues/${prevIssue.id}`)}
- >
- <ChevronLeft className="h-4 w-4" />
- </Button>
- }
- />
- <TooltipContent side="bottom">Previous issue</TooltipContent>
- </Tooltip>
- <span className="text-xs text-muted-foreground tabular-nums px-0.5">
- {currentIndex >= 0 ? currentIndex + 1 : "?"} / {allIssues.length}
- </span>
- <Tooltip>
- <TooltipTrigger
- render={
- <Button
- variant="ghost"
- size="icon-xs"
- className="text-muted-foreground"
- disabled={!nextIssue}
- onClick={() => nextIssue && router.push(`/issues/${nextIssue.id}`)}
- >
- <ChevronRight className="h-4 w-4" />
- </Button>
- }
- />
- <TooltipContent side="bottom">Next issue</TooltipContent>
- </Tooltip>
- </div>
- )}
<Tooltip>
<TooltipTrigger
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
className={cn("text-muted-foreground", isPinned && "text-foreground")}
onClick={() => {
if (isPinned) {
@@ -651,8 +715,8 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
<DropdownMenu>
<DropdownMenuTrigger
render={
- <Button variant="ghost" size="icon-xs" className="text-muted-foreground">
- <MoreHorizontal className="h-4 w-4" />
+ <Button variant="ghost" size="icon-sm" className="text-muted-foreground">
+ <MoreHorizontal />
</Button>
}
/>
@@ -835,22 +899,27 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
render={
<Button
variant={sidebarOpen ? "secondary" : "ghost"}
- size="icon-xs"
+ size="icon-sm"
className={sidebarOpen ? "" : "text-muted-foreground"}
onClick={() => {
- const panel = sidebarRef.current;
- if (!panel) return;
- if (panel.isCollapsed()) panel.expand();
- else panel.collapse();
+ if (isMobile) {
+ setSidebarOpen(!sidebarOpen);
+ } else {
+ const panel = sidebarRef.current;
+ if (!panel) return;
+ if (panel.isCollapsed()) panel.expand();
+ else panel.collapse();
+ }
}}
>
- <PanelRight className="h-4 w-4" />
+ <PanelRight />
</Button>
}
/>
<TooltipContent side="bottom">Toggle sidebar</TooltipContent>
</Tooltip>
</div>
+ </PageHeader>
{/* Delete confirmation dialog (controlled by state) */}
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
@@ -917,7 +986,6 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
toast.success(`Added ${selected.identifier} as sub-issue`);
}}
/>
- </div>
{/* Content — scrollable */}
<div ref={scrollContainerRef} className="relative flex-1 overflow-y-auto">
@@ -1354,7 +1422,8 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
</div>
</div>
</ResizablePanel>
- <ResizableHandle />
+ {!isMobile && <ResizableHandle />}
+ {!isMobile && (
<ResizablePanel
id="sidebar"
defaultSize={defaultSidebarOpen ? 320 : 0}
@@ -1365,145 +1434,20 @@ export function IssueDetail({ issueId, onDelete, defaultSidebarOpen = true, layo
panelRef={sidebarRef}
onResize={(size) => setSidebarOpen(size.inPixels > 0)}
>
- {/* RIGHT: Properties sidebar */}
<div className="overflow-y-auto border-l h-full">
- <div className="p-4 space-y-5">
- {/* Properties section */}
- <div>
- <button
- className={`flex w-full items-center gap-1 text-xs font-medium transition-colors mb-2 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
- onClick={() => setPropertiesOpen(!propertiesOpen)}
- >
- <ChevronRight className={`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
- Properties
- </button>
-
- {propertiesOpen && <div className="space-y-0.5 pl-2">
- {/* Status */}
- <PropRow label="Status">
- <StatusPicker
- status={issue.status}
- onUpdate={handleUpdateField}
- align="start"
- />
- </PropRow>
-
- {/* Priority */}
- <PropRow label="Priority">
- <PriorityPicker
- priority={issue.priority}
- onUpdate={handleUpdateField}
- align="start"
- />
- </PropRow>
-
- {/* Assignee */}
- <PropRow label="Assignee">
- <AssigneePicker
- assigneeType={issue.assignee_type}
- assigneeId={issue.assignee_id}
- onUpdate={handleUpdateField}
- align="start"
- />
- </PropRow>
-
- {/* Due date */}
- <PropRow label="Due date">
- <DueDatePicker
- dueDate={issue.due_date}
- onUpdate={handleUpdateField}
- />
- </PropRow>
-
- {/* Project */}
- <PropRow label="Project">
- <ProjectPicker
- projectId={issue.project_id}
- onUpdate={handleUpdateField}
- />
- </PropRow>
- </div>}
- </div>
-
- {/* Parent issue */}
- {parentIssue && (
- <div>
- <div className="text-xs font-medium mb-2 flex items-center gap-1">
- <ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground rotate-90" />
- Parent issue
- </div>
- <div className="pl-2">
- <AppLink
- href={`/issues/${parentIssue.id}`}
- className="flex items-center gap-1.5 rounded-md px-2 py-1.5 -mx-2 text-xs hover:bg-accent/50 transition-colors group"
- >
- <StatusIcon status={parentIssue.status} className="h-3.5 w-3.5 shrink-0" />
- <span className="text-muted-foreground shrink-0">{parentIssue.identifier}</span>
- <span className="truncate group-hover:text-foreground">{parentIssue.title}</span>
- </AppLink>
- </div>
- </div>
- )}
-
- {/* Details section */}
- <div>
- <button
- className={`flex w-full items-center gap-1 text-xs font-medium transition-colors mb-2 ${detailsOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
- onClick={() => setDetailsOpen(!detailsOpen)}
- >
- <ChevronRight className={`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${detailsOpen ? "rotate-90" : ""}`} />
- Details
- </button>
-
- {detailsOpen && <div className="space-y-0.5 pl-2">
- <PropRow label="Created by">
- <ActorAvatar
- actorType={issue.creator_type}
- actorId={issue.creator_id}
- size={18}
- />
- <span className="truncate">{getActorName(issue.creator_type, issue.creator_id)}</span>
- </PropRow>
- <PropRow label="Created">
- <span className="text-muted-foreground">{shortDate(issue.created_at)}</span>
- </PropRow>
- <PropRow label="Updated">
- <span className="text-muted-foreground">{shortDate(issue.updated_at)}</span>
- </PropRow>
- </div>}
- </div>
-
- {/* Token usage */}
- {usage && usage.task_count > 0 && (
- <div>
- <div className="text-xs font-medium mb-2 flex items-center gap-1">
- <ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground rotate-90" />
- Token usage
- </div>
- <div className="space-y-0.5 pl-2">
- <PropRow label="Input">
- <span className="text-muted-foreground">{formatTokenCount(usage.total_input_tokens)}</span>
- </PropRow>
- <PropRow label="Output">
- <span className="text-muted-foreground">{formatTokenCount(usage.total_output_tokens)}</span>
- </PropRow>
- {(usage.total_cache_read_tokens > 0 || usage.total_cache_write_tokens > 0) && (
- <PropRow label="Cache">
- <span className="text-muted-foreground">
- {formatTokenCount(usage.total_cache_read_tokens)} read / {formatTokenCount(usage.total_cache_write_tokens)} write
- </span>
- </PropRow>
- )}
- <PropRow label="Runs">
- <span className="text-muted-foreground">{usage.task_count}</span>
- </PropRow>
- </div>
- </div>
- )}
-
+ <div className="p-4">
+ {sidebarContent}
</div>
</div>
</ResizablePanel>
+ )}
+ {isMobile && (
+ <Sheet open={sidebarOpen} onOpenChange={setSidebarOpen}>
+ <SheetContent side="right" showCloseButton={false} className="w-[320px] overflow-y-auto p-4">
+ {sidebarContent}
+ </SheetContent>
+ </Sheet>
+ )}
</ResizablePanelGroup>
);
}
diff --git a/packages/views/issues/components/issues-page.tsx b/packages/views/issues/components/issues-page.tsx
index 12b0118182..38d03bf6c7 100644
--- a/packages/views/issues/components/issues-page.tsx
+++ b/packages/views/issues/components/issues-page.tsx
@@ -17,6 +17,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { issueListOptions, childIssueProgressOptions } from "@multica/core/issues/queries";
import { useUpdateIssue } from "@multica/core/issues/mutations";
import { useIssueSelectionStore } from "@multica/core/issues/stores/selection-store";
+import { PageHeader } from "../../layout/page-header";
import { IssuesHeader } from "./issues-header";
import { BoardView } from "./board-view";
import { ListView } from "./list-view";
@@ -123,14 +124,14 @@ export function IssuesPage() {
return (
<div className="flex flex-1 min-h-0 flex-col">
{/* Header 1: Workspace breadcrumb */}
- <div className="flex h-12 shrink-0 items-center gap-1.5 border-b px-4">
+ <PageHeader className="gap-1.5">
<WorkspaceAvatar name={workspace?.name ?? "W"} size="sm" />
<span className="text-sm text-muted-foreground">
{workspace?.name ?? "Workspace"}
</span>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
<span className="text-sm font-medium">Issues</span>
- </div>
+ </PageHeader>
<ViewStoreProvider store={useIssueViewStore}>
{/* Header 2: Scope tabs + filters */}
diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsx
index e7381fff2f..0059bb361a 100644
--- a/packages/views/layout/app-sidebar.tsx
+++ b/packages/views/layout/app-sidebar.tsx
@@ -19,6 +19,7 @@ import {
Bot,
Monitor,
ChevronDown,
+ ChevronRight,
Settings,
LogOut,
Plus,
@@ -27,11 +28,15 @@ import {
SquarePen,
CircleUser,
FolderKanban,
- PinOff,
+ X,
Zap,
} from "lucide-react";
import { WorkspaceAvatar } from "../workspace/workspace-avatar";
import { ActorAvatar } from "@multica/ui/components/common/actor-avatar";
+import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
+import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@multica/ui/components/ui/collapsible";
+import { StatusIcon } from "../issues/components/status-icon";
+import type { IssueStatus } from "@multica/core/types";
import { useIssueDraftStore } from "@multica/core/issues/stores/draft-store";
import {
Sidebar,
@@ -43,7 +48,6 @@ import {
SidebarFooter,
SidebarMenu,
SidebarMenuButton,
- SidebarMenuAction,
SidebarMenuItem,
SidebarRail,
} from "@multica/ui/components/ui/sidebar";
@@ -119,6 +123,7 @@ function SortablePinItem({ pin, pathname, onUnpin }: { pin: PinnedItem; pathname
{...listeners}
>
<SidebarMenuButton
+ size="sm"
isActive={isActive}
render={<AppLink href={href} />}
onClick={(event) => {
@@ -130,23 +135,34 @@ function SortablePinItem({ pin, pathname, onUnpin }: { pin: PinnedItem; pathname
}}
className="text-muted-foreground hover:not-data-active:bg-sidebar-accent/70 data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground"
>
- {pin.item_type === "issue" ? (
- <ListTodo className="size-4 shrink-0" />
+ {pin.item_type === "issue" && pin.status ? (
+ /* Override parent [&_svg]:size-4 — pinned items need smaller icons to match sm size */
+ <StatusIcon status={pin.status as IssueStatus} className="!size-3.5 shrink-0" />
) : (
- <FolderKanban className="size-4 shrink-0" />
+ <span className="flex size-3.5 shrink-0 items-center justify-center text-xs leading-none">{pin.icon || "📁"}</span>
)}
- <span className="truncate">{label}</span>
+ <span
+ className="min-w-0 flex-1 overflow-hidden whitespace-nowrap"
+ style={{
+ maskImage: "linear-gradient(to right, black calc(100% - 12px), transparent)",
+ WebkitMaskImage: "linear-gradient(to right, black calc(100% - 12px), transparent)",
+ }}
+ >{label}</span>
+ <Tooltip>
+ <TooltipTrigger
+ render={<span role="button" />}
+ className="hidden size-2.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground group-hover/pin:flex hover:text-foreground"
+ onClick={(event) => {
+ event.preventDefault();
+ event.stopPropagation();
+ onUnpin();
+ }}
+ >
+ <X className="size-1" />
+ </TooltipTrigger>
+ <TooltipContent side="top" sideOffset={4}>Unpin</TooltipContent>
+ </Tooltip>
</SidebarMenuButton>
- <SidebarMenuAction
- showOnHover
- onClick={(event) => {
- event.preventDefault();
- event.stopPropagation();
- onUnpin();
- }}
- >
- <PinOff className="size-3 text-muted-foreground" />
- </SidebarMenuAction>
</SidebarMenuItem>
);
}
@@ -408,25 +424,36 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
</SidebarGroup>
{pinnedItems.length > 0 && (
- <SidebarGroup>
- <SidebarGroupLabel>Pinned</SidebarGroupLabel>
- <SidebarGroupContent>
- <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
- <SortableContext items={pinnedItems.map((p) => p.id)} strategy={verticalListSortingStrategy}>
- <SidebarMenu className="gap-0.5">
- {pinnedItems.map((pin: PinnedItem) => (
- <SortablePinItem
- key={pin.id}
- pin={pin}
- pathname={pathname}
- onUnpin={() => deletePin.mutate({ itemType: pin.item_type, itemId: pin.item_id })}
- />
- ))}
- </SidebarMenu>
- </SortableContext>
- </DndContext>
- </SidebarGroupContent>
- </SidebarGroup>
+ <Collapsible defaultOpen>
+ <SidebarGroup className="group/pinned">
+ <SidebarGroupLabel
+ render={<CollapsibleTrigger />}
+ className="group/trigger cursor-pointer hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground"
+ >
+ <span>Pinned</span>
+ <ChevronRight className="!size-3 ml-1 stroke-[2.5] transition-transform duration-200 group-data-[panel-open]/trigger:rotate-90" />
+ <span className="ml-auto text-[10px] text-muted-foreground opacity-0 transition-opacity group-hover/pinned:opacity-100">{pinnedItems.length}</span>
+ </SidebarGroupLabel>
+ <CollapsibleContent>
+ <SidebarGroupContent>
+ <DndContext sensors={sensors} collisionDetection={closestCenter} onDragEnd={handleDragEnd}>
+ <SortableContext items={pinnedItems.map((p) => p.id)} strategy={verticalListSortingStrategy}>
+ <SidebarMenu className="gap-0.5">
+ {pinnedItems.map((pin: PinnedItem) => (
+ <SortablePinItem
+ key={pin.id}
+ pin={pin}
+ pathname={pathname}
+ onUnpin={() => deletePin.mutate({ itemType: pin.item_type, itemId: pin.item_id })}
+ />
+ ))}
+ </SidebarMenu>
+ </SortableContext>
+ </DndContext>
+ </SidebarGroupContent>
+ </CollapsibleContent>
+ </SidebarGroup>
+ </Collapsible>
)}
<SidebarGroup>
diff --git a/packages/views/layout/dashboard-layout.tsx b/packages/views/layout/dashboard-layout.tsx
index 79f3fbe0fc..a114f06a6e 100644
--- a/packages/views/layout/dashboard-layout.tsx
+++ b/packages/views/layout/dashboard-layout.tsx
@@ -1,7 +1,7 @@
"use client";
import type { ReactNode } from "react";
-import { SidebarProvider, SidebarInset, SidebarTrigger } from "@multica/ui/components/ui/sidebar";
+import { SidebarProvider, SidebarInset } from "@multica/ui/components/ui/sidebar";
import { ModalRegistry } from "../modals/registry";
import { AppSidebar } from "./app-sidebar";
import { DashboardGuard } from "./dashboard-guard";
@@ -41,9 +41,6 @@ export function DashboardLayout({
<SidebarProvider className="h-svh">
<AppSidebar searchSlot={searchSlot} />
<SidebarInset className="relative overflow-hidden">
- <div className="flex h-10 shrink-0 items-center border-b px-2 md:hidden">
- <SidebarTrigger />
- </div>
{children}
<ModalRegistry />
{extra}
diff --git a/packages/views/layout/page-header.tsx b/packages/views/layout/page-header.tsx
new file mode 100644
index 0000000000..85c967714f
--- /dev/null
+++ b/packages/views/layout/page-header.tsx
@@ -0,0 +1,27 @@
+"use client";
+
+import { cn } from "@multica/ui/lib/utils";
+import { SidebarTrigger, useSidebar } from "@multica/ui/components/ui/sidebar";
+
+function MobileSidebarTrigger() {
+ try {
+ useSidebar();
+ } catch {
+ return null;
+ }
+ return <SidebarTrigger className="mr-2 md:hidden" />;
+}
+
+interface PageHeaderProps {
+ children: React.ReactNode;
+ className?: string;
+}
+
+export function PageHeader({ children, className }: PageHeaderProps) {
+ return (
+ <div className={cn("flex h-12 shrink-0 items-center border-b px-4", className)}>
+ <MobileSidebarTrigger />
+ {children}
+ </div>
+ );
+}
diff --git a/packages/views/my-issues/components/my-issues-page.tsx b/packages/views/my-issues/components/my-issues-page.tsx
index f954292d74..a7756f7938 100644
--- a/packages/views/my-issues/components/my-issues-page.tsx
+++ b/packages/views/my-issues/components/my-issues-page.tsx
@@ -23,6 +23,7 @@ import { useWorkspaceId } from "@multica/core/hooks";
import { myIssueListOptions, childIssueProgressOptions, type MyIssuesFilter } from "@multica/core/issues/queries";
import { useUpdateIssue, useLoadMoreDoneIssues } from "@multica/core/issues/mutations";
import { myIssuesViewStore } from "@multica/core/issues/stores/my-issues-view-store";
+import { PageHeader } from "../../layout/page-header";
import { MyIssuesHeader } from "./my-issues-header";
export function MyIssuesPage() {
@@ -149,14 +150,14 @@ export function MyIssuesPage() {
return (
<div className="flex flex-1 min-h-0 flex-col">
{/* Header 1: Workspace breadcrumb */}
- <div className="flex h-12 shrink-0 items-center gap-1.5 border-b px-4">
+ <PageHeader className="gap-1.5">
<WorkspaceAvatar name={workspace?.name ?? "W"} size="sm" />
<span className="text-sm text-muted-foreground">
{workspace?.name ?? "Workspace"}
</span>
<ChevronRight className="h-3 w-3 text-muted-foreground" />
<span className="text-sm font-medium">My Issues</span>
- </div>
+ </PageHeader>
{/* Header: scope tabs (left) + controls (right) */}
<MyIssuesHeader allIssues={myIssues} />
diff --git a/packages/views/projects/components/project-detail.tsx b/packages/views/projects/components/project-detail.tsx
index 0f5aaa1e8d..666277023d 100644
--- a/packages/views/projects/components/project-detail.tsx
+++ b/packages/views/projects/components/project-detail.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useMemo, useState, useCallback, useRef } from "react";
+import { useMemo, useState, useCallback, useRef, useEffect } from "react";
import { useDefaultLayout, usePanelRef } from "react-resizable-panels";
import { Check, ChevronRight, Link2, ListTodo, MoreHorizontal, PanelRight, Pin, PinOff, Trash2, UserMinus } from "lucide-react";
import { useQuery } from "@tanstack/react-query";
@@ -35,6 +35,8 @@ import { BatchActionToolbar } from "../../issues/components/batch-action-toolbar
import { Skeleton } from "@multica/ui/components/ui/skeleton";
import { Button } from "@multica/ui/components/ui/button";
import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@multica/ui/components/ui/resizable";
+import { Sheet, SheetContent } from "@multica/ui/components/ui/sheet";
+import { useIsMobile } from "@multica/ui/hooks/use-mobile";
import {
DropdownMenu,
DropdownMenuContent,
@@ -53,6 +55,7 @@ import {
TooltipContent,
} from "@multica/ui/components/ui/tooltip";
import { EmojiPicker } from "@multica/ui/components/common/emoji-picker";
+import { PageHeader } from "../../layout/page-header";
import {
AlertDialog,
AlertDialogAction,
@@ -198,9 +201,12 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
const createPin = useCreatePin();
const deletePinMut = useDeletePin();
const descEditorRef = useRef<ContentEditorRef>(null);
+ const isMobile = useIsMobile();
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
const [iconPickerOpen, setIconPickerOpen] = useState(false);
const [propertiesOpen, setPropertiesOpen] = useState(true);
+ const [progressOpen, setProgressOpen] = useState(true);
+ const [descriptionOpen, setDescriptionOpen] = useState(true);
// Sidebar panel
const { defaultLayout, onLayoutChanged } = useDefaultLayout({
@@ -209,6 +215,13 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
const sidebarRef = usePanelRef();
const [sidebarOpen, setSidebarOpen] = useState(true);
+ useEffect(() => {
+ if (isMobile) {
+ setSidebarOpen(false);
+ sidebarRef.current?.collapse();
+ }
+ }, [isMobile]);
+
// Lead popover
const [leadOpen, setLeadOpen] = useState(false);
const [leadFilter, setLeadFilter] = useState("");
@@ -258,115 +271,313 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
const statusCfg = PROJECT_STATUS_CONFIG[project.status];
const priorityCfg = PROJECT_PRIORITY_CONFIG[project.priority];
- return (
- <div className="flex h-full flex-col">
- {/* Header bar — breadcrumb */}
- <div className="flex h-12 shrink-0 items-center justify-between border-b bg-background px-4 text-sm">
- <div className="flex items-center gap-1.5 min-w-0">
- <AppLink href="/projects" className="text-muted-foreground hover:text-foreground transition-colors shrink-0">
- {workspaceName ?? "Projects"}
- </AppLink>
- <ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
- <span className="truncate">{project.title}</span>
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <Button variant="ghost" size="icon-xs" className="text-muted-foreground shrink-0">
- <MoreHorizontal className="h-4 w-4" />
- </Button>
- }
- />
- <DropdownMenuContent align="start" className="w-48">
- <DropdownMenuItem onClick={() => {
- if (isPinned) {
- deletePinMut.mutate({ itemType: "project", itemId: projectId });
- } else {
- createPin.mutate({ item_type: "project", item_id: projectId });
- }
- }}>
- {isPinned ? <PinOff className="h-3.5 w-3.5" /> : <Pin className="h-3.5 w-3.5" />}
- {isPinned ? "Unpin from sidebar" : "Pin to sidebar"}
- </DropdownMenuItem>
- <DropdownMenuItem onClick={() => {
- navigator.clipboard.writeText(window.location.href);
- toast.success("Link copied");
- }}>
- <Link2 className="h-3.5 w-3.5" />
- Copy link
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- <DropdownMenuItem
- variant="destructive"
- onClick={() => setDeleteDialogOpen(true)}
+ const sidebarContent = (
+ <div className="space-y-5">
+ {/* Icon + Title */}
+ <div>
+ <Popover open={iconPickerOpen} onOpenChange={setIconPickerOpen}>
+ <PopoverTrigger
+ render={
+ <button
+ type="button"
+ className="text-2xl cursor-pointer rounded-lg p-1 -ml-1 hover:bg-accent/60 transition-colors"
+ title="Change icon"
>
- <Trash2 className="h-3.5 w-3.5" />
- Delete project
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- <div className="flex items-center gap-1 shrink-0">
- <Button
- variant="ghost"
- size="icon-xs"
- className={cn("text-muted-foreground", isPinned && "text-foreground")}
- title={isPinned ? "Unpin from sidebar" : "Pin to sidebar"}
- onClick={() => {
- if (isPinned) {
- deletePinMut.mutate({ itemType: "project", itemId: projectId });
- } else {
- createPin.mutate({ item_type: "project", item_id: projectId });
- }
- }}
- >
- {isPinned ? <PinOff className="h-4 w-4" /> : <Pin className="h-4 w-4" />}
- </Button>
- <Button
- variant="ghost"
- size="icon-xs"
- className="text-muted-foreground"
- onClick={() => {
- navigator.clipboard.writeText(window.location.href);
- toast.success("Link copied");
- }}
- >
- <Link2 className="h-4 w-4" />
- </Button>
- <Tooltip>
- <TooltipTrigger
- render={
- <Button
- variant={sidebarOpen ? "secondary" : "ghost"}
- size="icon-xs"
- className={sidebarOpen ? "" : "text-muted-foreground"}
- onClick={() => {
- const panel = sidebarRef.current;
- if (!panel) return;
- if (panel.isCollapsed()) panel.expand();
- else panel.collapse();
- }}
- >
- <PanelRight className="h-4 w-4" />
- </Button>
- }
+ {project.icon || "📁"}
+ </button>
+ }
+ />
+ <PopoverContent align="start" className="w-auto p-0">
+ <EmojiPicker
+ onSelect={(emoji) => {
+ handleUpdateField({ icon: emoji });
+ setIconPickerOpen(false);
+ }}
/>
- <TooltipContent side="bottom">Toggle sidebar</TooltipContent>
- </Tooltip>
- </div>
+ </PopoverContent>
+ </Popover>
+ <TitleEditor
+ key={`title-${projectId}`}
+ defaultValue={project.title}
+ placeholder="Project title"
+ className="mt-2 w-full text-base font-semibold leading-snug tracking-tight"
+ onBlur={(value) => {
+ const trimmed = value.trim();
+ if (trimmed && trimmed !== project.title) handleUpdateField({ title: trimmed });
+ }}
+ />
</div>
- {/* Main content — issues list + sidebar */}
- <ResizablePanelGroup orientation="horizontal" className="flex-1 min-h-0" defaultLayout={defaultLayout} onLayoutChanged={onLayoutChanged}>
- <ResizablePanel id="content" minSize="50%">
- <div className="flex h-full flex-col">
- <ViewStoreProvider store={projectViewStore}>
+ {/* Properties */}
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setPropertiesOpen(!propertiesOpen)}
+ >
+ Properties
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
+ </button>
+ {propertiesOpen && <div className="space-y-0.5 pl-2">
+ <PropRow label="Status">
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
+ <span className={cn("size-2 rounded-full", statusCfg.dotColor)} />
+ <span>{statusCfg.label}</span>
+ </button>
+ }
+ />
+ <DropdownMenuContent align="start" className="w-44">
+ {PROJECT_STATUS_ORDER.map((s) => (
+ <DropdownMenuItem key={s} onClick={() => handleUpdateField({ status: s as ProjectStatus })}>
+ <span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[s].dotColor)} />
+ <span>{PROJECT_STATUS_CONFIG[s].label}</span>
+ {s === project.status && <Check className="ml-auto h-3.5 w-3.5" />}
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </PropRow>
+ <PropRow label="Priority">
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
+ <PriorityIcon priority={project.priority} />
+ <span>{priorityCfg.label}</span>
+ </button>
+ }
+ />
+ <DropdownMenuContent align="start" className="w-44">
+ {PROJECT_PRIORITY_ORDER.map((p) => (
+ <DropdownMenuItem key={p} onClick={() => handleUpdateField({ priority: p as ProjectPriority })}>
+ <PriorityIcon priority={p} />
+ <span>{PROJECT_PRIORITY_CONFIG[p].label}</span>
+ {p === project.priority && <Check className="ml-auto h-3.5 w-3.5" />}
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </PropRow>
+ <PropRow label="Lead">
+ <Popover open={leadOpen} onOpenChange={(v) => { setLeadOpen(v); if (!v) setLeadFilter(""); }}>
+ <PopoverTrigger
+ render={
+ <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
+ {project.lead_type && project.lead_id ? (
+ <>
+ <ActorAvatar actorType={project.lead_type} actorId={project.lead_id} size={16} />
+ <span>{getActorName(project.lead_type, project.lead_id)}</span>
+ </>
+ ) : (
+ <span className="text-muted-foreground">No lead</span>
+ )}
+ </button>
+ }
+ />
+ <PopoverContent align="start" className="w-52 p-0">
+ <div className="px-2 py-1.5 border-b">
+ <input
+ type="text"
+ value={leadFilter}
+ onChange={(e) => setLeadFilter(e.target.value)}
+ placeholder="Assign lead..."
+ className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
+ />
+ </div>
+ <div className="p-1 max-h-60 overflow-y-auto">
+ <button
+ type="button"
+ onClick={() => { handleUpdateField({ lead_type: null, lead_id: null }); setLeadOpen(false); }}
+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
+ >
+ <UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
+ <span className="text-muted-foreground">No lead</span>
+ </button>
+ {filteredMembers.length > 0 && (
+ <>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Members</div>
+ {filteredMembers.map((m) => (
+ <button
+ type="button"
+ key={m.user_id}
+ onClick={() => { handleUpdateField({ lead_type: "member", lead_id: m.user_id }); setLeadOpen(false); }}
+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
+ >
+ <ActorAvatar actorType="member" actorId={m.user_id} size={16} />
+ <span>{m.name}</span>
+ </button>
+ ))}
+ </>
+ )}
+ {filteredAgents.length > 0 && (
+ <>
+ <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Agents</div>
+ {filteredAgents.map((a) => (
+ <button
+ type="button"
+ key={a.id}
+ onClick={() => { handleUpdateField({ lead_type: "agent", lead_id: a.id }); setLeadOpen(false); }}
+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
+ >
+ <ActorAvatar actorType="agent" actorId={a.id} size={16} />
+ <span>{a.name}</span>
+ </button>
+ ))}
+ </>
+ )}
+ {filteredMembers.length === 0 && filteredAgents.length === 0 && leadFilter && (
+ <div className="px-2 py-3 text-center text-sm text-muted-foreground">No results</div>
+ )}
+ </div>
+ </PopoverContent>
+ </Popover>
+ </PropRow>
+ </div>}
+ </div>
+
+ {/* Progress */}
+ {issueMetrics.totalCount > 0 && (() => {
+ const pct = Math.round((issueMetrics.completedCount / issueMetrics.totalCount) * 100);
+ return (
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${progressOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setProgressOpen(!progressOpen)}
+ >
+ Progress
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${progressOpen ? "rotate-90" : ""}`} />
+ </button>
+ {progressOpen && <div className="pl-2 flex items-center gap-3">
+ <div className="relative h-2 flex-1 rounded-full bg-muted overflow-hidden">
+ <div
+ className="absolute inset-y-0 left-0 rounded-full bg-emerald-500 transition-all"
+ style={{ width: `${pct}%` }}
+ />
+ </div>
+ <span className="text-xs text-muted-foreground tabular-nums shrink-0">
+ {issueMetrics.completedCount}/{issueMetrics.totalCount}
+ </span>
+ </div>}
+ </div>
+ );
+ })()}
+
+ {/* Description */}
+ <div>
+ <button
+ className={`flex w-full items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors mb-2 hover:bg-accent/70 ${descriptionOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
+ onClick={() => setDescriptionOpen(!descriptionOpen)}
+ >
+ Description
+ <ChevronRight className={`!size-3 shrink-0 stroke-[2.5] text-muted-foreground transition-transform ${descriptionOpen ? "rotate-90" : ""}`} />
+ </button>
+ {descriptionOpen && <div className="pl-2">
+ <ContentEditor
+ ref={descEditorRef}
+ key={projectId}
+ defaultValue={project.description || ""}
+ placeholder="Add description..."
+ onUpdate={(md) => handleUpdateField({ description: md || null })}
+ debounceMs={1500}
+ />
+ </div>}
+ </div>
+ </div>
+ );
+
+ return (
+ <>
+ <ResizablePanelGroup orientation="horizontal" className="flex-1 min-h-0" defaultLayout={defaultLayout} onLayoutChanged={onLayoutChanged}>
+ <ResizablePanel id="content" minSize="50%">
+ <div className="flex h-full flex-col">
+ <PageHeader className="gap-2 bg-background text-sm">
+ <div className="flex flex-1 items-center gap-1.5 min-w-0">
+ <AppLink href="/projects" className="text-muted-foreground hover:text-foreground transition-colors shrink-0">
+ {workspaceName ?? "Projects"}
+ </AppLink>
+ <ChevronRight className="h-3 w-3 text-muted-foreground/50 shrink-0" />
+ <span className="truncate">{project.title}</span>
+ </div>
+ <div className="flex items-center gap-1 shrink-0">
+ <Button
+ variant="ghost"
+ size="icon-sm"
+ className={cn("text-muted-foreground", isPinned && "text-foreground")}
+ title={isPinned ? "Unpin from sidebar" : "Pin to sidebar"}
+ onClick={() => {
+ if (isPinned) {
+ deletePinMut.mutate({ itemType: "project", itemId: projectId });
+ } else {
+ createPin.mutate({ item_type: "project", item_id: projectId });
+ }
+ }}
+ >
+ {isPinned ? <PinOff /> : <Pin />}
+ </Button>
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <Button variant="ghost" size="icon-sm" className="text-muted-foreground">
+ <MoreHorizontal />
+ </Button>
+ }
+ />
+ <DropdownMenuContent align="end" className="w-auto">
+ <DropdownMenuItem onClick={() => {
+ navigator.clipboard.writeText(window.location.href);
+ toast.success("Link copied");
+ }}>
+ <Link2 className="h-3.5 w-3.5" />
+ Copy link
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItem
+ variant="destructive"
+ onClick={() => setDeleteDialogOpen(true)}
+ >
+ <Trash2 className="h-3.5 w-3.5" />
+ Delete project
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant={sidebarOpen ? "secondary" : "ghost"}
+ size="icon-sm"
+ className={sidebarOpen ? "" : "text-muted-foreground"}
+ onClick={() => {
+ if (isMobile) {
+ setSidebarOpen(!sidebarOpen);
+ } else {
+ const panel = sidebarRef.current;
+ if (!panel) return;
+ if (panel.isCollapsed()) panel.expand();
+ else panel.collapse();
+ }
+ }}
+ >
+ <PanelRight />
+ </Button>
+ }
+ />
+ <TooltipContent side="bottom">Toggle sidebar</TooltipContent>
+ </Tooltip>
+ </div>
+ </PageHeader>
+
+ <ViewStoreProvider store={projectViewStore}>
<IssuesHeader scopedIssues={projectIssues} />
<ProjectIssuesContent projectIssues={projectIssues} />
<BatchActionToolbar />
</ViewStoreProvider>
</div>
</ResizablePanel>
- <ResizableHandle />
+ {!isMobile && <ResizableHandle />}
+ {!isMobile && (
<ResizablePanel
id="sidebar"
defaultSize={sidebarOpen ? 320 : 0}
@@ -377,224 +588,20 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
panelRef={sidebarRef}
onResize={(size) => setSidebarOpen(size.inPixels > 0)}
>
- {/* RIGHT: Properties sidebar */}
<div className="overflow-y-auto border-l h-full">
- <div className="p-4 space-y-5">
- {/* Icon + Title */}
- <div>
- <Popover open={iconPickerOpen} onOpenChange={setIconPickerOpen}>
- <PopoverTrigger
- render={
- <button
- type="button"
- className="text-2xl cursor-pointer rounded-lg p-1 -ml-1 hover:bg-accent/60 transition-colors"
- title="Change icon"
- >
- {project.icon || "📁"}
- </button>
- }
- />
- <PopoverContent align="start" className="w-auto p-0">
- <EmojiPicker
- onSelect={(emoji) => {
- handleUpdateField({ icon: emoji });
- setIconPickerOpen(false);
- }}
- />
- </PopoverContent>
- </Popover>
-
- <TitleEditor
- key={`title-${projectId}`}
- defaultValue={project.title}
- placeholder="Project title"
- className="mt-2 w-full text-base font-semibold leading-snug tracking-tight"
- onBlur={(value) => {
- const trimmed = value.trim();
- if (trimmed && trimmed !== project.title) handleUpdateField({ title: trimmed });
- }}
- />
- </div>
-
- {/* Properties section */}
- <div>
- <button
- className={`flex w-full items-center gap-1 text-xs font-medium transition-colors mb-2 ${propertiesOpen ? "" : "text-muted-foreground hover:text-foreground"}`}
- onClick={() => setPropertiesOpen(!propertiesOpen)}
- >
- <ChevronRight className={`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${propertiesOpen ? "rotate-90" : ""}`} />
- Properties
- </button>
-
- {propertiesOpen && <div className="space-y-0.5 pl-2">
- {/* Status */}
- <PropRow label="Status">
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
- <span className={cn("size-2 rounded-full", statusCfg.dotColor)} />
- <span>{statusCfg.label}</span>
- </button>
- }
- />
- <DropdownMenuContent align="start" className="w-44">
- {PROJECT_STATUS_ORDER.map((s) => (
- <DropdownMenuItem key={s} onClick={() => handleUpdateField({ status: s as ProjectStatus })}>
- <span className={cn("size-2 rounded-full", PROJECT_STATUS_CONFIG[s].dotColor)} />
- <span>{PROJECT_STATUS_CONFIG[s].label}</span>
- {s === project.status && <Check className="ml-auto h-3.5 w-3.5" />}
- </DropdownMenuItem>
- ))}
- </DropdownMenuContent>
- </DropdownMenu>
- </PropRow>
-
- {/* Priority */}
- <PropRow label="Priority">
- <DropdownMenu>
- <DropdownMenuTrigger
- render={
- <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
- <PriorityIcon priority={project.priority} />
- <span>{priorityCfg.label}</span>
- </button>
- }
- />
- <DropdownMenuContent align="start" className="w-44">
- {PROJECT_PRIORITY_ORDER.map((p) => (
- <DropdownMenuItem key={p} onClick={() => handleUpdateField({ priority: p as ProjectPriority })}>
- <PriorityIcon priority={p} />
- <span>{PROJECT_PRIORITY_CONFIG[p].label}</span>
- {p === project.priority && <Check className="ml-auto h-3.5 w-3.5" />}
- </DropdownMenuItem>
- ))}
- </DropdownMenuContent>
- </DropdownMenu>
- </PropRow>
-
- {/* Lead */}
- <PropRow label="Lead">
- <Popover open={leadOpen} onOpenChange={(v) => { setLeadOpen(v); if (!v) setLeadFilter(""); }}>
- <PopoverTrigger
- render={
- <button type="button" className="inline-flex items-center gap-1.5 text-xs hover:text-foreground transition-colors">
- {project.lead_type && project.lead_id ? (
- <>
- <ActorAvatar actorType={project.lead_type} actorId={project.lead_id} size={16} />
- <span>{getActorName(project.lead_type, project.lead_id)}</span>
- </>
- ) : (
- <span className="text-muted-foreground">No lead</span>
- )}
- </button>
- }
- />
- <PopoverContent align="start" className="w-52 p-0">
- <div className="px-2 py-1.5 border-b">
- <input
- type="text"
- value={leadFilter}
- onChange={(e) => setLeadFilter(e.target.value)}
- placeholder="Assign lead..."
- className="w-full bg-transparent text-sm placeholder:text-muted-foreground outline-none"
- />
- </div>
- <div className="p-1 max-h-60 overflow-y-auto">
- <button
- type="button"
- onClick={() => { handleUpdateField({ lead_type: null, lead_id: null }); setLeadOpen(false); }}
- className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
- >
- <UserMinus className="h-3.5 w-3.5 text-muted-foreground" />
- <span className="text-muted-foreground">No lead</span>
- </button>
- {filteredMembers.length > 0 && (
- <>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Members</div>
- {filteredMembers.map((m) => (
- <button
- type="button"
- key={m.user_id}
- onClick={() => { handleUpdateField({ lead_type: "member", lead_id: m.user_id }); setLeadOpen(false); }}
- className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
- >
- <ActorAvatar actorType="member" actorId={m.user_id} size={16} />
- <span>{m.name}</span>
- </button>
- ))}
- </>
- )}
- {filteredAgents.length > 0 && (
- <>
- <div className="px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground uppercase tracking-wider">Agents</div>
- {filteredAgents.map((a) => (
- <button
- type="button"
- key={a.id}
- onClick={() => { handleUpdateField({ lead_type: "agent", lead_id: a.id }); setLeadOpen(false); }}
- className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent transition-colors"
- >
- <ActorAvatar actorType="agent" actorId={a.id} size={16} />
- <span>{a.name}</span>
- </button>
- ))}
- </>
- )}
- {filteredMembers.length === 0 && filteredAgents.length === 0 && leadFilter && (
- <div className="px-2 py-3 text-center text-sm text-muted-foreground">No results</div>
- )}
- </div>
- </PopoverContent>
- </Popover>
- </PropRow>
- </div>}
- </div>
-
- {/* Progress */}
- {issueMetrics.totalCount > 0 && (() => {
- const pct = Math.round((issueMetrics.completedCount / issueMetrics.totalCount) * 100);
- return (
- <div>
- <div className="text-xs font-medium mb-2 flex items-center gap-1">
- <ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground rotate-90" />
- Progress
- </div>
- <div className="pl-2 flex items-center gap-3">
- <div className="relative h-2 flex-1 rounded-full bg-muted overflow-hidden">
- <div
- className="absolute inset-y-0 left-0 rounded-full bg-emerald-500 transition-all"
- style={{ width: `${pct}%` }}
- />
- </div>
- <span className="text-xs text-muted-foreground tabular-nums shrink-0">
- {issueMetrics.completedCount}/{issueMetrics.totalCount}
- </span>
- </div>
- </div>
- );
- })()}
-
- {/* Description */}
- <div>
- <h3 className="text-xs font-medium mb-2 flex items-center gap-1">
- <ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground rotate-90" />
- Description
- </h3>
- <div className="pl-2">
- <ContentEditor
- ref={descEditorRef}
- key={projectId}
- defaultValue={project.description || ""}
- placeholder="Add description..."
- onUpdate={(md) => handleUpdateField({ description: md || null })}
- debounceMs={1500}
- />
- </div>
- </div>
+ <div className="p-4">
+ {sidebarContent}
</div>
</div>
</ResizablePanel>
+ )}
+ {isMobile && (
+ <Sheet open={sidebarOpen} onOpenChange={setSidebarOpen}>
+ <SheetContent side="right" showCloseButton={false} className="w-[320px] overflow-y-auto p-4">
+ {sidebarContent}
+ </SheetContent>
+ </Sheet>
+ )}
</ResizablePanelGroup>
{/* Delete confirmation */}
@@ -614,6 +621,6 @@ export function ProjectDetail({ projectId }: { projectId: string }) {
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
- </div>
+ </>
);
}
diff --git a/packages/views/projects/components/projects-page.tsx b/packages/views/projects/components/projects-page.tsx
index 1756e4900e..644b91d6cd 100644
--- a/packages/views/projects/components/projects-page.tsx
+++ b/packages/views/projects/components/projects-page.tsx
@@ -37,6 +37,7 @@ import { ContentEditor, type ContentEditorRef } from "../../editor";
import { TitleEditor } from "../../editor";
import { EmojiPicker } from "@multica/ui/components/common/emoji-picker";
import type { Project, ProjectStatus, ProjectPriority, UpdateProjectRequest } from "@multica/core/types";
+import { PageHeader } from "../../layout/page-header";
import { PriorityIcon } from "../../issues/components/priority-icon";
function formatRelativeDate(date: string): string {
@@ -539,7 +540,7 @@ export function ProjectsPage() {
return (
<div className="flex h-full flex-col">
{/* Header bar */}
- <div className="flex h-12 shrink-0 items-center justify-between border-b px-5">
+ <PageHeader className="justify-between px-5">
<div className="flex items-center gap-2">
<FolderKanban className="h-4 w-4 text-muted-foreground" />
<h1 className="text-sm font-medium">Projects</h1>
@@ -551,7 +552,7 @@ export function ProjectsPage() {
<Plus className="h-3.5 w-3.5 mr-1" />
New project
</Button>
- </div>
+ </PageHeader>
{/* Table */}
<div className="flex-1 overflow-y-auto">
diff --git a/packages/views/runtimes/components/runtime-list.tsx b/packages/views/runtimes/components/runtime-list.tsx
index 125ffdbe1d..0b7b7ae0d6 100644
--- a/packages/views/runtimes/components/runtime-list.tsx
+++ b/packages/views/runtimes/components/runtime-list.tsx
@@ -11,6 +11,7 @@ import {
DropdownMenuSeparator,
} from "@multica/ui/components/ui/dropdown-menu";
import { ActorAvatar } from "../../common/actor-avatar";
+import { PageHeader } from "../../layout/page-header";
import { ProviderLogo } from "./provider-logo";
type RuntimeFilter = "mine" | "all";
@@ -120,13 +121,13 @@ export function RuntimeList({
return (
<div className="overflow-y-auto h-full border-r">
- <div className="flex h-12 items-center justify-between border-b px-4">
+ <PageHeader className="justify-between">
<h1 className="text-sm font-semibold">Runtimes</h1>
<span className="text-xs text-muted-foreground">
{filteredRuntimes.filter((r) => r.status === "online").length}/
{filteredRuntimes.length} online
</span>
- </div>
+ </PageHeader>
{/* Filter bar */}
<div className="flex items-center justify-between border-b px-4 py-2">
diff --git a/packages/views/search/search-command.tsx b/packages/views/search/search-command.tsx
index ff95fd19f6..02c9c3702e 100644
--- a/packages/views/search/search-command.tsx
+++ b/packages/views/search/search-command.tsx
@@ -248,6 +248,7 @@ export function SearchCommand() {
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent
+ finalFocus={false}
className="top-[20%] translate-y-0 overflow-hidden rounded-xl! p-0 sm:max-w-xl!"
showCloseButton={false}
>
diff --git a/packages/views/skills/components/file-viewer.tsx b/packages/views/skills/components/file-viewer.tsx
index 25ea61a17b..b714293e0c 100644
--- a/packages/views/skills/components/file-viewer.tsx
+++ b/packages/views/skills/components/file-viewer.tsx
@@ -109,7 +109,7 @@ export function FileViewer({
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={() => setEditing(!editing)}
className="text-muted-foreground"
>
diff --git a/packages/views/skills/components/skills-page.tsx b/packages/views/skills/components/skills-page.tsx
index 328b556e7d..af6bcefa8f 100644
--- a/packages/views/skills/components/skills-page.tsx
+++ b/packages/views/skills/components/skills-page.tsx
@@ -38,6 +38,7 @@ import { useAuthStore } from "@multica/core/auth";
import { useWorkspaceId } from "@multica/core/hooks";
import { skillListOptions, workspaceKeys } from "@multica/core/workspace/queries";
+import { PageHeader } from "../../layout/page-header";
import { FileTree } from "./file-tree";
import { FileViewer } from "./file-viewer";
@@ -496,7 +497,7 @@ function SkillDetail({
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={() => setShowAddFile(true)}
className="text-muted-foreground"
>
@@ -512,7 +513,7 @@ function SkillDetail({
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={handleDeleteFile}
className="text-muted-foreground hover:text-destructive"
>
@@ -724,14 +725,14 @@ export default function SkillsPage() {
<ResizablePanel id="list" defaultSize={280} minSize={240} maxSize={400} groupResizeBehavior="preserve-pixel-size">
{/* Left column — skill list */}
<div className="overflow-y-auto h-full border-r">
- <div className="flex h-12 items-center justify-between border-b px-4">
+ <PageHeader className="justify-between">
<h1 className="text-sm font-semibold">Skills</h1>
<Tooltip>
<TooltipTrigger
render={
<Button
variant="ghost"
- size="icon-xs"
+ size="icon-sm"
onClick={() => setShowCreate(true)}
>
<Plus className="h-4 w-4 text-muted-foreground" />
@@ -740,7 +741,7 @@ export default function SkillsPage() {
/>
<TooltipContent side="bottom">Create skill</TooltipContent>
</Tooltip>
- </div>
+ </PageHeader>
{skills.length === 0 ? (
<div className="flex flex-col items-center justify-center px-4 py-12">
<Sparkles className="h-8 w-8 text-muted-foreground/40" />
diff --git a/packages/views/test/setup.ts b/packages/views/test/setup.ts
index 7501438744..cdd118f777 100644
--- a/packages/views/test/setup.ts
+++ b/packages/views/test/setup.ts
@@ -31,6 +31,21 @@ if (typeof globalThis.localStorage?.clear !== "function") {
});
}
+// jsdom doesn't provide matchMedia; useIsMobile() relies on it.
+if (typeof window.matchMedia !== "function") {
+ window.matchMedia = (query: string) =>
+ ({
+ matches: false,
+ media: query,
+ onchange: null,
+ addListener: () => {},
+ removeListener: () => {},
+ addEventListener: () => {},
+ removeEventListener: () => {},
+ dispatchEvent: () => false,
+ }) as MediaQueryList;
+}
+
// jsdom doesn't provide ResizeObserver; stub it so components that rely on it
// (e.g. input-otp) can render in tests.
if (typeof globalThis.ResizeObserver === "undefined") {