diff --git a/apps/cli/src/commands/results/remote.ts b/apps/cli/src/commands/results/remote.ts index 70d0aba5b..3969480ad 100644 --- a/apps/cli/src/commands/results/remote.ts +++ b/apps/cli/src/commands/results/remote.ts @@ -4,6 +4,7 @@ import path from 'node:path'; import { DEFAULT_THRESHOLD, type EvaluationResult, + type GitListedRun, type ResultsConfig, type ResultsRepoStatus, directPushResults, @@ -24,11 +25,10 @@ import { listResultFilesFromRunsDir, } from '../inspect/utils.js'; - // ── In-memory TTL cache for listGitRuns ──────────────────────────── // Avoids repeated expensive git ls-tree + git cat-file --batch operations // on every API request. Cache key is repoDir, TTL is 60 seconds. -const gitRunsCache = new Map(); +const gitRunsCache = new Map; expiresAt: number }>(); const GIT_RUNS_CACHE_TTL_MS = 60_000; function cachedListGitRuns(repoDir: string) { @@ -40,12 +40,14 @@ function cachedListGitRuns(repoDir: string) { const promise = listGitRuns(repoDir); gitRunsCache.set(repoDir, { data: promise, expiresAt: now + GIT_RUNS_CACHE_TTL_MS }); // Evict stale entry once the promise settles so a fresh fetch replaces it - promise.catch(() => {}).finally(() => { - const entry = gitRunsCache.get(repoDir); - if (entry && entry.expiresAt <= Date.now()) { - gitRunsCache.delete(repoDir); - } - }); + promise + .catch(() => {}) + .finally(() => { + const entry = gitRunsCache.get(repoDir); + if (entry && entry.expiresAt <= Date.now()) { + gitRunsCache.delete(repoDir); + } + }); return promise; } diff --git a/apps/cli/src/commands/results/serve.ts b/apps/cli/src/commands/results/serve.ts index 34de9b080..746d487e2 100644 --- a/apps/cli/src/commands/results/serve.ts +++ b/apps/cli/src/commands/results/serve.ts @@ -1633,7 +1633,9 @@ export const resultsServeCommand = command({ // Clone or pull any project entries that declare a source. // Non-blocking: fire-and-forget so startup is instant even when some // project paths are missing or slow (e.g. /tmp paths that timeout). - syncProjects(registry.projects).catch((err) => console.error("Background project sync failed:", err)); + syncProjects(registry.projects).catch((err) => + console.error('Background project sync failed:', err), + ); try { let results: EvaluationResult[] = []; diff --git a/apps/cli/test/commands/results/serve.test.ts b/apps/cli/test/commands/results/serve.test.ts index 678a0f910..e4fd28c79 100644 --- a/apps/cli/test/commands/results/serve.test.ts +++ b/apps/cli/test/commands/results/serve.test.ts @@ -183,9 +183,9 @@ describe('loadResults', () => { // ── resolveDashboardMode ─────────────────────────────────────────────── describe('resolveDashboardMode', () => { - it('defaults to single-project mode when no projects are registered', () => { + it('defaults to project dashboard mode when no projects are registered', () => { expect(resolveDashboardMode(0, {})).toEqual({ - projectDashboard: false, + projectDashboard: true, }); }); diff --git a/apps/cli/test/unit/studio-navigation.test.ts b/apps/cli/test/unit/studio-navigation.test.ts index 41eb8b3a2..561e20ab2 100644 --- a/apps/cli/test/unit/studio-navigation.test.ts +++ b/apps/cli/test/unit/studio-navigation.test.ts @@ -13,8 +13,8 @@ import { } from '../../../studio/src/lib/navigation.ts'; describe('studio navigation helpers', () => { - it('redirects the root entrypoint to the only registered project', () => { - expect(resolveIndexRoute(['demo-project'], undefined, 'analytics')).toEqual({ + it('redirects when the preferred project id matches a registered project', () => { + expect(resolveIndexRoute(['demo-project'], undefined, 'demo-project', 'analytics')).toEqual({ kind: 'redirect', redirectPath: '/projects/demo-project?tab=analytics', }); diff --git a/apps/studio/src/components/EvalDetail.tsx b/apps/studio/src/components/EvalDetail.tsx index 9b114d0cc..5ba44e12e 100644 --- a/apps/studio/src/components/EvalDetail.tsx +++ b/apps/studio/src/components/EvalDetail.tsx @@ -287,11 +287,7 @@ function FilesTab({ return (
{/* FileTree panel — desktop: side-by-side, mobile: full-width slide-over */} -
+
{/* MonacoViewer panel — desktop: side-by-side, mobile: full-width */} -
+
diff --git a/apps/studio/src/components/StopRunButton.tsx b/apps/studio/src/components/StopRunButton.tsx index 534a77103..3d1ae636f 100644 --- a/apps/studio/src/components/StopRunButton.tsx +++ b/apps/studio/src/components/StopRunButton.tsx @@ -59,7 +59,10 @@ export function StopRunButton({ runId, status, isReadOnly, projectId }: StopRunB 'Stopping…' ) : ( <> -