fix(ui): separate runtime closure from receipt progress
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m14s
CD Pipeline / build-and-deploy (push) Successful in 5m4s
CD Pipeline / post-deploy-checks (push) Has been cancelled

This commit is contained in:
ogt
2026-07-10 15:41:04 +08:00
parent 11b88176ed
commit 7134ff338e
3 changed files with 19 additions and 9 deletions

View File

@@ -12135,8 +12135,8 @@
"deployDetail": "CD / readback{status}",
"runtime": "Runtime DB",
"runtimeDetail": "marker{marker}",
"workItems": "工作完成",
"workItemsDetail": "完成度 {percent}%",
"workItems": "Work-item receipts",
"workItemsDetail": "Runtime closure {percent}%",
"sources": "Log 來源",
"sourcesDetail": "專案 / 產品 / 網站 / 服務 / 套件 / 工具",
"events": "分類事件",

View File

@@ -12135,8 +12135,8 @@
"deployDetail": "CD / readback{status}",
"runtime": "Runtime DB",
"runtimeDetail": "marker{marker}",
"workItems": "工作完成",
"workItemsDetail": "完成度 {percent}%",
"workItems": "工作項收據",
"workItemsDetail": "runtime 閉環 {percent}%",
"sources": "Log 來源",
"sourcesDetail": "專案 / 產品 / 網站 / 服務 / 套件 / 工具",
"events": "分類事件",

View File

@@ -173,6 +173,7 @@ type RuntimeControlPayload = {
program_status?: {
implementation_completion_percent?: number | null;
deploy_readback_marker?: string | null;
can_claim_autonomous_loop_complete?: boolean | null;
} | null;
current_policy?: {
low_risk_controlled_apply_allowed?: boolean | null;
@@ -925,7 +926,12 @@ export function AutonomousRuntimeReceiptPanel({
const workCompleted = toNumber(rollups.live_work_item_completed_count ?? workItemRollups.completed_count);
const orderedWorkTotal = toNumber(workItemRollups.ordered_work_item_count ?? orderedWorkItems.length);
const sourceFamilyTotal = toNumber(workItemRollups.source_family_work_item_count ?? sourceFamilyItems.length);
const workCompletionPercent = workTotal > 0
const runtimeClosurePercent = toNumber(
payload?.program_status?.implementation_completion_percent
);
const runtimeClosureClosed =
payload?.program_status?.can_claim_autonomous_loop_complete === true;
const workItemReceiptPercent = workTotal > 0
? Math.min(100, Math.round((workCompleted / workTotal) * 100))
: 0;
const prioritySummary = priorityPayload?.summary;
@@ -938,7 +944,11 @@ export function AutonomousRuntimeReceiptPanel({
const deployReadbackResolved = prioritySummary?.ai_loop_current_blocker_deploy_marker_resolved_by_production_readback === true;
const deployCardTone: Tone = !hasPriorityReadback ? "neutral" : deployReadbackResolved ? "ok" : "warn";
const runtimeCardTone: Tone = !hasRuntimeReadback ? "neutral" : dbOk ? "ok" : "warn";
const workCardTone: Tone = !hasRuntimeReadback ? "neutral" : workTotal > 0 && workCompleted === workTotal ? "ok" : "warn";
const workCardTone: Tone = !hasRuntimeReadback
? "neutral"
: runtimeClosureClosed
? "ok"
: "warn";
const sourceCardTone: Tone = !hasRuntimeReadback
? "neutral"
: toNumber(rollups.live_log_active_source_family_count ?? logRollups.active_source_family_count) > 0
@@ -978,7 +988,7 @@ export function AutonomousRuntimeReceiptPanel({
label: t("proof.workItems"),
value: readbackRatio(workCompleted, workTotal, hasRuntimeReadback),
detail: t("proof.workItemsDetail", {
percent: readbackNumber(workCompletionPercent, hasRuntimeReadback),
percent: readbackNumber(runtimeClosurePercent, hasRuntimeReadback),
}),
icon: ListChecks,
tone: workCardTone,
@@ -2096,13 +2106,13 @@ export function AutonomousRuntimeReceiptPanel({
total: readbackNumber(workTotal, hasRuntimeReadback),
})}</span>
<span className="font-mono text-[#141413]">
{hasRuntimeReadback ? `${workCompletionPercent}%` : "--"}
{hasRuntimeReadback ? `${workItemReceiptPercent}%` : "--"}
</span>
</div>
<div className="mt-2 h-2 border border-[#d8d3c7] bg-[#faf9f3]">
<div
className="h-full bg-[#17602a]"
style={{ width: hasRuntimeReadback ? `${workCompletionPercent}%` : "0%" }}
style={{ width: hasRuntimeReadback ? `${workItemReceiptPercent}%` : "0%" }}
/>
</div>
</div>