From ee5e6d413569ed8070f677682198b0db263ba54f Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 5 Jun 2026 21:43:23 +0000 Subject: [PATCH] fix: stabilize artifact card title row Co-Authored-By: Paperclip --- .../artifacts/ArtifactCard.test.tsx | 20 +++++++++++++++++++ ui/src/components/artifacts/ArtifactCard.tsx | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ui/src/components/artifacts/ArtifactCard.test.tsx b/ui/src/components/artifacts/ArtifactCard.test.tsx index 1516721bee0..2c7503ffd53 100644 --- a/ui/src/components/artifacts/ArtifactCard.test.tsx +++ b/ui/src/components/artifacts/ArtifactCard.test.tsx @@ -52,6 +52,8 @@ describe("ArtifactCard", () => { expect(markup).toContain('src="/files/art-1.png"'); expect(markup).toContain("object-cover"); expect(markup).toContain("Hero shot"); + expect(markup).toContain("flex h-7 items-start justify-between gap-2"); + expect(markup).toContain("leading-7"); expect(markup).toContain("Last edited Jun 1, 2026"); expect(markup).not.toContain("Landing visuals"); expect(markup).not.toContain("Edited "); @@ -142,4 +144,22 @@ describe("ArtifactCard", () => { expect(markup).not.toContain('aria-label="Download file"'); expect(markup).not.toContain('aria-label="Open file in new tab"'); }); + + it("reserves the same title row height when file actions are absent", () => { + const markup = renderToStaticMarkup( + , + ); + + expect(markup).toContain("flex h-7 items-start justify-between gap-2"); + expect(markup).toContain("leading-7"); + expect(markup).toContain("Last edited Jun 1, 2026"); + expect(markup).not.toContain('aria-label="Download file"'); + expect(markup).not.toContain('aria-label="Open file in new tab"'); + }); }); diff --git a/ui/src/components/artifacts/ArtifactCard.tsx b/ui/src/components/artifacts/ArtifactCard.tsx index cacdd834b1a..842c0ee6651 100644 --- a/ui/src/components/artifacts/ArtifactCard.tsx +++ b/ui/src/components/artifacts/ArtifactCard.tsx @@ -151,8 +151,11 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
-
-

+
+

{artifact.title}