(props: {
readonly task: HeadlessTaskRecord;
readonly onOpenAsSession: (t: HeadlessTaskRecord) => void;
})
| 546 | } |
| 547 | |
| 548 | function HeadlessTaskRow(props: { |
| 549 | readonly task: HeadlessTaskRecord; |
| 550 | readonly onOpenAsSession: (t: HeadlessTaskRecord) => void; |
| 551 | }): ReactElement { |
| 552 | const t = props.task; |
| 553 | const openable = t.status !== 'running' && !!t.agentSessionId; |
| 554 | const titleParts = [`${t.agent} · ${t.status}`, formatRelativeTime(t.startedAt)]; |
| 555 | if (t.error) titleParts.push(t.error); |
| 556 | titleParts.push(t.prompt); |
| 557 | |
| 558 | return ( |
| 559 | <div className="group flex items-center gap-1.5 pl-3 pr-2 py-1 text-[11px]" title={titleParts.join('\n')}> |
| 560 | <span className={`shrink-0 w-1.5 h-1.5 rounded-full ${HEADLESS_DOT_CLASS[t.status]}`} aria-label={t.status} /> |
| 561 | <span className="shrink-0 flex items-center justify-center w-3.5 text-text-muted/50"> |
| 562 | <AgentBadgeGlyph agentId={t.agent} /> |
| 563 | </span> |
| 564 | <span className="flex-1 truncate text-text-muted">{t.prompt}</span> |
| 565 | {openable && ( |
| 566 | <button |
| 567 | type="button" |
| 568 | className={`${rowAction()} opacity-0 group-hover:opacity-100 focus-visible:opacity-100`} |
| 569 | title="open this run as an interactive session" |
| 570 | onClick={(e) => { |
| 571 | e.stopPropagation(); |
| 572 | props.onOpenAsSession(t); |
| 573 | }} |
| 574 | > |
| 575 | <ChevronRight size={12} strokeWidth={2.25} /> |
| 576 | </button> |
| 577 | )} |
| 578 | </div> |
| 579 | ); |
| 580 | } |
| 581 | |
| 582 | export interface SessionRowProps { |
| 583 | session: SessionRecord; |
nothing calls this directly
no test coverage detected