@@ -28,7 +28,10 @@ import {
2828 type NativeStudioApi ,
2929 type NativeTrainingMetricEvent ,
3030} from "./native" ;
31- import { studioWorkspaceFromNativeProjectDirectory } from "./native-project" ;
31+ import {
32+ studioCheckpointViewsFromNativeProjectDirectory ,
33+ studioWorkspaceFromNativeProjectDirectory ,
34+ } from "./native-project" ;
3235import { sampleWorkspace } from "./sample-workspace" ;
3336import { StudioViewportPanel } from "./StudioViewportPanel" ;
3437import "./styles.css" ;
@@ -301,6 +304,20 @@ export function App({
301304 setLoadError ( undefined ) ;
302305 }
303306
307+ function applyNativeProjectDirectory (
308+ directory : NativeCheckpointInferenceRunResult [ "project" ] ,
309+ options : { readonly runId ?: string ; readonly episodeId ?: string } = { } ,
310+ ) : StudioWorkspaceView {
311+ const nextWorkspace = studioWorkspaceFromNativeProjectDirectory ( directory , options ) ;
312+
313+ applyWorkspaceView ( nextWorkspace ) ;
314+ setCheckpointViews ( studioCheckpointViewsFromNativeProjectDirectory ( directory , nextWorkspace ) ) ;
315+ setLoadedProjectPath ( directory . path ) ;
316+ setLoadedSource ( directory . directoryName ) ;
317+
318+ return nextWorkspace ;
319+ }
320+
304321 function applyNativeTrainingResult ( result : NativeLocalTrainingRunResult ) {
305322 const trainingSession = result . trainingSession ;
306323
@@ -309,12 +326,8 @@ export function App({
309326 }
310327
311328 const runId = trainingSession . run ?. id ;
312- const nextWorkspace = studioWorkspaceFromNativeProjectDirectory (
313- result . project ,
314- runId === undefined ? { } : { runId } ,
315- ) ;
316329
317- applyWorkspaceView ( nextWorkspace ) ;
330+ applyNativeProjectDirectory ( result . project , runId === undefined ? { } : { runId } ) ;
318331 setTrainingSessionViews ( ( views ) => upsertTrainingSessionView ( views , trainingSession ) ) ;
319332 setSelectedTrainingSessionId ( trainingSession . id ) ;
320333
@@ -325,26 +338,20 @@ export function App({
325338 if ( runId !== undefined ) {
326339 setSelectedRunId ( runId ) ;
327340 }
328-
329- setLoadedProjectPath ( result . project . path ) ;
330- setLoadedSource ( result . project . directoryName ) ;
331341 }
332342
333343 function applyNativeCheckpointInferenceResult (
334344 result : NativeCheckpointInferenceRunResult ,
335345 checkpoint : StoredCheckpoint ,
336346 ) {
337- const nextWorkspace = studioWorkspaceFromNativeProjectDirectory ( result . project , {
347+ applyNativeProjectDirectory ( result . project , {
338348 runId : result . runId ,
339349 episodeId : result . episodeId ,
340350 } ) ;
341351
342- applyWorkspaceView ( nextWorkspace ) ;
343352 setSelectedRunId ( result . runId ) ;
344353 setSelectedEpisodeId ( result . episodeId ) ;
345354 setSelectedCheckpointKey ( checkpointKey ( checkpoint ) ) ;
346- setLoadedProjectPath ( result . project . path ) ;
347- setLoadedSource ( result . project . directoryName ) ;
348355 }
349356
350357 function ingestTrainingMetricEvent ( event : NativeTrainingMetricEvent ) {
@@ -395,9 +402,7 @@ export function App({
395402 return ;
396403 }
397404
398- applyStudioArtifact ( studioWorkspaceFromNativeProjectDirectory ( directory ) ) ;
399- setLoadedSource ( directory . directoryName ) ;
400- setLoadedProjectPath ( directory . path ) ;
405+ applyNativeProjectDirectory ( directory ) ;
401406 } catch ( error ) {
402407 setLoadError ( error instanceof Error ? error . message : String ( error ) ) ;
403408 }
@@ -613,7 +618,10 @@ export function App({
613618 < div className = "panel-heading" >
614619 < div >
615620 < h2 > { selectedHistoryRow ?. runId ?? "No run selected" } </ h2 >
616- < p > { selectedHistoryRow ?. algorithm ?? "No algorithm" } </ p >
621+ < p >
622+ { selectedHistoryRow ?. algorithm ?? "No algorithm" }
623+ { selectedHistoryRow === undefined ? "" : ` · ${ runModeLabel ( selectedHistoryRow ) } ` }
624+ </ p >
617625 </ div >
618626 < span className = { `status-pill ${ selectedHistoryRow ?. status ?? "created" } ` } >
619627 { selectedHistoryRow ?. status ?? "empty" }
@@ -740,7 +748,7 @@ function RunComparisonPanel(props: {
740748 < div className = "comparison-selected-run" >
741749 < span > Focus run</ span >
742750 < strong > { selectedRun . runId } </ strong >
743- < small > { selectedRun . algorithm } </ small >
751+ < small > { selectedRun . algorithm } · { runModeLabel ( selectedRun ) } </ small >
744752 </ div >
745753 < label className = "comparison-select-group" >
746754 < span > Compare against</ span >
@@ -797,6 +805,7 @@ function RunComparisonPanel(props: {
797805 < span className = "comparison-run-main" >
798806 < strong > { row . runId } </ strong >
799807 < small > { row . algorithm } </ small >
808+ < small > { runModeLabel ( row ) } </ small >
800809 </ span >
801810 < span className = "comparison-score-cell" >
802811 < strong > { formatNumber ( row . score ?? row . bestReward ) } </ strong >
@@ -808,6 +817,7 @@ function RunComparisonPanel(props: {
808817 < small > { formatPercent ( row . successRate ) } success</ small >
809818 < small > { formatNumber ( row . totalSteps ) } steps</ small >
810819 < small > { row . checkpointCount } ckpt</ small >
820+ < small > { runModeLabel ( row ) } </ small >
811821 </ span >
812822 </ button >
813823 ) ) }
@@ -1950,7 +1960,25 @@ function comparisonOptionLabel(row: StudioRunHistoryRow): string {
19501960 const rank = row . rank === undefined ? "unranked" : `rank ${ row . rank } ` ;
19511961 const score = formatNumber ( row . score ?? row . bestReward ) ;
19521962
1953- return `${ rank } / ${ score } ` ;
1963+ return `${ rank } / ${ score } / ${ runModeLabel ( row ) } ` ;
1964+ }
1965+
1966+ function runModeLabel ( row : StudioRunHistoryRow | undefined ) : string {
1967+ if ( row === undefined ) {
1968+ return "run" ;
1969+ }
1970+
1971+ const algorithm = row . algorithm . toLowerCase ( ) ;
1972+
1973+ if ( algorithm . includes ( "inference" ) ) {
1974+ return "inference replay" ;
1975+ }
1976+
1977+ if ( row . status === "running" || row . status === "created" ) {
1978+ return "training run" ;
1979+ }
1980+
1981+ return "training run" ;
19541982}
19551983
19561984function firstCheckpointKey ( workspace : StudioWorkspaceView , environmentId ?: string ) : string | undefined {
0 commit comments