From 4a565643ad99eef35f292bda044393c65a3674ab Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Sun, 5 Apr 2026 13:51:10 +0200 Subject: [PATCH] refactor(web): migrate consumers to EmptyState, SectionHeading, Pagination, CommentCard - issues/index.tsx: EmptyState + Pagination (remove ButtonLink, ChevronLeft/Right) - user/$id.tsx: EmptyState + Pagination (remove ButtonLink, ChevronLeft/Right) - issues/$id.tsx: EmptyState + SectionHeading - LabelEditor.tsx: SectionHeading - Timeline.tsx: CommentCard (Root/AuthorAvatar/Card/CardHeader/CardBody) - CommentBox.tsx: CommentCard (Root/AuthorAvatar/Card) Co-Authored-By: Claude Opus 4.6 (1M context) --- webui2/src/components/bugs/CommentBox.tsx | 18 +++----- webui2/src/components/bugs/LabelEditor.tsx | 5 +-- webui2/src/components/bugs/Timeline.tsx | 27 +++++------- .../__snapshots__/FileViewer.test.tsx.snap | 40 +++++++++--------- .../src/routes/$repo/_issues/issues/$id.tsx | 8 ++-- .../src/routes/$repo/_issues/issues/index.tsx | 41 ++++++------------- webui2/src/routes/$repo/_issues/user/$id.tsx | 37 +++++------------ 7 files changed, 65 insertions(+), 111 deletions(-) diff --git a/webui2/src/components/bugs/CommentBox.tsx b/webui2/src/components/bugs/CommentBox.tsx index 3ed7e189cea5c9f0f7b81a0f748314668de3f9ca..4a078592d30a870af816a9f2ba0b18b6e36176af 100644 --- a/webui2/src/components/bugs/CommentBox.tsx +++ b/webui2/src/components/bugs/CommentBox.tsx @@ -10,8 +10,8 @@ import { BugDetailDocument, } from "@/__generated__/graphql"; import { Markdown } from "@/components/content/Markdown"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; +import * as CommentCard from "@/components/ui/comment-card"; import { Textarea } from "@/components/ui/textarea"; import * as WritePreview from "@/components/ui/write-preview"; import { useAuth } from "@/lib/auth"; @@ -73,15 +73,9 @@ export function CommentBox({ bugPrefix, bugStatus, ref_ }: CommentBoxProps) { if (!user) return null; return ( -
- - - - {user.displayName.slice(0, 2).toUpperCase()} - - - -
+ + + @@ -122,7 +116,7 @@ export function CommentBox({ bugPrefix, bugStatus, ref_ }: CommentBoxProps) { Comment
-
- + + ); } diff --git a/webui2/src/components/bugs/LabelEditor.tsx b/webui2/src/components/bugs/LabelEditor.tsx index b3760170f57c217547b9ef43f81087455b68e5ca..b47bc4c18ba7800b204b8915e064dc6fbea56d4a 100644 --- a/webui2/src/components/bugs/LabelEditor.tsx +++ b/webui2/src/components/bugs/LabelEditor.tsx @@ -2,6 +2,7 @@ import { Settings2 } from "lucide-react"; import { useBugChangeLabelsMutation, BugDetailDocument } from "@/__generated__/graphql"; import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { SectionHeading } from "@/components/ui/section-heading"; import { useAuth } from "@/lib/auth"; import { LabelBadge } from "./LabelBadge"; @@ -42,9 +43,7 @@ export function LabelEditor({ bugPrefix, currentLabels, ref_, validLabels }: Lab return (
-

- Labels -

+ Labels {user && validLabels.length > 0 && ( diff --git a/webui2/src/components/bugs/Timeline.tsx b/webui2/src/components/bugs/Timeline.tsx index 35e7989bd1e99f3c3059ce25b1f6c0e17b87e582..7ec70ec94c4038c818221a94987cf9fc936aacb5 100644 --- a/webui2/src/components/bugs/Timeline.tsx +++ b/webui2/src/components/bugs/Timeline.tsx @@ -10,8 +10,8 @@ import { BugDetailDocument, } from "@/__generated__/graphql"; import { Markdown } from "@/components/content/Markdown"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; +import * as CommentCard from "@/components/ui/comment-card"; import { Textarea } from "@/components/ui/textarea"; import { useAuth } from "@/lib/auth"; @@ -94,16 +94,10 @@ function CommentItem({ const canEdit = user !== null && user.id === item.author.id; return ( -
- - - - {item.author.displayName.slice(0, 2).toUpperCase()} - - - -
-
+ + + + )} -
+ {editing ? (
- {/* Ctrl/Cmd+Enter saves; Escape cancels — standard editor shortcuts */}