Mobile: Feature flags: Fix "voice typing" feature flag (#13981)

This commit is contained in:
Henry Heino
2025-12-24 02:10:12 -08:00
committed by GitHub
parent b0e912157b
commit f576e116a8
2 changed files with 6 additions and 7 deletions

View File

@@ -213,7 +213,7 @@ const modelLocalFilepath = () => {
};
const whisper: VoiceTypingProvider = {
supported: () => !!SpeechToTextModule && Setting.value('featureFlag.voiceTypingEnabled'),
supported: () => !!SpeechToTextModule && Setting.value('buildFlag.voiceTypingEnabled'),
modelLocalFilepath: modelLocalFilepath,
getDownloadUrl: (locale) => {
const lang = languageCodeOnly(locale).toLowerCase();

View File

@@ -16,9 +16,10 @@ const customCssFilePath = (Setting: typeof SettingType, filename: string): strin
return `${Setting.value('rootProfileDir')}/${filename}`;
};
const showVoiceTypingSettings = () => (
type VoiceTypingSettingSlice = Record<'buildFlag.voiceTypingEnabled', boolean>;
const showVoiceTypingSettings = (settings: VoiceTypingSettingSlice) => (
// For now, iOS and web don't support voice typing.
shim.mobilePlatform() === 'android'
shim.mobilePlatform() === 'android' && !!settings['buildFlag.voiceTypingEnabled']
);
export enum CameraDirection {
@@ -1910,14 +1911,12 @@ const builtInMetadata = (Setting: typeof SettingType) => {
// As of December 2025, the voice typing feature doesn't work well on low-resource devices.
// There have been requests to allow disabling the voice typing feature at build time. This
// feature flag allows doing so, by changing the default `value` from `true` to `false`:
'featureFlag.voiceTypingEnabled': {
'buildFlag.voiceTypingEnabled': {
value: true,
type: SettingItemType.Bool,
public: false,
appTypes: [AppType.Mobile],
label: () => 'Voice typing: Enable the voice typing feature',
section: 'note',
advanced: true,
},
'survey.webClientEval2025.progress': {
@@ -1984,7 +1983,7 @@ const builtInMetadata = (Setting: typeof SettingType) => {
appTypes: [AppType.Mobile],
label: () => _('Voice typing: Glossary'),
description: () => _('A comma-separated list of words. May be used for uncommon words, to help voice typing spell them correctly.'),
show: () => showVoiceTypingSettings(),
show: showVoiceTypingSettings,
section: 'note',
},