Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/src/components/OneLoopStudio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
const started = await startVideoToActions(payload);
if (!started.ok || !started.runId) {
if (started.status === 401 || started.status === 403) {
window.location.href = `/login?callbackUrl=${encodeURIComponent(CANONICAL_STUDIO_PATH)}`;

Check warning on line 495 in apps/web/src/components/OneLoopStudio.tsx

View workflow job for this annotation

GitHub Actions / build

Do not use `window.location.href` to navigate to internal Next.js pages. Use `redirect()` in the render phase, or `useRouter().push()` in Client Components' event handlers instead. See: https://nextjs.org/docs/messages/no-location-assign-relative-destination

Check warning on line 495 in apps/web/src/components/OneLoopStudio.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Do not use `window.location.href` to navigate to internal Next.js pages. Use `redirect()` in the render phase, or `useRouter().push()` in Client Components' event handlers instead. See: https://nextjs.org/docs/messages/no-location-assign-relative-destination
return;
}
setMessage(started.error || started.message || 'Could not start Act.');
Expand Down Expand Up @@ -610,7 +610,7 @@
transcript: usableProvidedTranscript(selected?.transcript),
});
if (started.status === 401 || started.status === 403) {
window.location.href = `/login?callbackUrl=${encodeURIComponent(CANONICAL_STUDIO_PATH)}`;

Check warning on line 613 in apps/web/src/components/OneLoopStudio.tsx

View workflow job for this annotation

GitHub Actions / build

Do not use `window.location.href` to navigate to internal Next.js pages. Use `redirect()` in the render phase, or `useRouter().push()` in Client Components' event handlers instead. See: https://nextjs.org/docs/messages/no-location-assign-relative-destination

Check warning on line 613 in apps/web/src/components/OneLoopStudio.tsx

View workflow job for this annotation

GitHub Actions / lint-frontend

Do not use `window.location.href` to navigate to internal Next.js pages. Use `redirect()` in the render phase, or `useRouter().push()` in Client Components' event handlers instead. See: https://nextjs.org/docs/messages/no-location-assign-relative-destination
return;
}
if (!started.ok || !started.runId) {
Expand Down Expand Up @@ -951,6 +951,7 @@
busy: busy || selected?.status === 'processing',
hasCompletedRun: selected != null && selected.status !== 'processing' && !busy,
eventCount: 0,
hasTranscript: Boolean(selected?.transcript?.trim()),
hasArchitecture: Boolean(packFormation.architecture),
artifactCount: packFormation.artifacts.length,
toolCount: packFormation.tools.length,
Expand Down
16 changes: 16 additions & 0 deletions apps/web/src/lib/__tests__/studio-pipeline-status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ describe('studio-pipeline-status', () => {
);
});

it('does not claim a transcript exists when a completed run only has pack identity', () => {
const emptyNoTranscript = studioEventsEmptyMessage({
busy: false,
hasCompletedRun: true,
eventCount: 0,
hasArchitecture: false,
artifactCount: 0,
toolCount: 0,
hasTranscript: false,
});

expect(emptyNoTranscript.toLowerCase()).toMatch(/no extracted events/);
expect(emptyNoTranscript.toLowerCase()).not.toContain('transcript');
expect(emptyNoTranscript.toLowerCase()).toContain('pack identity');
});

it('enables export from pack formation when events[] is empty', () => {
expect(
studioCanExport({
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/lib/studio-pipeline-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export function studioEventsEmptyMessage(input: {
busy: boolean;
hasCompletedRun: boolean;
eventCount: number;
hasTranscript?: boolean;
hasArchitecture: boolean;
artifactCount: number;
toolCount: number;
Expand All @@ -114,7 +115,10 @@ export function studioEventsEmptyMessage(input: {
if (packReady) {
return 'This pack has no extracted events. Architecture, artifacts, and stack from the video are below — export them from this page.';
}
return 'This run has no extracted events. Transcript and pack identity stay on this page.';
if (input.hasTranscript) {
return 'This run has no extracted events. Transcript and pack identity stay on this page.';
}
return 'This run has no extracted events. Pack identity stays on this page.';
}

export function studioPromotePackWorkbench(input: {
Expand Down
Loading