From e92de3f3002fd8923bb7ee702166c316b3032b2b Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" <215916821+open-swe[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 19:21:35 +0000 Subject: [PATCH] feat: Update conversation summary and pull request components styling (#607) * Apply patch [skip ci] * Apply patch [skip ci] * Apply patch [skip ci] * Apply patch [skip ci] * Empty commit to trigger CI * cr --------- Co-authored-by: open-swe[bot] Co-authored-by: bracesproul --- .../gen-ui/conversation-summary.tsx | 77 +++++-- .../components/gen-ui/pull-request-opened.tsx | 211 ++++++++++-------- 2 files changed, 170 insertions(+), 118 deletions(-) diff --git a/apps/web/src/components/gen-ui/conversation-summary.tsx b/apps/web/src/components/gen-ui/conversation-summary.tsx index ecdb72dd..dd9e4427 100644 --- a/apps/web/src/components/gen-ui/conversation-summary.tsx +++ b/apps/web/src/components/gen-ui/conversation-summary.tsx @@ -1,7 +1,9 @@ -import { FileText, ChevronDown, ChevronRight } from "lucide-react"; +import { FileText, ChevronDown, Check } from "lucide-react"; import { useState } from "react"; import { MarkdownText } from "../thread/markdown-text"; -import { ToolIconWithTooltip } from "./tool-icon-tooltip"; +import { cn } from "@/lib/utils"; +import { Button } from "../ui/button"; +import { Badge } from "../ui/badge"; /** * ConversationHistorySummary component for rendering conversation history summaries @@ -11,32 +13,59 @@ export function ConversationHistorySummary({ summary }: { summary: string }) { const [expanded, setExpanded] = useState(true); return ( -
-
-
-
- } - /> - Conversation Summary -
- +
+ {/* Header */} +
+
+
+ +
+
+

+ Conversation Summary +

+ + + Complete + +
+

+ Summary of the conversation history +

+
+ +
+ {/* Content */} {expanded && ( -
+
{summary}
diff --git a/apps/web/src/components/gen-ui/pull-request-opened.tsx b/apps/web/src/components/gen-ui/pull-request-opened.tsx index 95bce078..f9458174 100644 --- a/apps/web/src/components/gen-ui/pull-request-opened.tsx +++ b/apps/web/src/components/gen-ui/pull-request-opened.tsx @@ -4,19 +4,15 @@ import { useState } from "react"; import { GitPullRequest, Loader2, - CheckCircle, ChevronDown, - ChevronUp, ExternalLink, GitPullRequestDraft, + Clock, + Check, } from "lucide-react"; import { cn } from "@/lib/utils"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "../ui/tooltip"; +import { Button } from "../ui/button"; +import { Badge } from "../ui/badge"; type PullRequestOpenedProps = { status: "loading" | "generating" | "done"; @@ -41,31 +37,69 @@ export function PullRequestOpened({ }: PullRequestOpenedProps) { const [expanded, setExpanded] = useState(false); - const getStatusIcon = () => { + const getStatusBadge = () => { switch (status) { case "loading": return ( -
+ + + Preparing + ); case "generating": return ( - + + + Opening + ); case "done": - return ; + if (isDraft) { + return ( + + + Draft + + ); + } + return ( + + + Opened + + ); } }; const getStatusText = () => { + if (status === "done" && prNumber && !isDraft) { + return `Pull request #${prNumber}`; + } + return isDraft + ? `Draft pull request${prNumber ? ` #${prNumber}` : ""}` + : `Pull request${prNumber ? ` #${prNumber}` : ""}`; + }; + + const getSubtitleText = () => { switch (status) { case "loading": - return "Preparing pull request..."; + return "Preparing to open pull request..."; case "generating": - return "Opening pull request..."; + return "Opening pull request on GitHub..."; case "done": - return prNumber - ? `Pull request #${prNumber} opened` - : "Pull request opened"; + return branch ? `${branch} → ${targetBranch}` : "Successfully opened"; } }; @@ -73,98 +107,87 @@ export function PullRequestOpened({ return status === "done" && description; }; - const iconClassName = "mr-2 h-3.5 w-3.5"; - - const getIconWithTooltip = () => { - return ( - - - - {isDraft && ( - - )} - {!isDraft && ( - - )} - - - {isDraft ? "Opened draft pull request" : "Opened pull request"} - - - - ); - }; - return ( -
-
- {getIconWithTooltip()} -
- {title && status === "done" && ( -
- {title} -
- )} - {branch && status === "done" && ( -
- {branch} → {targetBranch} -
- )} - {!title && ( - - {getStatusText()} - +
+ {/* Header */} +
+
+ {isDraft ? ( + + ) : ( + )}
+ +
+
+

+ {title || getStatusText()} +

+ {getStatusBadge()} +
+

+ {getSubtitleText()} +

+
+
- - {getStatusText()} - - {getStatusIcon()} {url && status === "done" && ( - - - + + + + )} {shouldShowToggle() && ( - + + )}
+ {/* Content */} {expanded && description && status === "done" && ( -
-

- Description -

-
-            {description}
-          
+
+
+

+ Description +

+
+              {description}
+            
+
)}