refactor(views): triggered-by back on the identity row, labeled toolbar facts

- The accountable human returns to the identity row next to the trigger
  mechanism (status · agent · trigger · person), where it's visible
  rather than buried in the ⓘ popover.
- Toolbar facts now carry explicit labels — "Created <time> · Took
  <duration> · N events" — instead of bare values the reader had to
  infer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing
2026-07-24 15:17:23 +08:00
parent 38a985a7bd
commit 56b2e196a0
5 changed files with 33 additions and 31 deletions

View File

@@ -485,11 +485,10 @@ export function AgentTranscriptDialog({
const createdLabel = task.created_at ? formatRunTime(task.created_at) : null;
const startedLabel = task.started_at ? formatRunTime(task.started_at) : null;
const completedLabel = task.completed_at ? formatRunTime(task.completed_at) : null;
// "When did this run happen" — a read-before-you-read fact worth the toolbar
// "When was this run created" — a read-before-you-read fact worth the toolbar
// surface (the ⓘ popover keeps the full-precision created/started/completed).
const whenSource = task.started_at ?? task.created_at ?? null;
const whenLabel = whenSource
? new Date(whenSource).toLocaleString(undefined, {
const createdShort = task.created_at
? new Date(task.created_at).toLocaleString(undefined, {
month: "short",
day: "numeric",
hour: "2-digit",
@@ -498,7 +497,6 @@ export function AgentTranscriptDialog({
: null;
const hasTriggeredBy = !!task.attribution?.initiator;
const hasRunDetails =
hasTriggeredBy ||
!!runtimeInfo ||
!!task.relative_work_dir ||
!!createdLabel ||
@@ -533,10 +531,19 @@ export function AgentTranscriptDialog({
{agentName || agentInfo?.name || ""}
</span>
</div>
{/* Trigger mechanism (why this run exists). The accountable
human is audit metadata, not read-time context — it lives in
the ⓘ popover as "triggered by", not on this row. */}
{/* Why this run exists: the trigger mechanism plus the
accountable human who's answerable for what the agent did. */}
<span className="shrink-0 text-xs text-muted-foreground">{triggerLabel}</span>
{hasTriggeredBy && (
<>
<FactDot />
<AttributionBadge
attribution={task.attribution}
variant="inline"
className="min-w-0"
/>
</>
)}
</div>
<div className="flex shrink-0 items-center gap-0.5">
@@ -560,14 +567,6 @@ export function AgentTranscriptDialog({
{t(($) => $.transcript.run_info)}
</div>
<div className="space-y-1 text-xs">
{hasTriggeredBy && (
<div className="grid grid-cols-[4.5rem_minmax(0,1fr)] items-center gap-3">
<span className="text-muted-foreground">
{t(($) => $.transcript.details_triggered_by)}
</span>
<AttributionBadge attribution={task.attribution} variant="inline" />
</div>
)}
{runtimeInfo && (
<RunDetailRow label={t(($) => $.transcript.details_runtime)} value={runtimeInfo.name} />
)}
@@ -618,19 +617,18 @@ export function AgentTranscriptDialog({
instead of leaving dead space. ── */}
<div className="flex items-center gap-3 border-b px-4 py-1.5 shrink-0">
<div className="flex min-w-0 flex-1 items-center gap-x-1.5 overflow-hidden whitespace-nowrap text-xs text-muted-foreground">
{whenLabel && (
{createdShort && (
<>
<span>{whenLabel}</span>
<span>{t(($) => $.transcript.fact_created, { time: createdShort })}</span>
<FactDot />
</>
)}
{duration && (
<span className="inline-flex items-center gap-1">
<Clock className="h-3 w-3" />
{duration}
</span>
<>
<span>{t(($) => $.transcript.fact_took, { duration })}</span>
<FactDot />
</>
)}
{duration && <FactDot />}
<span>
{activeFilterKeys.length > 0
? t(($) => $.transcript.events_filtered, { shown: filteredItems.length, total: items.length })

View File

@@ -808,8 +808,9 @@
"details_started": "Started",
"details_completed": "Completed",
"copy_workdir": "Copy working directory",
"details_triggered_by": "Triggered by",
"close": "Close"
"close": "Close",
"fact_created": "Created {{time}}",
"fact_took": "Took {{duration}}"
},
"task_failure": {
"agent_error": "Agent execution error",

View File

@@ -688,8 +688,9 @@
"details_started": "開始",
"details_completed": "完了",
"copy_workdir": "作業ディレクトリをコピー",
"details_triggered_by": "トリガー",
"close": "閉じる"
"close": "閉じる",
"fact_created": "作成 {{time}}",
"fact_took": "所要 {{duration}}"
},
"task_failure": {
"agent_error": "エージェント実行エラー",

View File

@@ -696,8 +696,9 @@
"details_started": "시작",
"details_completed": "완료",
"copy_workdir": "작업 디렉터리 복사",
"details_triggered_by": "트리거한 사람",
"close": "닫기"
"close": "닫기",
"fact_created": "생성 {{time}}",
"fact_took": "소요 {{duration}}"
},
"task_failure": {
"agent_error": "에이전트 실행 오류",

View File

@@ -792,8 +792,9 @@
"details_started": "开始",
"details_completed": "完成",
"copy_workdir": "复制工作目录",
"details_triggered_by": "触发人",
"close": "关闭"
"close": "关闭",
"fact_created": "创建于 {{time}}",
"fact_took": "用时 {{duration}}"
},
"task_failure": {
"agent_error": "智能体执行出错",