diff --git a/server/src/services/company-artifacts.ts b/server/src/services/company-artifacts.ts index 143f9ceb8eb..4551ac27acf 100644 --- a/server/src/services/company-artifacts.ts +++ b/server/src/services/company-artifacts.ts @@ -286,8 +286,7 @@ function buildArtifactGroups(input: { if (group.previewArtifacts.length < GROUP_PREVIEW_ARTIFACT_LIMIT) { group.previewArtifacts.push(artifact); } - const dateDiff = Date.parse(artifact.updatedAt) - Date.parse(group.updatedAt); - if (dateDiff > 0 || (dateDiff === 0 && artifact.id > group.id)) { + if (Date.parse(artifact.updatedAt) > Date.parse(group.updatedAt)) { group.updatedAt = artifact.updatedAt; } } diff --git a/ui/storybook/stories/artifacts.stories.tsx b/ui/storybook/stories/artifacts.stories.tsx index 79b27024acb..b6d4f77bc62 100644 --- a/ui/storybook/stories/artifacts.stories.tsx +++ b/ui/storybook/stories/artifacts.stories.tsx @@ -1,11 +1,17 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { useState } from "react"; -import { Check, ChevronLeft, Layers, Package, Search, X } from "lucide-react"; +import { ArrowLeft, Check, Layers, Package, Search, X } from "lucide-react"; import { ArtifactCard } from "@/components/artifacts/ArtifactCard"; import { EmptyState } from "@/components/EmptyState"; import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { cn, formatDate } from "@/lib/utils"; import type { CompanyArtifact } from "@/api/artifacts"; @@ -153,6 +159,10 @@ const GROUP_OPTIONS: { value: GroupBy; label: string }[] = [ { value: "parent_task", label: "Parent task" }, ]; +function groupByLabel(value: GroupBy) { + return GROUP_OPTIONS.find((option) => option.value === value)?.label ?? "None"; +} + /** * Toolbar replica matching the existing Artifacts page (search + kind filters) * with the group-by icon control placed before the filter chips. @@ -196,41 +206,34 @@ function ArtifactsToolbar({