@@ -7,7 +7,7 @@ import { useTranslation } from "react-i18next"
77import { vscode } from "@/utils/vscode"
88import { formatLargeNumber } from "@/utils/format"
99import { calculateTokenDistribution , getMaxTokensForModel } from "@/utils/model-utils"
10- import { Button } from "@/components/ui"
10+ import { Button , Badge } from "@/components/ui"
1111
1212import { ClineMessage } from "../../../../src/shared/ExtensionMessage"
1313import { mentionRegexGlobal } from "../../../../src/shared/context-mentions"
@@ -17,6 +17,7 @@ import { useExtensionState } from "../../context/ExtensionStateContext"
1717import Thumbnails from "../common/Thumbnails"
1818import { normalizeApiConfiguration } from "../settings/ApiOptions"
1919import { DeleteTaskDialog } from "../history/DeleteTaskDialog"
20+ import { cn } from "@/lib/utils"
2021
2122interface TaskHeaderProps {
2223 task : ClineMessage
@@ -55,10 +56,22 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
5556 const shouldShowPromptCacheInfo = doesModelSupportPromptCache && apiConfiguration ?. apiProvider !== "openrouter"
5657
5758 return (
58- < div className = "py-[10px] px-[13px] " >
59+ < div className = "py-2 px-3 " >
5960 < div
60- className = { `rounded p-[10px] flex flex-col gap-[6px] relative z-1 outline hover:outline-vscode-badge-foreground hover:text-vscode-badge-foreground transition-color duration-500 ${ ! ! isTaskExpanded ? "outline-vscode-badge-foreground text-vscode-badge-foreground" : "outline-vscode-badge-foreground/80 text-vscode-badge-foreground/80" } ` } >
61- < div className = "flex justify-between items-center" >
61+ className = { cn (
62+ "rounded p-[10px] flex flex-col gap-[6px] relative z-1 outline" ,
63+ ! ! isTaskExpanded
64+ ? "outline-vscode-panel-border text-vscode-foreground"
65+ : "outline-vscode-panel-border/80 text-vscode-foreground/80" ,
66+ ) } >
67+ < VSCodeButton
68+ appearance = "icon"
69+ onClick = { onClose }
70+ className = "absolute top-1 right-1 text-vscode-foreground"
71+ title = { t ( "chat:task.closeAndStart" ) } >
72+ < span className = "codicon codicon-close" > </ span >
73+ </ VSCodeButton >
74+ < div className = "flex justify-between items-center mr-4" >
6275 < div
6376 className = "flex items-center cursor-pointer -ml-0.5 select-none grow min-w-0"
6477 onClick = { ( ) => setIsTaskExpanded ( ! isTaskExpanded ) } >
@@ -73,14 +86,6 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
7386 { ! isTaskExpanded && < span className = "ml-1" > { highlightMentions ( task . text , false ) } </ span > }
7487 </ div >
7588 </ div >
76-
77- < VSCodeButton
78- appearance = "icon"
79- onClick = { onClose }
80- className = "ml-1.5 shrink-0 text-vscode-badge-foreground"
81- title = { t ( "chat:task.closeAndStart" ) } >
82- < span className = "codicon codicon-close" > </ span >
83- </ VSCodeButton >
8489 </ div >
8590 { /* Collapsed state: Track context and cost if we have any */ }
8691 { ! isTaskExpanded && contextWindow > 0 && (
@@ -90,11 +95,7 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
9095 contextTokens = { contextTokens || 0 }
9196 maxTokens = { getMaxTokensForModel ( selectedModelInfo , apiConfiguration ) }
9297 />
93- { ! ! totalCost && (
94- < div className = "ml-2.5 bg-vscode-editor-foreground text-vscode-editor-background py-0.5 px-1 rounded-full text-[11px] font-medium inline-block shrink-0" >
95- ${ totalCost ?. toFixed ( 2 ) }
96- </ div >
97- ) }
98+ { ! ! totalCost && < Badge variant = "secondary" > ${ totalCost ?. toFixed ( 2 ) } </ Badge > }
9899 </ div >
99100 ) }
100101 { /* Expanded state: Show task text and images */ }
0 commit comments