@@ -11,6 +11,7 @@ import {
1111 type RunStopPresentation ,
1212} from "@t3tools/client-runtime/state/thread-execution" ;
1313import { childThreadInputsTitle } from "@t3tools/client-runtime/state/threads" ;
14+ import { commandDisplayText } from "@t3tools/client-runtime/work-log/command-label" ;
1415import { formatDuration } from "@t3tools/shared/orchestrationTiming" ;
1516import * as DateTime from "effect/DateTime" ;
1617import {
@@ -25,7 +26,6 @@ import {
2526} from "lucide-react" ;
2627import { Fragment } from "react" ;
2728import { tickTextContent } from "~/lib/tickTextContent" ;
28- import { cn } from "~/lib/utils" ;
2929import { Button , InlineButton } from "../ui/button" ;
3030import { Tooltip , TooltipPopup , TooltipTrigger } from "../ui/tooltip" ;
3131import type { ComposerBannerStackItem } from "./ComposerBannerStack" ;
@@ -174,6 +174,16 @@ export function backgroundWorkNowItem(input: {
174174 const subagent = item ?. type === "subagent" ? item : undefined ;
175175 return {
176176 task,
177+ label :
178+ item ?. type === "command_execution" && commandDisplayText ( item . input ) === task . label ? (
179+ < span className = "font-mono in-data-[slot=popover-popup]:whitespace-pre-wrap" >
180+ { task . label }
181+ </ span >
182+ ) : task . label . includes ( "\n" ) ? (
183+ < span className = "in-data-[slot=popover-popup]:whitespace-pre-wrap" > { task . label } </ span >
184+ ) : (
185+ task . label
186+ ) ,
177187 activity : subagent ?. progress ?. replace ( / \s + / gu, " " ) . trim ( ) || null ,
178188 startedAtMs : item ?. startedAt ? DateTime . toEpochMillis ( item . startedAt ) : null ,
179189 updatedAtMs : subagent ? DateTime . toEpochMillis ( subagent . updatedAt ) : 0 ,
@@ -185,34 +195,32 @@ export function backgroundWorkNowItem(input: {
185195 . filter ( ( row ) => row . activity )
186196 . toSorted ( ( left , right ) => right . updatedAtMs - left . updatedAtMs ) [ 0 ] ;
187197 const isCommand = ( row : ( typeof rows ) [ number ] ) => row . task . kind !== "subagent" ;
188- const verb = presentation . waiting ? "Waiting on" : "Running" ;
189198 const onlyThreadId = only ?. childThreadId ;
190199 const startedAtMs = only ?. startedAtMs ?? null ;
191200 return {
192201 id : `background-work:${ input . threadId } ` ,
193202 icon : rows . every ( isCommand ) ? < TerminalIcon /> : < CircleDashedIcon /> ,
194- title : only ? (
195- < >
196- { verb } { " " }
197- < span
198- className = { cn (
199- isCommand ( only ) && "font-mono in-data-[slot=popover-popup]:whitespace-pre-wrap" ,
200- ) }
201- >
202- { only . task . label }
203- </ span >
204- </ >
205- ) : (
206- presentation . title
207- ) ,
203+ title :
204+ only && typeof only . label !== "string" && only . task . label !== only . task . kind ? (
205+ < >
206+ { presentation . waiting ? "Waiting" : "Running" } · { only . label }
207+ </ >
208+ ) : (
209+ presentation . title
210+ ) ,
208211 description : only ? (
209212 only . activity
210213 ) : newest ? (
211- ` ${ newest . task . label } : ${ newest . activity } `
212- ) : rows . every ( isCommand ) ? (
213- < span className = "font-mono" > { rows . map ( ( row ) => row . task . label ) . join ( ", " ) } </ span >
214+ < >
215+ { newest . label } : { newest . activity }
216+ </ >
214217 ) : (
215- rows . map ( ( row ) => row . task . label ) . join ( ", " )
218+ rows . map ( ( row , index ) => (
219+ < Fragment key = { row . task . taskId } >
220+ { index > 0 ? ", " : null }
221+ { row . label }
222+ </ Fragment >
223+ ) )
216224 ) ,
217225 actions : (
218226 < >
0 commit comments