@@ -8,6 +8,8 @@ import { useState } from 'react';
88import { ResumeRunActions } from '~/components/ResumeRunActions' ;
99import { RunDetail } from '~/components/RunDetail' ;
1010import { RunEvalModal } from '~/components/RunEvalModal' ;
11+ import { RunStatusIndicator } from '~/components/RunStatusIndicator' ;
12+ import { StopRunButton } from '~/components/StopRunButton' ;
1113import { useProjectRunDetail , useStudioConfig } from '~/lib/api' ;
1214
1315export const Route = createFileRoute ( '/projects/$projectId_/runs/$runId' ) ( {
@@ -47,6 +49,8 @@ function ProjectRunDetailPage() {
4749 const experiment = firstResult ?. experiment ;
4850 const timestamp = firstResult ?. timestamp ;
4951 const prefill = target ? { target } : undefined ;
52+ const runStatus = data ?. status ;
53+ const isActiveRun = runStatus === 'starting' || runStatus === 'running' ;
5054
5155 const heading = ( ( ) => {
5256 const parts = [ experiment , target ] . filter ( ( p ) => p && p !== 'default' ) ;
@@ -70,16 +74,27 @@ function ProjectRunDetailPage() {
7074 < p className = "mt-1 text-sm text-gray-500" > { meta } </ p >
7175 </ div >
7276 < div className = "flex items-center gap-3" >
73- < ResumeRunActions
74- results = { data ?. results ?? [ ] }
75- runDir = { data ?. run_dir }
76- suiteFilter = { data ?. suite_filter }
77- target = { target ?? undefined }
78- projectId = { projectId }
79- isReadOnly = { isReadOnly }
80- plannedTestCount = { data ?. planned_test_count }
81- />
82- { ! isReadOnly && (
77+ { ! isReadOnly && isActiveRun ? (
78+ < StopRunButton
79+ runId = { runId }
80+ status = { runStatus }
81+ isReadOnly = { isReadOnly }
82+ projectId = { projectId }
83+ />
84+ ) : (
85+ < ResumeRunActions
86+ results = { data ?. results ?? [ ] }
87+ runDir = { data ?. run_dir }
88+ suiteFilter = { data ?. suite_filter }
89+ target = { target ?? undefined }
90+ projectId = { projectId }
91+ isReadOnly = { isReadOnly }
92+ plannedTestCount = { data ?. planned_test_count }
93+ runStatus = { runStatus }
94+ />
95+ ) }
96+ { runStatus && < RunStatusIndicator status = { runStatus } /> }
97+ { ! isReadOnly && ! isActiveRun && (
8398 < button
8499 type = "button"
85100 onClick = { ( ) => setShowRunEval ( true ) }
0 commit comments