feat(transcript): detect Chinese script for Auto (#563)

This commit is contained in:
Yiling-J
2026-12-05 21:52:32 +08:00
committed by GitHub
parent 921af1dc5a
commit 1bf5041b38
7 changed files with 197 additions and 42 deletions
@@ -50,6 +50,15 @@ test('reads, searches and follows a saved transcript in the video player', async
segments: { create: { position: 0, startMs: 0, endMs: 700, text: '你好。' } },
},
})
await prisma.assetTranscript.create({
data: {
assetId: fileId,
language: 'zh-Hant',
model: 'whisper-tiny',
workflowTaskId: 'auto-traditional-test',
segments: { create: { position: 0, startMs: 0, endMs: 700, text: '這是轉錄。' } },
},
})
await page.goto(`/projects/${projectId}/files/${fileId}`)
const toggle = page.getByRole('button', { name: 'Show transcript' })
@@ -218,9 +227,13 @@ test('reads, searches and follows a saved transcript in the video player', async
await expect(closingWord).toHaveAttribute('aria-current', 'true')
await expect(video).toHaveJSProperty('paused', true)
await panel.getByRole('combobox', { name: 'Language' }).selectOption('zh')
const language = panel.getByRole('combobox', { name: 'Language' })
await language.selectOption('zh')
await expect(panel.getByText('你好。')).toBeVisible()
await expect(last).toHaveCount(0)
await language.selectOption({ label: 'Chinese (Traditional)' })
await expect(language).toHaveValue('zh-Hant')
await expect(panel.getByText('這是轉錄。')).toBeVisible()
await dragDivider(divider, 64)
await expect(panel).toHaveCSS('width', '448px')
await panel.getByRole('button', { name: 'Close transcript' }).click()