@@ -1741,7 +1741,8 @@ const TimelineRowContent = memo(function TimelineRowContent({ row }: { row: Time
17411741 row . kind === "work-toggle" ||
17421742 row . kind === "thinking" ;
17431743 const isExpandedToolGroupHeader =
1744- ( row . kind === "work-toggle" && row . expanded ) || ( row . kind === "work-live" && row . expanded ) ;
1744+ ( row . kind === "work-toggle" || row . kind === "work-live" || row . kind === "thinking" ) &&
1745+ row . expanded === true ;
17451746
17461747 return (
17471748 < div
@@ -1793,7 +1794,7 @@ const TimelineRowContent = memo(function TimelineRowContent({ row }: { row: Time
17931794 ) : null }
17941795 { row . kind === "work-live" ? < LiveWorkEntryTimelineRow row = { row } /> : null }
17951796 { row . kind === "work-toggle" ? < WorkGroupToggleTimelineRow row = { row } /> : null }
1796- { row . kind === "thinking" ? < ThinkingTimelineRow /> : null }
1797+ { row . kind === "thinking" ? < ThinkingTimelineRow row = { row } /> : null }
17971798 </ WorkLogBlock >
17981799 ) : null }
17991800 { row . kind === "turn-fold" ? < TurnFoldTimelineRow row = { row } /> : null }
@@ -3461,13 +3462,23 @@ function CompactingLabel() {
34613462 ) ;
34623463}
34633464
3464- function ThinkingTimelineRow ( ) {
3465+ function ThinkingTimelineRow ( { row } : { row : Extract < TimelineRow , { kind : "thinking" } > } ) {
3466+ const ctx = use ( TimelineRowCtx ) ;
34653467 const { isCompacting, isPreparingWorktree } = use ( TimelineRowActivityCtx ) ;
34663468 // Reserve the activity row during setup so the handoff keeps the same height.
3467- return isPreparingWorktree || isCompacting ? (
3468- < WorkLogRow label = "" />
3469- ) : (
3470- < LiveActivityRow label = "Thinking" iconName = "brain" active shimmer />
3469+ if ( isPreparingWorktree || isCompacting ) return < WorkLogRow label = "" /> ;
3470+ const activity = < LiveActivityRow label = "Thinking" iconName = "brain" active shimmer /> ;
3471+ const { groupId } = row ;
3472+ if ( groupId === undefined ) return activity ;
3473+ return (
3474+ < button
3475+ type = "button"
3476+ className = "group/live-work flex min-h-6 w-full max-w-full cursor-pointer items-center rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70"
3477+ aria-expanded = { row . expanded === true }
3478+ onClick = { ( ) => ctx . onToggleWorkGroup ( groupId , row . id ) }
3479+ >
3480+ { activity }
3481+ </ button >
34713482 ) ;
34723483}
34733484
0 commit comments