refactor(voices): Phase 1 - extract types, constants and utils #873

Closed
xiaoxia wants to merge 1 commits from refactor/voice-library-phase1 into develop

1 Commits

Author SHA1 Message Date
SaaS Frontend ae78918ae4 refactor(voices): Phase 1 - extract types, constants and utils
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 35s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m15s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m1s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 54s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m1s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m50s
Preview Deploy / Deploy Preview Environment (pull_request) Failing after 25s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m23s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 43s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 4m28s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m42s
AI Code Review / AI Code Review (pull_request) Successful in 5m3s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Failing after 4m56s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 5m58s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 16s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Failing after 16s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 2m46s
Extract types, constants, and utility functions from VoiceLibrary.tsx
into separate files following the same pattern as VoiceMaterialLibrary.

New files:
- types.ts: VoiceGender, VoiceLanguage, TabKey, display interfaces, mappers
- constants.ts: gender options, language options, clone status config
- utils/format.ts: genderLabel, languageLabel, genderClass, formatTime, formatFileSize
- utils/audio.ts: getAudioDuration
- test/pages/voices/smoke.test.tsx: smoke test for vitest related mode

Main file reduced from 1783 to 1647 lines.
Functionally equivalent, no behavior changes.

Signed-off-by: xiaoxia <xiaoxia@xiaoxiajianji.com>
2026-07-25 12:15:00 +08:00