@@ -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,14 @@ 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+ ) : (
183+ task . label
184+ ) ,
177185 activity : subagent ?. progress ?. replace ( / \s + / gu, " " ) . trim ( ) || null ,
178186 startedAtMs : item ?. startedAt ? DateTime . toEpochMillis ( item . startedAt ) : null ,
179187 updatedAtMs : subagent ? DateTime . toEpochMillis ( subagent . updatedAt ) : 0 ,
@@ -185,35 +193,29 @@ export function backgroundWorkNowItem(input: {
185193 . filter ( ( row ) => row . activity )
186194 . toSorted ( ( left , right ) => right . updatedAtMs - left . updatedAtMs ) [ 0 ] ;
187195 const isCommand = ( row : ( typeof rows ) [ number ] ) => row . task . kind !== "subagent" ;
188- const verb = presentation . waiting ? "Waiting on" : "Running" ;
189196 const onlyThreadId = only ?. childThreadId ;
190197 const startedAtMs = only ?. startedAtMs ?? null ;
191198 return {
192199 id : `background-work:${ input . threadId } ` ,
193200 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- ) ,
208- description : only ? (
209- only . activity
210- ) : 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- rows . map ( ( row ) => row . task . label ) . join ( ", " )
216- ) ,
201+ title :
202+ only && typeof only . label !== "string" ? (
203+ < >
204+ { presentation . waiting ? "Waiting" : "Running" } · { only . label }
205+ </ >
206+ ) : (
207+ presentation . title
208+ ) ,
209+ description : only
210+ ? only . activity
211+ : newest
212+ ? `${ newest . task . label } : ${ newest . activity } `
213+ : rows . map ( ( row , index ) => (
214+ < Fragment key = { row . task . taskId } >
215+ { index > 0 ? ", " : null }
216+ { row . label }
217+ </ Fragment >
218+ ) ) ,
217219 actions : (
218220 < >
219221 { startedAtMs === null ? null : (
0 commit comments