Skip to content

Commit 332d08f

Browse files
committed
ts: /runs/{runId}/{programId}/{index}
1 parent e4bee74 commit 332d08f

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

website/frontend/src/components/RunSummary.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ export function RunSummaryCard({
7171
}) {
7272
return (
7373
<ShadowCard
74-
to="/runs/$run/$index"
74+
to="/runs/$run/$programId/$index"
7575
params={{
7676
run: id,
77+
programId: programId,
7778
index: index,
7879
}}
7980
>

website/frontend/src/fetchRuns.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ function makeDecodeState(): DecodeState {
6868

6969
export async function fetchRunStreaming(
7070
runId: string,
71-
indexStr: string
71+
indexStr: string,
72+
programId?: string
7273
): Promise<ReadableStream<ApiGetRun>> {
7374
if (import.meta.env.VITE_FAKE_DATA) {
7475
const seed = Math.random() * 1_000_000_000

website/frontend/src/routes/runs/$run.$index.tsx renamed to website/frontend/src/routes/runs/$run.$programId.$index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ import { RunBox } from '../../components/RunBox.js'
2323
import { FullPagePortal } from '../../components/FullPagePortal.js'
2424
import { ApiGetRun } from 'shared'
2525
import AnimatedTokensCounter from '../../components/AnimatedTokensCounter.js'
26-
export const Route = createFileRoute('/runs/$run/$index')({
27-
loader: async ({ params }) => fetchRunStreaming(params.run, params.index),
26+
export const Route = createFileRoute('/runs/$run/$programId/$index')({
27+
loader: async ({ params }) =>
28+
fetchRunStreaming(params.run, params.index, params.programId),
2829
component: RouteComponent,
2930
})
3031

3132
function RouteComponent() {
3233
const runData = useStreamingLoaderData<ApiGetRun>({
33-
from: '/runs/$run/$index',
34+
from: '/runs/$run/$programId/$index',
3435
})
3536
const run = runData?.run
3637
const isOnlyRun = runData?.isOnlyRun

website/frontend/src/routes/runs/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export const Route = createFileRoute('/runs/')({
77
fetchRuns().then((runs) => {
88
if (runs.runs.length === 1) {
99
throw redirect({
10-
to: '/runs/$run/$index',
10+
to: '/runs/$run/$programId/$index',
1111
params: {
1212
run: runs.runs[0].id,
13+
programId: runs.runs[0].programId,
1314
index: `${runs.runs[0].index}`,
1415
},
1516
})

0 commit comments

Comments
 (0)