Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/codex/codex-child-work-evidence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import type { AgentChildWorkEvidence } from '../../shared/agent-status-child-wor
import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation'
import {
agentChildWorkOwnedLiveness,
deriveAgentChildDisplayState,
projectAgentChildWorkViews
} from '../../shared/agent-status-child-work-view'
deriveAgentChildDisplayState
} from '../../shared/agent-status-child-work-display'
import { projectAgentChildWorkViews } from '../../shared/agent-status-child-work-view'
import { createAgentStatusStore } from '../../shared/agent-status-store'
import { makeStructuredAgentStatusSubject } from '../../shared/agent-status-subject'
import type { CodexBackgroundTaskEvent } from './codex-background-task-frames'
Expand Down
6 changes: 3 additions & 3 deletions src/main/codex/codex-structured-child-work-producer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { agentChildWorkLiveness } from '../../shared/agent-status-child-work-liv
import { reconcileAgentChildWorkEvidence } from '../../shared/agent-status-child-work-reconciliation'
import {
agentChildWorkOwnedLiveness,
deriveAgentChildDisplayState,
projectAgentChildWorkViews
} from '../../shared/agent-status-child-work-view'
deriveAgentChildDisplayState
} from '../../shared/agent-status-child-work-display'
import { projectAgentChildWorkViews } from '../../shared/agent-status-child-work-view'
import { createAgentStatusStore } from '../../shared/agent-status-store'
import { agentJournalLinkageFields } from '../../shared/agent-session-journal-producer'
import type {
Expand Down
58 changes: 58 additions & 0 deletions src/renderer/src/components/AgentChildRowContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react'
import type { AgentChildRowModel } from '../../../shared/agent-child-row-model'
import { AgentStateDot } from '@/components/AgentStateDot'
import type { StateIndicatorTooltipSide } from '@/components/StateIndicatorTooltip'
import { agentChildRowText } from './agent-child-row-text'

type AgentChildRowContentProps = {
row: AgentChildRowModel
now: number
/** Surface tone for the name and the detail; the words themselves are the row's. */
leadClassName: string
trailClassName: string
separator: string
/** Overrides the dot's hover label; null suppresses it for an existing tooltip. */
dotTitle?: string | null
tooltipSide?: StateIndicatorTooltipSide
/** Name the whole line on hover, for surfaces that truncate it tightly. */
lineTitle?: boolean
}

/**
* A child row's state dot, name and detail: the one piece the sidebar's child rows and the chat
* strip's rows both render, so the same child reads the same on both.
*/
export const AgentChildRowContent = React.memo(function AgentChildRowContent({
row,
now,
leadClassName,
trailClassName,
separator,
dotTitle,
tooltipSide,
lineTitle = false
}: AgentChildRowContentProps): React.JSX.Element {
const { lead, trail } = agentChildRowText(row, now)
return (
<>
<AgentStateDot
state={row.displayState}
size="sm"
title={dotTitle}
tooltipSide={tooltipSide}
/>
<span
className="min-w-0 flex-1 truncate"
title={lineTitle ? `${lead}${trail ? `${separator}${trail}` : ''}` : undefined}
>
<span className={leadClassName}>{lead}</span>
{trail ? (
<span className={trailClassName}>
{separator}
{trail}
</span>
) : null}
</span>
</>
)
})
Loading
Loading