diff --git a/apps/website/e2e/workshop-apps.spec.ts b/apps/website/e2e/workshop-apps.spec.ts index 773f19b52dd..e56b8225d7b 100644 --- a/apps/website/e2e/workshop-apps.spec.ts +++ b/apps/website/e2e/workshop-apps.spec.ts @@ -331,7 +331,19 @@ signedInTest( } ) -test('keeps the Re-shoot camera help behind info buttons', async ({ +signedInTest( + 'keeps the Re-shoot camera help behind info buttons', + async ({ page, context, modelsAccount }) => { + await openReadReshootScene(page, context, modelsAccount) + + const help = 'Distance is approximate; angles give the most control.' + await expect(page.getByText(help)).toBeHidden() + await page.getByRole('button', { name: help }).hover() + await expect(page.getByText(help).first()).toBeVisible() + } +) + +test('holds the Re-shoot camera controls until the depth is read', async ({ page, context }) => { @@ -339,10 +351,11 @@ test('keeps the Re-shoot camera help behind info buttons', async ({ await page.goto('/hub/apps/reshoot/') await page.getByText('Sci-fi pilot').first().click() - const help = 'Distance is approximate; angles give the most control.' - await expect(page.getByText(help)).toBeHidden() - await page.getByRole('button', { name: help }).hover() - await expect(page.getByText(help).first()).toBeVisible() + await expect(page.getByTestId('reshoot-depth-step')).toBeVisible() + await expect(page.getByRole('slider', { name: 'Rotation' })).toBeHidden() + await expect(page.getByTestId('reshoot-frame-label')).toHaveText( + /Original clip\s*· Nothing generated yet/ + ) }) test('shows a preview frame for every Cinematic Studio shot option', async ({ diff --git a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimArea.vue b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimArea.vue new file mode 100644 index 00000000000..8608aa94a49 --- /dev/null +++ b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimArea.vue @@ -0,0 +1,85 @@ + + + + + + + + + + + + + diff --git a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimPending.vue b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimPending.vue new file mode 100644 index 00000000000..829e9855007 --- /dev/null +++ b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootAimPending.vue @@ -0,0 +1,117 @@ + + + + + + + + {{ t('reshoot.pending.clip') }} + + + + + + + {{ depthStep.title }} + + + {{ depthStep.detail }} + + + {{ t('reshoot.tryAgain') }} + + + + + + + + {{ t('reshoot.pending.aim') }} + + + {{ t('reshoot.pending.aimHint') }} + + + + + diff --git a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootHeader.vue b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootHeader.vue index 4fe1c7af5c3..df0b90099b7 100644 --- a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootHeader.vue +++ b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootHeader.vue @@ -11,24 +11,28 @@ const { t } = translationsFor(locale) - - - {{ t('reshoot.title') }} - + + {{ t('reshoot.title') }} + + + + + {{ t('reshoot.pick.lead') }} + + + {{ t('reshoot.credit') }} + + - - {{ t('reshoot.pick.lead') }} - - - {{ t('reshoot.credit') }} - diff --git a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.test.ts b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.test.ts index 44d99c22194..68610a06f02 100644 --- a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.test.ts +++ b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.test.ts @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/vue' import userEvent from '@testing-library/user-event' -import { describe, expect, it } from 'vitest' +import { describe, expect, it, vi } from 'vitest' import { h, ref } from 'vue' import { @@ -107,4 +107,42 @@ describe('ReshootSide', () => { }) ).toBeInTheDocument() }) + + function renderPending(extra: Record) { + const analyze = vi.fn() + render({ + setup: () => () => + h(ReshootSide, { + ...props, + ...extra, + size: RESHOOT_SIZES[0], + onAnalyze: analyze + }) + }) + return analyze + } + + it('says what failed in a depth read and offers to try again', async () => { + const analyze = renderPending({ + depth: 'failed', + error: 'The deployment is not ready.' + }) + const step = screen.getByTestId('reshoot-depth-step') + + expect(step).toHaveTextContent(rc('reshoot.pending.depthFailed')) + expect(step).toHaveTextContent('The deployment is not ready.') + expect(screen.getByTestId('reshoot-aim-controls')).toHaveAttribute('inert') + await userEvent.click(screen.getByTestId('reshoot-analyze')) + expect(analyze).toHaveBeenCalledOnce() + }) + + it('says why a depth read has not started, without a retry', () => { + renderPending({ depth: 'none', blocked: rc('reshoot.signIn') }) + const step = screen.getByTestId('reshoot-depth-step') + + expect(step).toHaveTextContent(rc('reshoot.pending.depthWaiting')) + expect(step).toHaveTextContent(rc('reshoot.signIn')) + expect(screen.getByTestId('reshoot-aim-controls')).toHaveAttribute('inert') + expect(screen.queryByTestId('reshoot-analyze')).toBeNull() + }) }) diff --git a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.vue b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.vue index 006d928fd62..f3fc6b21785 100644 --- a/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.vue +++ b/apps/website/src/components/workshop/cinematic-studio/reshoot/ReshootSide.vue @@ -16,10 +16,9 @@ import { clipFits } from '@/lib/workshop/cinematic-studio/reshoot' import { fileSecondsOf } from '@/lib/workshop/cinematic-studio/reshoot-clip' import type { Locale } from '@/i18n/translations' import CinematicGenerateAction from '@/components/workshop/cinematic-studio/CinematicGenerateAction.vue' -import ReshootAimRig from './ReshootAimRig.vue' +import ReshootAimArea from './ReshootAimArea.vue' import ReshootDisclosure from './ReshootDisclosure.vue' import ReshootFormat from './ReshootFormat.vue' -import ReshootMoveControls from './ReshootMoveControls.vue' const { clip, @@ -31,9 +30,11 @@ const { frames, clipError, error, + blocked, gate, canGenerate, priceNote, + limitNote, workspaceName, locale = 'en' } = defineProps<{ @@ -49,9 +50,13 @@ const { clipError?: string /** The last failed depth read, said above its Try again button. */ error?: string + /** What stops the depth read from starting, when nothing is running. */ + blocked?: string gate: StudioGate canGenerate: boolean priceNote?: string + /** Takes left this hour, or when the next one frees up. */ + limitNote?: string workspaceName?: string locale?: Locale }>() @@ -85,7 +90,6 @@ const prompt = defineModel('prompt', { required: true }) const ready = computed(() => depth === 'ready') const analyzing = computed(() => depth === 'analyzing') -const failed = computed(() => !!error && !ready.value && !analyzing.value) const framesText = computed(() => frames === undefined ? '' @@ -95,6 +99,12 @@ const framesText = computed(() => }) ) +const clipStatus = computed(() => { + if (clipError) return clipError + if (ready.value) return `${t('reshoot.clip.ready')} · ${framesText.value}` + return analyzing.value ? t('reshoot.aim.reading') : framesText.value +}) + // A replacement is checked before it takes the current clip's place, as on // the first pick: one outside 5 to 15 seconds is turned away and the clip // already in use stays. @@ -141,14 +151,7 @@ async function choose(event: Event) { {{ isExample ? t('reshoot.pick.exampleTitle') : clipName }} - {{ - clipError ?? - (ready - ? `${t('reshoot.clip.ready')} · ${framesText}` - : analyzing - ? t('reshoot.aim.reading') - : framesText) - }} + {{ clipStatus }} {{ rejected }} - - - - @@ -257,34 +253,19 @@ async function choose(event: Event) {
+ {{ t('reshoot.pick.lead') }} +
+ {{ t('reshoot.credit') }} +
- {{ t('reshoot.pick.lead') }} -
- {{ t('reshoot.credit') }} -