feat(voice): add async selectable summaries

This commit is contained in:
zhangheng
2026-07-22 19:13:55 +08:00
parent 108e280b3f
commit 0a2509d923
17 changed files with 1530 additions and 159 deletions

View File

@@ -1,12 +1,12 @@
import type { FeedbackSession, VoiceAudioSegment, VoiceLesson } from '../../utils/types'
export type VoicePrimaryAction = 'save' | 'retry' | 'processing' | 'generate'
export type VoicePrimaryAction = 'save' | 'retry' | 'processing'
export function getVoicePrimaryAction(session: FeedbackSession | null): VoicePrimaryAction {
if (!session || session.lessonCount === 0) return 'save'
if (session.failedSegmentCount > 0) return 'retry'
if (session.processingSegmentCount > 0) return 'processing'
return session.needsGeneration ? 'generate' : 'save'
return 'save'
}
export function getVoicePrimaryActionText(
@@ -15,7 +15,6 @@ export function getVoicePrimaryActionText(
): string {
if (action === 'retry') return `重试转录(${failedSegmentCount}`
if (action === 'processing') return '转录中'
if (action === 'generate') return '生成反馈'
return '保存反馈'
}