fix(dictation): keep phone mode segments typed and clear hold-to-record when a phone picks Hold

This commit is contained in:
Kelvin Amoaba
2026-11-09 08:57:07 +00:00
parent 280154e1f5
commit 6511fec033
2 changed files with 11 additions and 5 deletions
@@ -28,10 +28,13 @@ const POLL_INTERVAL_MS = 1500
// Hosts that report hold-to-record have Auto; older ones only Toggle and Hold.
function dictationModes(t: Translate, offersAuto: boolean) {
const toggle = { value: 'toggle', label: t('settings.voiceSettingsScreen.toggleMode', 'Toggle') }
const hold = { value: 'hold', label: t('settings.voiceSettingsScreen.holdMode', 'Hold') }
const auto = { value: 'auto', label: t('settings.voiceSettingsScreen.autoMode', 'Auto') }
return offersAuto ? ([auto, hold, toggle] as const) : ([toggle, hold] as const)
const toggle = {
value: 'toggle',
label: t('settings.voiceSettingsScreen.toggleMode', 'Toggle')
} as const
const hold = { value: 'hold', label: t('settings.voiceSettingsScreen.holdMode', 'Hold') } as const
const auto = { value: 'auto', label: t('settings.voiceSettingsScreen.autoMode', 'Auto') } as const
return offersAuto ? [auto, hold, toggle] : [toggle, hold]
}
type ModelBusyAction = { modelId: string; type: 'download' | 'select' | 'delete' }
@@ -119,7 +119,10 @@ export class RuntimeMobileSpeechCatalog {
...(params.dictationMode !== undefined ? { dictationMode: params.dictationMode } : {}),
...(params.dictationHoldToRecord !== undefined
? { dictationHoldToRecord: params.dictationHoldToRecord }
: {})
: // A phone without Auto that picks Hold leaves no hold-to-record behind for a later Toggle.
params.dictationMode === 'hold'
? { dictationHoldToRecord: false }
: {})
}
store.updateSettings?.({ voice: nextVoice }, { notifyListeners: true })
return this.list()