diff --git a/ui/storybook/stories/artifacts.stories.tsx b/ui/storybook/stories/artifacts.stories.tsx index 185781c9245..78f9ed4ad56 100644 --- a/ui/storybook/stories/artifacts.stories.tsx +++ b/ui/storybook/stories/artifacts.stories.tsx @@ -1,7 +1,9 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { useState } from "react"; +import { MemoryRouter } from "react-router-dom"; import { ArrowLeft, Check, Layers, Package, Search, X } from "lucide-react"; import { ArtifactCard } from "@/components/artifacts/ArtifactCard"; +import { ArtifactGroupCard } from "@/components/artifacts/ArtifactGroupCard"; import { EmptyState } from "@/components/EmptyState"; import { Button } from "@/components/ui/button"; import { @@ -12,8 +14,8 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; -import { cn, formatDate } from "@/lib/utils"; -import type { CompanyArtifact } from "@/api/artifacts"; +import { cn } from "@/lib/utils"; +import type { CompanyArtifact, CompanyArtifactGroup } from "@/api/artifacts"; import { ARTIFACT_GROUP_OPTIONS, ARTIFACT_KIND_FILTERS, @@ -246,7 +248,7 @@ function ArtifactsToolbar({ ); } -interface MockGroup { +function makeGroup(input: { id: string; groupBy: Exclude; issueIdentifier: string; @@ -255,90 +257,31 @@ interface MockGroup { preview: CompanyArtifact; updatedAt: string; href: string; +}): CompanyArtifactGroup { + const issueId = input.id.split(":")[1] ?? input.id; + return { + id: input.id, + groupBy: input.groupBy, + issue: { id: issueId, identifier: input.issueIdentifier, title: input.issueTitle }, + title: input.issueTitle, + count: input.count, + mediaKinds: [input.preview.mediaKind], + previewArtifacts: [input.preview], + updatedAt: input.updatedAt, + href: input.href, + }; } -/** - * Stack card mock for grouped views. - * - * Visual rules (matching ArtifactCard footprint): - * - Same border, radius (rounded-[8px]), border + bg-card surface, hover treatment. - * - Preview frame is the same `aspect-video` PreviewFrame as ArtifactCard. - * - Footer block has the same vertical rhythm. - * - When `count > 1`, render two stacked sibling layers behind the main card, - * offset by 4px / 8px on both axes, with reduced opacity. This produces a - * subtle "stack" without competing with the preview content. - * - Stack count badge sits in the top-right of the preview as a small pill. - * - The body line replaces the artifact title with the issue identifier and - * title; metadata line shows the artifact count and most-recent-edit time. - */ -function ArtifactStackCard({ group }: { group: MockGroup }) { - const isStacked = group.count > 1; - +function ArtifactStackCard({ group }: { group: CompanyArtifactGroup }) { return ( -
- {isStacked ? ( - <> -