fix(settings): show the live caption model under the dictation model

The caption model selector now sits directly under the dictation model in
the STT tab's Local Whisper card, where people look for it, and stays in the
General tab's caption section as well; both use one shared component. The
first selector is renamed to 'Dictation model' so the two are told apart.
This commit is contained in:
Yun Chan 2026-09-24 22:08:05 +09:00
parent da0da98285
commit ad6bb70c20
15 changed files with 68 additions and 35 deletions

View file

@ -0,0 +1,41 @@
// 실시간 자막 전용 로컬 Whisper 모델 선택 — STT 탭과 일반 탭 자막 섹션이 함께 쓴다.
import { FormControl, InputLabel, MenuItem, Select, Typography } from '@mui/material'
import { d3roPalette, d3roTypo } from '@d3ro/ui/theme'
import { useI18n } from '@d3ro/i18n'
import type { STTModel } from '@d3ro/core/types'
/** "받아쓰기와 같게" — 설정에는 null 로 저장한다 */
const SAME_AS_DICTATION = '__same__'
interface CaptionModelSelectProps {
value: string | null | undefined
/** 선택지로 보일 모델 — 받아 둔 모델만 넘긴다 */
models: readonly STTModel[]
onChange: (modelId: string | null) => void
fullWidth?: boolean
}
export function CaptionModelSelect({ value, models, onChange, fullWidth }: CaptionModelSelectProps): React.ReactElement {
const { t } = useI18n()
return (
<FormControl size="small" fullWidth={fullWidth}>
<InputLabel>{t('settings.captionModel')}</InputLabel>
<Select
label={t('settings.captionModel')}
value={value ?? SAME_AS_DICTATION}
onChange={(e) => onChange(e.target.value === SAME_AS_DICTATION ? null : e.target.value)}
>
<MenuItem value={SAME_AS_DICTATION}>{t('settings.captionModel.same')}</MenuItem>
{models.map((m) => (
<MenuItem key={m.id} value={m.id}>
{m.name}
</MenuItem>
))}
</Select>
<Typography sx={{ mt: 0.5, fontSize: d3roTypo.meta.size, color: d3roPalette.text.secondary }}>
{t('settings.captionModel.desc')}
</Typography>
</FormControl>
)
}

View file

@ -50,6 +50,7 @@ import type {
STTModel,
} from '@d3ro/core/types'
import { CodexOAuthGuideModal } from './CodexOAuthGuideModal'
import { CaptionModelSelect } from './CaptionModelSelect'
interface STTTabProps {
config: Partial<AppConfig>
@ -362,6 +363,14 @@ export function STTTab({ config, updateConfig }: STTTabProps): React.ReactElemen
</Select>
</FormControl>
{/* 실시간 자막 전용 모델 — 1초마다 다시 인식하므로 받아쓰기와 다른 모델이 나을 수 있다 */}
<CaptionModelSelect
fullWidth
value={config.captionSttModelId}
models={localModels.filter((m) => m.downloaded)}
onChange={(modelId) => updateConfig('captionSttModelId', modelId)}
/>
{/* 모델 다운로드 진행 바 또는 다운로드 버튼 */}
{(() => {
const selected = localModels.find((m) => m.id === (config.sttModelId ?? 'large-v3-turbo'))

View file

@ -28,6 +28,7 @@ import { Led } from '@d3ro/ui/components/ds'
import { LicenseTab } from './LicenseTab'
import { CloudSyncSection } from './CloudSyncSection'
import { STTTab } from './STTTab'
import { CaptionModelSelect } from './CaptionModelSelect'
import { InputConsentPanel } from './input-insights/InputConsentPanel'
import { KeyBindingField } from './keybinding/KeyBindingField'
import { asTranslationKey } from './keybinding/translation-key'
@ -64,9 +65,6 @@ const ACTION_GROUP_LABEL_KEYS: Readonly<Record<KeyBindingActionGroup, string>> =
const ACTION_GROUP_ORDER: readonly KeyBindingActionGroup[] = ['voice', 'window', 'input']
/** 자막 모델 선택지 "받아쓰기와 같게" — 설정에는 null 로 저장한다 */
const SAME_AS_DICTATION = '__same__'
export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalProps): React.ReactElement {
const { t, locale, setLocale } = useI18n()
const [activeTab, setActiveTab] = useState(initialTab)
@ -493,26 +491,11 @@ export function SettingsModal({ open, initialTab = 0, onClose }: SettingsModalPr
</Select>
</FormControl>
<FormControl size="small">
<InputLabel>{t('settings.captionModel')}</InputLabel>
<Select
label={t('settings.captionModel')}
value={config.captionSttModelId ?? SAME_AS_DICTATION}
onChange={(e) =>
updateConfig('captionSttModelId', e.target.value === SAME_AS_DICTATION ? null : e.target.value)
}
>
<MenuItem value={SAME_AS_DICTATION}>{t('settings.captionModel.same')}</MenuItem>
{downloadedSttModels.map((m) => (
<MenuItem key={m.id} value={m.id}>
{m.name}
</MenuItem>
))}
</Select>
<Typography sx={{ mt: 0.5, fontSize: d3roTypo.meta.size, color: d3roPalette.text.secondary }}>
{t('settings.captionModel.desc')}
</Typography>
</FormControl>
<CaptionModelSelect
value={config.captionSttModelId}
models={downloadedSttModels}
onChange={(modelId) => updateConfig('captionSttModelId', modelId)}
/>
<FormControlLabel
sx={{ mr: 0, alignItems: 'flex-start' }}