@@ -9,6 +9,7 @@ import { Card } from "../../components/ui/card";
99import RunList from "../../components/RunList" ;
1010import { fetchRuns } from "../../lib/api" ;
1111import { safeLoad } from "../../lib/serverPageData" ;
12+ import { statusVariant } from "../../lib/statusPresentation" ;
1213
1314type RunsPageProps = {
1415 searchParams ?: Promise < Record < string , string | string [ ] | undefined > > ;
@@ -40,6 +41,11 @@ export default async function RunsPage({ searchParams }: RunsPageProps) {
4041 const failed = runs . filter ( ( run ) => String ( run . status || "" ) . toUpperCase ( ) . includes ( "FAIL" ) ) . length ;
4142 const success = runs . filter ( ( run ) => [ "SUCCESS" , "DONE" , "PASSED" ] . includes ( String ( run . status || "" ) . toUpperCase ( ) ) ) . length ;
4243 const running = Math . max ( runs . length - failed - success , 0 ) ;
44+ const proofReady = runs . filter ( ( run ) => {
45+ const outcomeType = String ( run . outcome_type || "" ) . trim ( ) . toLowerCase ( ) ;
46+ return statusVariant ( run . status ) === "success" || [ "proof_ready" , "share_ready" , "release_ready" ] . includes ( outcomeType ) ;
47+ } ) . length ;
48+ const hintedRuns = runs . filter ( ( run ) => String ( run . action_hint_zh || "" ) . trim ( ) ) . length ;
4349 const failureRate = runs . length > 0 ? failed / runs . length : 0 ;
4450 const highFailureMode = failed > 0 && failureRate >= 0.5 ;
4551 const distributionHeadline = highFailureMode
@@ -63,6 +69,9 @@ export default async function RunsPage({ searchParams }: RunsPageProps) {
6369 const governanceSubline = failed > 0
6470 ? runsPageCopy . operatorPrioritySubline
6571 : runsPageCopy . operatorPriorityClearSubline ;
72+ const operatorDeskNote = locale === "zh-CN"
73+ ? `当前首屏把 ${ proofReady } 个 proof-ready run 和 ${ hintedRuns } 个带 action hint 的 run 放回同一张 operator list,不再只把 Runs 当失败分诊表。`
74+ : `This first screen keeps ${ proofReady } proof-ready runs and ${ hintedRuns } runs with explicit operator hints in the same operator list, so Proof & Replay is not reduced to a failure queue.` ;
6675 return (
6776 < main className = "grid" aria-labelledby = "runs-page-title" >
6877 < header className = "app-section" >
@@ -82,6 +91,29 @@ export default async function RunsPage({ searchParams }: RunsPageProps) {
8291 < p className = "mono muted" > { warning } </ p >
8392 </ Card >
8493 ) : null }
94+ < Card variant = "compact" >
95+ < p className = "mono muted" > { operatorDeskNote } </ p >
96+ </ Card >
97+ < div className = "toolbar toolbar--mt" role = "group" aria-label = { runsPageCopy . filterAriaLabel } >
98+ < Button asChild variant = { statusFilter === "" ? "default" : "ghost" } >
99+ < Link href = "/runs" > { runsPageCopy . filters . all } </ Link >
100+ </ Button >
101+ < Button asChild variant = { statusFilter === "FAILED" ? "warning" : "ghost" } >
102+ < Link href = "/runs?status=FAILED" > { runsPageCopy . filters . failed } </ Link >
103+ </ Button >
104+ < Button asChild variant = { statusFilter === "RUNNING" ? "secondary" : "ghost" } >
105+ < Link href = "/runs?status=RUNNING" > { runsPageCopy . filters . running } </ Link >
106+ </ Button >
107+ < Button asChild variant = { statusFilter === "SUCCESS" ? "secondary" : "ghost" } >
108+ < Link href = "/runs?status=SUCCESS" > { runsPageCopy . filters . success } </ Link >
109+ </ Button >
110+ </ div >
111+ { runs . length > visibleRuns . length ? (
112+ < p className = "mono muted" role = "status" >
113+ { runsPageCopy . firstScreenLimit ( visibleRuns . length ) }
114+ </ p >
115+ ) : null }
116+ < RunList runs = { visibleRuns } locale = { locale } />
85117 < div className = "stats-grid" >
86118 < Card asChild variant = "metric" >
87119 < article >
@@ -115,26 +147,6 @@ export default async function RunsPage({ searchParams }: RunsPageProps) {
115147 </ article >
116148 </ Card >
117149 </ div >
118- < div className = "toolbar toolbar--mt" role = "group" aria-label = { runsPageCopy . filterAriaLabel } >
119- < Button asChild variant = { statusFilter === "" ? "default" : "ghost" } >
120- < Link href = "/runs" > { runsPageCopy . filters . all } </ Link >
121- </ Button >
122- < Button asChild variant = { statusFilter === "FAILED" ? "warning" : "ghost" } >
123- < Link href = "/runs?status=FAILED" > { runsPageCopy . filters . failed } </ Link >
124- </ Button >
125- < Button asChild variant = { statusFilter === "RUNNING" ? "secondary" : "ghost" } >
126- < Link href = "/runs?status=RUNNING" > { runsPageCopy . filters . running } </ Link >
127- </ Button >
128- < Button asChild variant = { statusFilter === "SUCCESS" ? "secondary" : "ghost" } >
129- < Link href = "/runs?status=SUCCESS" > { runsPageCopy . filters . success } </ Link >
130- </ Button >
131- </ div >
132- { runs . length > visibleRuns . length ? (
133- < p className = "mono muted" role = "status" >
134- { runsPageCopy . firstScreenLimit ( visibleRuns . length ) }
135- </ p >
136- ) : null }
137- < RunList runs = { visibleRuns } locale = { locale } />
138150 </ section >
139151 </ main >
140152 ) ;
0 commit comments