Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat(mobile): separate Note Chat from the Voice Assistant (#2784)
Chad Piha3456f023a247
diff --git a/openwhispr-mobile/src/lib/__tests__/aiWorkflows.test.ts b/openwhispr-mobile/src/lib/__tests__/aiWorkflows.test.tsindex f8f99d8c8..dfa90c927 100644--- a/openwhispr-mobile/src/lib/__tests__/aiWorkflows.test.ts+++ b/openwhispr-mobile/src/lib/__tests__/aiWorkflows.test.ts@@ -1,10 +1,27 @@-import { workflowSummary } from '@/lib/aiWorkflows';+import { unsetSelection, workflowSummary } from '@/lib/aiWorkflows';import type { UserConfig } from '@/types';function config(overrides: Partial<UserConfig> = {}): UserConfig {return { defaultMode: 'private', ...overrides } as UserConfig;}+describe('Note Chat with nothing saved', () => {+ it.each(['cloud', 'private', 'providers'] as const)(+ 'runs on OpenWhispr Cloud in %s mode',+ (mode) => {+ expect(unsetSelection('noteChat', mode)).toEqual({ mode: 'openwhispr' });+ },+ );++ it('is summarized as OpenWhispr Cloud in Local Mode', () => {+ expect(workflowSummary(config({}), 'noteChat', 'private')).toBe('OpenWhispr Cloud');+ });++ it('leaves the voice assistant skipped under Bring Your Own Key', () => {+ expect(workflowSummary(config({}), 'agent', 'providers')).toBe('Not set');+ });+});+describe('workflowSummary for Text Cleanup', () => {// With nothing saved, Local Mode cleans on OpenWhispr Cloud for a signed-in account and on this// phone otherwise, since a separate Cloud pass needs a real account.@@ -137,3 +154,27 @@ describe('workflowSummary for Uploads', () => {);});});++describe('workflowSummary for switched-off workflows', () => {+ const groq = { mode: 'providers' as const, providerId: 'groq', modelId: 'llama' };++ it('says Off for Note Chat and the Voice Assistant switched off, even with a key missing', () => {+ const saved = config({+ defaultMode: 'cloud',+ noteChatEnabled: false,+ dictationAgentEnabled: false,+ inference: { noteChat: groq, agent: groq },+ });+ expect(workflowSummary(saved, 'noteChat', 'cloud', { keyMissing: true })).toBe('Off');+ expect(workflowSummary(saved, 'agent', 'cloud', { keyMissing: true })).toBe('Off');+ });++ it('keeps Note Chat on when only the Voice Assistant is switched off', () => {+ const saved = config({ defaultMode: 'cloud', dictationAgentEnabled: false });+ expect(workflowSummary(saved, 'noteChat', 'cloud')).toBe('OpenWhispr Cloud');+ });++ it('says the Voice Assistant is Off in Local Mode, which turns it off', () => {+ expect(workflowSummary(config({}), 'agent', 'private')).toBe('Off');+ });+});diff --git a/openwhispr-mobile/src/lib/__tests__/dictationAgent.test.ts b/openwhispr-mobile/src/lib/__tests__/dictationAgent.test.tsindex 8f126bd25..a4137885c 100644--- a/openwhispr-mobile/src/lib/__tests__/dictationAgent.test.ts+++ b/openwhispr-mobile/src/lib/__tests__/dictationAgent.test.ts@@ -2,7 +2,6 @@ import {getDictationAgentName,isDictationAgentApplicable,isNoteChatEnabled,- voiceAssistantToggleConfig,detectAgentMention,} from '@/lib/dictationAgent';import type { UserConfig } from '@/types';@@ -57,30 +56,15 @@ describe('isDictationAgentApplicable', () => {});});-// Note chat once shared the voice assistant's switch, so an existing choice carries over.+// Note chat's switch is its own; configs from before it was are saved apart at launch.describe('note chat', () => {it('is on by default', () => {expect(isNoteChatEnabled(baseConfig)).toBe(true);});- it('follows the old shared switch until set on its own', () => {- expect(isNoteChatEnabled({ ...baseConfig, dictationAgentEnabled: false })).toBe(false);- expect(- isNoteChatEnabled({ ...baseConfig, dictationAgentEnabled: false, noteChatEnabled: true }),- ).toBe(true);- });-- it('keeps its state when only the voice assistant is switched', () => {- expect(voiceAssistantToggleConfig(baseConfig, false)).toEqual({- dictationAgentEnabled: false,- noteChatEnabled: true,- });- expect(- voiceAssistantToggleConfig({ ...baseConfig, dictationAgentEnabled: false }, true),- ).toEqual({ dictationAgentEnabled: true, noteChatEnabled: false });- expect(voiceAssistantToggleConfig({ ...baseConfig, noteChatEnabled: false }, true)).toEqual({- dictationAgentEnabled: true,- });+ it('ignores the voice assistant switch', () => {+ expect(isNoteChatEnabled({ ...baseConfig, dictationAgentEnabled: false })).toBe(true);+ expect(isNoteChatEnabled({ ...baseConfig, noteChatEnabled: false })).toBe(false);});});diff --git a/openwhispr-mobile/src/lib/__tests__/inferenceModes.test.ts b/openwhispr-mobile/src/lib/__tests__/inferenceModes.test.tsindex 135997bd3..e5d7f9e57 100644--- a/openwhispr-mobile/src/lib/__tests__/inferenceModes.test.ts+++ b/openwhispr-mobile/src/lib/__tests__/inferenceModes.test.ts@@ -5,6 +5,7 @@ import {dictationModeConfig,getInferenceModes,localModeUpgradeConfig,+ noteChatSplitConfig,workflowSaveConfig,} from '../inferenceModes';import type { UserConfig } from '@/types';@@ -113,8 +114,9 @@ describe('workflowSaveConfig', () => {upload: { mode: 'local' },notes: { mode: 'local' },agent: { mode: 'local' },+ noteChat: { mode: 'local' },});- expect(next.pinnedInference).toEqual(['upload', 'notes', 'agent']);+ expect(next.pinnedInference).toEqual(['upload', 'notes', 'agent', 'noteChat']);});it('keeps uploads and notes on Cloud when dictation moves from Cloud to a provider', () => {@@ -139,7 +141,7 @@ describe('workflowSaveConfig', () => {const next = workflowSaveConfig(config, 'dictation', groqDictation, 'private');expect(next.inference?.cleanup).toBeUndefined();expect(next.inference?.notes).toEqual({ mode: 'openwhispr' });- expect(next.pinnedInference).toEqual(['upload', 'agent']);+ expect(next.pinnedInference).toEqual(['upload', 'agent', 'noteChat']);});it('adds no pins when a Bring Your Own Key user re-saves dictation', () => {@@ -322,7 +324,7 @@ describe('workflowSaveConfig', () => {inference: { dictation: { mode: 'local' } },};const next = workflowSaveConfig(config, 'dictation', groqDictation, 'private');- expect(next.pinnedInference).toEqual(['upload', 'notes', 'agent']);+ expect(next.pinnedInference).toEqual(['upload', 'notes', 'agent', 'noteChat']);});// Replaying onboarding writes the mode directly, and must not leave a stale return behind.@@ -411,3 +413,86 @@ it('switches dictation back to On-Device with the model the user picked', () =>modelId: 'parakeet-v3',});});++// Note chat once shared the voice assistant's setting, so an existing config gives it the same one.+describe('noteChatSplitConfig', () => {+ const groqChat = {+ mode: 'providers' as const,+ providerId: 'groq',+ modelId: 'llama-3.3-70b-versatile',+ credentialRef: 'provider.groq',+ };++ it('copies a provider selection and its remembered providers', () => {+ expect(+ noteChatSplitConfig({+ defaultMode: 'cloud',+ noteChatEnabled: true,+ inference: { agent: groqChat },+ rememberedInference: { agent: { groq: groqChat } },+ }),+ ).toEqual({+ noteChatSplit: true,+ inference: { agent: groqChat, noteChat: groqChat },+ rememberedInference: { agent: { groq: groqChat }, noteChat: { groq: groqChat } },+ });+ });++ it('holds note chat where the voice assistant was held', () => {+ const next = noteChatSplitConfig({+ defaultMode: 'private',+ inference: { agent: { mode: 'openwhispr' } },+ pinnedInference: ['upload', 'agent'],+ privateModeReturn: { pinned: { agent: groqChat } },+ });+ expect(next.pinnedInference).toEqual(['upload', 'agent', 'noteChat']);+ expect(next.privateModeReturn).toEqual({ pinned: { agent: groqChat, noteChat: groqChat } });+ });++ it("saves note chat's switch as it stood, following the voice assistant's", () => {+ expect(noteChatSplitConfig({ defaultMode: 'cloud' }).noteChatEnabled).toBe(true);+ expect(+ noteChatSplitConfig({ defaultMode: 'cloud', dictationAgentEnabled: false }).noteChatEnabled,+ ).toBe(false);+ expect(noteChatSplitConfig({ defaultMode: 'cloud', noteChatEnabled: true })).not.toHaveProperty(+ 'noteChatEnabled',+ );+ });++ it('never overwrites a saved note chat', () => {+ const next = noteChatSplitConfig({+ defaultMode: 'cloud',+ inference: { agent: groqChat, noteChat: { mode: 'local' } },+ rememberedInference: { agent: { groq: groqChat }, noteChat: {} },+ pinnedInference: ['agent'],+ noteChatEnabled: true,+ });+ expect(next).toEqual({ noteChatSplit: true });+ });++ it('only marks a config with nothing saved for the voice assistant', () => {+ expect(noteChatSplitConfig({ defaultMode: 'cloud', noteChatEnabled: true })).toEqual({+ noteChatSplit: true,+ });+ });+});++// Note chat followed the voice assistant's hold before it had a setting of its own: leaving Local+// Mode for Bring Your Own Key kept it on this iPhone, so it still does.+it('holds note chat on this iPhone when dictation leaves Local Mode for Bring Your Own Key', () => {+ const groq = {+ mode: 'providers' as const,+ providerId: 'groq',+ modelId: 'whisper-large-v3-turbo',+ credentialRef: 'provider.groq',+ };+ const next = workflowSaveConfig(+ { defaultMode: 'private', inference: { dictation: { mode: 'local' } } },+ 'dictation',+ groq,+ 'private',+ );+ expect(next.inference?.noteChat).toEqual({ mode: 'local' });+ expect(next.inference?.agent).toEqual({ mode: 'local' });+ expect(next.pinnedInference).toContain('noteChat');+});diff --git a/openwhispr-mobile/src/lib/__tests__/mobileProviders.test.ts b/openwhispr-mobile/src/lib/__tests__/mobileProviders.test.tsindex 3ba8d4ece..a21d22477 100644--- a/openwhispr-mobile/src/lib/__tests__/mobileProviders.test.ts+++ b/openwhispr-mobile/src/lib/__tests__/mobileProviders.test.ts@@ -225,3 +225,22 @@ it('requires a credential and a model without changing the selection', () => {}),).toEqual({ ok: false, code: 'MODEL_REQUIRED' });});++it.each(['agent', 'noteChat'] as const)(+ 'blocks %s when the organization turns the assistant off',+ (scope) => {+ const allowAll = { allowedModes: ['providers'], allowedByokProviders: ['openai'] };+ expect(+ resolveMobileInferenceRoute({+ scope,+ selection: {+ mode: 'providers',+ providerId: 'openai',+ modelId: 'gpt-4.1-mini',+ credentialRef: 'provider.openai',+ },+ policy: { status: 'managed', transcription: allowAll, llm: allowAll, agentEnabled: false },+ }),+ ).toEqual({ ok: false, code: 'POLICY_BLOCKED' });+ },+);diff --git a/openwhispr-mobile/src/lib/aiWorkflows.ts b/openwhispr-mobile/src/lib/aiWorkflows.tsindex de15f1803..19e3101dc 100644--- a/openwhispr-mobile/src/lib/aiWorkflows.ts+++ b/openwhispr-mobile/src/lib/aiWorkflows.ts@@ -1,4 +1,5 @@import type { AuthUser } from '@/lib/authClient';+import { isDictationAgentEnabled, isNoteChatEnabled } from '@/lib/dictationAgent';import type { InferenceSelection } from '@/lib/mobileProviders';import { localModeDefault, MODE_LABELS, type CloudAccess } from '@/lib/inferenceModes';import { isLocalModelKey, LOCAL_MODEL_TITLES } from '@/lib/localModelCatalog';@@ -10,7 +11,8 @@ export const WORKFLOW_LABELS: Record<MobileInferenceScope, string> = {upload: 'Uploads',cleanup: 'Text Cleanup',notes: 'Note Formatting & Titles',- agent: 'Chat & Voice Assistant',+ noteChat: 'Note Chat',+ agent: 'Voice Assistant',};export const WORKFLOWS = Object.keys(WORKFLOW_LABELS) as MobileInferenceScope[];@@ -18,8 +20,7 @@ export const WORKFLOWS = Object.keys(WORKFLOW_LABELS) as MobileInferenceScope[];// Bring Your Own Key dictation skips these workflows until a selection is saved for them.export const UNSET_PROVIDER_NOTES: Partial<Record<MobileInferenceScope, string>> = {cleanup: 'Not saved yet. Cleanup is skipped until you save a selection.',- agent:- 'Not saved yet. The voice assistant is skipped until you save a selection; note chat uses OpenWhispr Cloud.',+ agent: 'Not saved yet. The voice assistant is skipped until you save a selection.',};// On-Device cleanup on an iPhone that can never run Apple Intelligence.@@ -32,11 +33,11 @@ export const LOCAL_MODE_DICTATION_NOTES = {off: 'On-Device turns on Local Mode: dictation stays on this iPhone and notes ask before leaving it.',};-// What Local Mode means for note formatting and chat, which run on this iPhone first.+// What Local Mode means for note formatting, note chat and the voice assistant.export const ON_DEVICE_MODE_NOTES: Partial<Record<MobileInferenceScope, string>> = {notes: 'Local Mode formats notes on this iPhone and asks before sending one to your choice here.',- agent:- 'In Local Mode the voice assistant is off, and note chat asks before sending a note off this iPhone.',+ noteChat: 'In Local Mode note chat asks before sending a note off this iPhone.',+ agent: 'In Local Mode the voice assistant is off.',};export const PRIVATE_MODE_LOCKED_REASON =@@ -79,6 +80,19 @@ export function cleanupRunsOnDevice();}+// Text Cleanup, Note Chat and the Voice Assistant have switches of their own; switched off, they+// run nothing and use no key.+export function workflowSwitchedOff(+ config: UserConfig | null,+ scope: MobileInferenceScope,+): boolean {+ if (!config) return false;+ if (scope === 'cleanup') return !(config.cleanupEnabled ?? true);+ if (scope === 'noteChat') return !isNoteChatEnabled(config);+ if (scope === 'agent') return !isDictationAgentEnabled(config);+ return false;+}+export function parseWorkflow(value: unknown): MobileInferenceScope | null {return WORKFLOWS.find((scope) => scope === value) ?? null;}@@ -113,8 +127,10 @@ export function workflowSummary(cloudAccess?: CloudAccess;} = {},): string {+ if (workflowSwitchedOff(config, scope)) return 'Off';+ // Local Mode turns the voice assistant off.+ if (activeMode === 'private' && scope === 'agent') return 'Off';if (scope === 'cleanup') {- if (!(config?.cleanupEnabled ?? true)) return 'Off';if (cleanupRunsOnDevice(config, activeMode, cloudAccess) && onDeviceUnavailable)return `Skipped · ${onDeviceUnavailable}`;if (cloudCleanupNeedsAccount(config, activeMode, cloudAccess)) return 'Skipped · Sign in';@@ -123,7 +139,7 @@ export function workflowSummary(// Local Mode runs dictation, note formatting and provider note chat on this phone first, whatever// is saved; note chat set to OpenWhispr, or not set, goes straight to Cloud. Uploads and cleanup// run what is saved for them.- if (activeMode === 'private' && scope === 'agent' && selection.mode === 'openwhispr')+ if (activeMode === 'private' && scope === 'noteChat' && selection.mode === 'openwhispr')return MODE_LABELS.openwhispr;if (selection.mode === 'local' && isLocalModelKey(selection.modelId))return LOCAL_MODEL_TITLES[selection.modelId];diff --git a/openwhispr-mobile/src/lib/dictationAgent.ts b/openwhispr-mobile/src/lib/dictationAgent.tsindex 70f9f92ba..8cbb3236b 100644--- a/openwhispr-mobile/src/lib/dictationAgent.ts+++ b/openwhispr-mobile/src/lib/dictationAgent.ts@@ -15,22 +15,9 @@ export function isDictationAgentApplicable(mode: ProcessingMode, config: UserConreturn (mode === 'cloud' || mode === 'providers') && isDictationAgentEnabled(config);}+// Configs from before Note Chat had a switch of its own get it saved at launch (noteChatSplitConfig).export function isNoteChatEnabled(config: UserConfig): boolean {- return config.noteChatEnabled ?? isDictationAgentEnabled(config);-}--// Switching the voice assistant also saves note chat as it stands, so chat stops following the-// voice assistant's switch from then on.-export function voiceAssistantToggleConfig(- config: UserConfig | null,- enabled: boolean,-): Partial<UserConfig> {- return {- dictationAgentEnabled: enabled,- ...(config?.noteChatEnabled === undefined- ? { noteChatEnabled: config ? isNoteChatEnabled(config) : true }- : {}),- };+ return config.noteChatEnabled ?? true;}function levenshteinDistance(a: string, b: string): number {diff --git a/openwhispr-mobile/src/lib/inferenceModes.ts b/openwhispr-mobile/src/lib/inferenceModes.tsindex 4d2fa8bff..cf8df1c38 100644--- a/openwhispr-mobile/src/lib/inferenceModes.ts+++ b/openwhispr-mobile/src/lib/inferenceModes.ts@@ -1,6 +1,7 @@import { Platform } from 'react-native';import type { LucideIconName } from '@/components/ui/SystemIcon';import type { InferenceSelection, MobileInferenceScope } from '@/lib/mobileProviders';+import { isDictationAgentEnabled } from '@/lib/dictationAgent';import {inferenceToProcessingMode,processingToInferenceMode,@@ -73,6 +74,7 @@ export function localModeDefault(): InferenceMode {const onCloud =scope === 'agent' ||+ scope === 'noteChat' ||(scope === 'upload' && cloudAccess !== 'none') ||(scope === 'cleanup' && cloudAccess === 'account');return onCloud ? 'openwhispr' : 'local';@@ -85,10 +87,11 @@ type DictationModeConfig = Pick<// These workflows follow the dictation mode until they have a selection of their own, so they// would silently change destination when dictation moves to Bring Your Own Key. Cleanup is left-// out: unsaved, it is skipped in that mode, which sends nothing anywhere. The voice assistant is-// pinned only when leaving On-Device; unsaved, it is skipped rather than sent to Cloud.+// out: unsaved, it is skipped in that mode, which sends nothing anywhere. The voice assistant and+// note chat are pinned only when leaving On-Device; unsaved, the voice assistant is skipped rather+// than sent to Cloud, and note chat stays where it was before it had a setting of its own.function scopesToPin(leavingMode: ProcessingMode): MobileInferenceScope[] {- return leavingMode === 'private' ? ['upload', 'notes', 'agent'] : ['upload', 'notes'];+ return leavingMode === 'private' ? ['upload', 'notes', 'agent', 'noteChat'] : ['upload', 'notes'];}// The Dictation page and onboarding own the dictation mode;@@ -146,7 +149,9 @@ function providerDictationConfig(scope,{// Each holds what ran in the mode being left: uploads in Local Mode ran on- // OpenWhispr Cloud when there was a session.+ // OpenWhispr Cloud when there was a session. Unset note chat ran on Cloud after+ // asking; Bring Your Own Key would send it there without asking, so it is held+ // On-Device, as it was before it had a setting of its own.mode:leavingMode === 'private' && scope === 'upload'? localModeDefault(scope, cloudAccess)@@ -252,3 +257,33 @@ export function localModeUpgradeConfig(config: UserConfig): Partial<UserConfig>if (config.defaultMode !== 'private') return { localModeUpgraded: true };return { localModeUpgraded: true, ...holdOnDeviceConfig(config) };}++// Note chat once used the voice assistant's selection (agent), so a config from then gives it the+// same selection, remembered providers and hold, leaving anything saved for note chat alone.+export function noteChatSplitConfig(config: UserConfig): Partial<UserConfig> {+ const agent = config.inference?.agent;+ const copied = !!agent && !config.inference?.noteChat;+ const rememberedAgent = config.rememberedInference?.agent;+ const heldAgent = config.privateModeReturn?.pinned.agent;+ return {+ noteChatSplit: true,+ // Note chat's switch followed the voice assistant's until set; saving it keeps it put.+ ...(config.noteChatEnabled === undefined+ ? { noteChatEnabled: isDictationAgentEnabled(config) }+ : {}),+ ...(copied ? { inference: { ...config.inference, noteChat: agent } } : {}),+ ...(rememberedAgent && !config.rememberedInference?.noteChat+ ? { rememberedInference: { ...config.rememberedInference, noteChat: rememberedAgent } }+ : {}),+ ...(copied && config.pinnedInference?.includes('agent')+ ? { pinnedInference: [...config.pinnedInference, 'noteChat'] }+ : {}),+ ...(heldAgent && !config.privateModeReturn?.pinned.noteChat+ ? {+ privateModeReturn: {+ pinned: { ...config.privateModeReturn?.pinned, noteChat: heldAgent },+ },+ }+ : {}),+ };+}diff --git a/openwhispr-mobile/src/lib/mobileProviders.ts b/openwhispr-mobile/src/lib/mobileProviders.tsindex 5669449ca..cda549388 100644--- a/openwhispr-mobile/src/lib/mobileProviders.ts+++ b/openwhispr-mobile/src/lib/mobileProviders.ts@@ -1,7 +1,14 @@import catalog from '@/config/providerCatalog.json';import { isSecureHttpEndpoint, normalizeBaseUrl } from '@/lib/providerEndpoints';-export type InferenceScope = 'dictation' | 'upload' | 'meeting' | 'cleanup' | 'notes' | 'agent';+export type InferenceScope =+ | 'dictation'+ | 'upload'+ | 'meeting'+ | 'cleanup'+ | 'notes'+ | 'noteChat'+ | 'agent';export type InferenceMode = 'openwhispr' | 'local' | 'providers';export interface InferenceSelection {mode: InferenceMode;@@ -144,7 +151,7 @@ export function resolveMobileInferenceRoute(input: {const scopedPolicy = isTranscriptionScope(scope) ? policy.transcription : policy.llm;if (!isAllowedByScopePolicy(scopedPolicy, selection) ||- (scope === 'agent' && policy.agentEnabled === false)+ ((scope === 'agent' || scope === 'noteChat') && policy.agentEnabled === false))return { ok: false, code: 'POLICY_BLOCKED' };}diff --git a/openwhispr-mobile/src/screens/AIModelsScreen.tsx b/openwhispr-mobile/src/screens/AIModelsScreen.tsxindex 3b23d5f41..44edf746b 100644--- a/openwhispr-mobile/src/screens/AIModelsScreen.tsx+++ b/openwhispr-mobile/src/screens/AIModelsScreen.tsx@@ -29,7 +29,8 @@ const WORKFLOW_ICONS: Record<MobileInferenceScope, { icon: string; mdIcon: Lucidupload: { icon: 'square.and.arrow.up', mdIcon: 'Upload' },cleanup: { icon: 'sparkles', mdIcon: 'Sparkles' },notes: { icon: 'doc.text', mdIcon: 'FileText' },- agent: { icon: 'bubble.left.and.bubble.right', mdIcon: 'MessagesSquare' },+ noteChat: { icon: 'bubble.left.and.bubble.right', mdIcon: 'MessagesSquare' },+ agent: { icon: 'person.wave.2', mdIcon: 'UserRoundCog' },};function localReasoningStatusLabel(readiness: LocalReasoningReadiness | null): string {diff --git a/openwhispr-mobile/src/screens/DictationAgentScreen.tsx b/openwhispr-mobile/src/screens/DictationAgentScreen.tsxindex 55a2bc7ce..80f40739c 100644--- a/openwhispr-mobile/src/screens/DictationAgentScreen.tsx+++ b/openwhispr-mobile/src/screens/DictationAgentScreen.tsx@@ -7,11 +7,7 @@ import { SettingsSwitch } from '@/components/ui/SettingsSwitch';import { useConfigStore } from '@/store/useConfigStore';import { useConfigToggle } from '@/hooks/useConfigToggle';import { useProcessingModeStore } from '@/store/useProcessingModeStore';-import {- getDictationAgentName,- isDictationAgentEnabled,- voiceAssistantToggleConfig,-} from '@/lib/dictationAgent';+import { getDictationAgentName, isDictationAgentEnabled } from '@/lib/dictationAgent';import { PRIVATE_MODE_LOCKED_REASON } from '@/lib/aiWorkflows';import { safeHaptics } from '@/lib/utils';import { iosColor } from '@/config/colors';@@ -30,7 +26,7 @@ export function DictationAgentScreen(): React.JSX.Element {activeMode === 'private'? `${PRIVATE_MODE_LOCKED_REASON} Your settings are saved and apply once Local Mode is off.`: activeMode === 'providers' && !agentSelected- ? 'Bring Your Own Key skips the voice assistant until Chat & Voice Assistant has a selection. Your settings are saved and apply once it does.'+ ? 'Bring Your Own Key skips the voice assistant until you choose a provider for it in AI Models. Your settings are saved and apply once you do.': null;const isAvailable = !unavailableNotice;const enabled = config ? isDictationAgentEnabled(config) : true;@@ -42,9 +38,9 @@ export function DictationAgentScreen(): React.JSX.Element {const handleToggleEnabled = useCallback((value: boolean): void => {safeHaptics('light');- void updateConfig(voiceAssistantToggleConfig(config, value));+ void updateConfig({ dictationAgentEnabled: value });},- [config, updateConfig],+ [updateConfig],);const handleToggleShareContext = useConfigToggle('dictationAgentShareContext');diff --git a/openwhispr-mobile/src/screens/NoteEditorScreen.tsx b/openwhispr-mobile/src/screens/NoteEditorScreen.tsxindex da8a3e5b9..e4a8aeab7 100644--- a/openwhispr-mobile/src/screens/NoteEditorScreen.tsx+++ b/openwhispr-mobile/src/screens/NoteEditorScreen.tsx@@ -175,7 +175,7 @@ export default function NoteEditorScreen() {const autoLearnEnabled = useConfigStore((s) => s.config?.autoLearnCorrections ?? true);const notesMode = useConfigStore((s) => s.config?.inference?.notes?.mode);const notesProviderId = useConfigStore((s) => s.config?.inference?.notes?.providerId);- const chatMode = useConfigStore((s) => s.config?.inference?.agent?.mode);+ const chatMode = useConfigStore((s) => s.config?.inference?.noteChat?.mode);const chatEnabled = useConfigStore((s) => (s.config ? isNoteChatEnabled(s.config) : true));const providerNotes = notesMode === 'providers';// Only an unset or OpenWhispr chat route reaches Cloud, so only it needs an account and the paywall.diff --git a/openwhispr-mobile/src/screens/WorkflowSettingsScreen.tsx b/openwhispr-mobile/src/screens/WorkflowSettingsScreen.tsxindex 9aff7d988..a76107ccb 100644--- a/openwhispr-mobile/src/screens/WorkflowSettingsScreen.tsx+++ b/openwhispr-mobile/src/screens/WorkflowSettingsScreen.tsx@@ -53,14 +53,10 @@ import {cloudCleanupNeedsAccount,parseWorkflow,unsetSelection,+ workflowSwitchedOff,} from '@/lib/aiWorkflows';import { isLocalModelKey } from '@/lib/localModelCatalog';-import {- getDictationAgentName,- isDictationAgentEnabled,- isNoteChatEnabled,- voiceAssistantToggleConfig,-} from '@/lib/dictationAgent';+import { getDictationAgentName } from '@/lib/dictationAgent';import { safeHaptics } from '@/lib/utils';import { SystemIcon, type LucideIconName } from '@/components/ui/SystemIcon';import { type ModeSwitchResult, switchWorkflowMode } from '@/lib/workflowModeSwitch';@@ -118,25 +114,29 @@ function joinNames(names: string[]): string {}// A workflow that can be turned off: its switch sits above Mode, with the workflow's own-// settings row under it while it is on.+// settings row under it while it is on. A disabled switch shows why in its description.function WorkflowSwitchCard({title,+ label,description,icon,mdIcon,enabled,+ disabled = false,onToggle,offNote,children,}: {title: string;+ label: string;description: string;icon: string;mdIcon: LucideIconName;enabled: boolean;+ disabled?: boolean;onToggle: (value: boolean) => void;offNote: string;- children: React.ReactNode;+ children?: React.ReactNode;}): React.JSX.Element {return (<>@@ -147,12 +147,20 @@ function WorkflowSwitchCard({mdIcon={mdIcon}title={title}description={description}- rightElement={<SettingsSwitch value={enabled} onValueChange={onToggle} />}+ disabled={disabled}+ rightElement={+ <SettingsSwitch+ accessibilityLabel={label}+ value={enabled}+ disabled={disabled}+ onValueChange={onToggle}+ />+ }showChevron={false}/>{enabled ? children : null}</SettingsSection>- {enabled ? null : <SectionFooter>{offNote}</SectionFooter>}+ {enabled || disabled ? null : <SectionFooter>{offNote}</SectionFooter>}</>);}@@ -165,6 +173,7 @@ function CleanupSettings({ enabled }: { enabled: boolean }): React.JSX.Element {return (<WorkflowSwitchCardtitle="Enable Text Cleanup"+ label="Text Cleanup"description="Use AI to remove filler words, fix grammar, and polish punctuation."icon="sparkles"mdIcon="Sparkles"@@ -184,73 +193,57 @@ function CleanupSettings({ enabled }: { enabled: boolean }): React.JSX.Element {);}-// Note chat and the voice assistant share this workflow's model but switch on and off apart, so-// Private mode can turn the voice assistant off while note chat keeps working.-function AssistantSettings(): React.JSX.Element {- const config = useConfigStore((state) => state.config);+function NoteChatSettings({ enabled }: { enabled: boolean }): React.JSX.Element {+ const toggleNoteChat = useConfigToggle('noteChatEnabled');+ return (+ <WorkflowSwitchCard+ title="Enable Note Chat"+ label="Note Chat"+ description="Ask questions about your notes and get answers from them."+ icon="bubble.left.and.bubble.right"+ mdIcon="MessagesSquare"+ enabled={enabled}+ onToggle={toggleNoteChat}+ offNote="Notes don’t offer Ask about this note while note chat is off."+ />+ );+}++// Local Mode turns the voice assistant off.+function VoiceAssistantSettings({ enabled }: { enabled: boolean }): React.JSX.Element {const updateConfig = useConfigStore((state) => state.updateConfig);+ const agentName = useConfigStore((state) =>+ state.config ? getDictationAgentName(state.config) : undefined,+ );const privateMode = useProcessingModeStore((state) => state.activeMode === 'private');- const toggleNoteChat = useConfigToggle('noteChatEnabled');- const chatEnabled = config ? isNoteChatEnabled(config) : true;- const voiceEnabled = config ? isDictationAgentEnabled(config) : true;- const agentName = config ? getDictationAgentName(config) : undefined;return (- <>- <SettingsSection>- <SettingsRow- iconStyle="line"- icon="bubble.left.and.bubble.right"- mdIcon="MessagesSquare"- title="Note Chat"- description="Ask questions about your notes and get answers from them."- rightElement={- <SettingsSwitch- accessibilityLabel="Note Chat"- value={chatEnabled}- onValueChange={toggleNoteChat}- />- }- showChevron={false}- />- <SettingsRow- iconStyle="line"- icon="person.wave.2"- mdIcon="UserRoundCog"- title="Voice Assistant"- description={- privateMode- ? PRIVATE_MODE_LOCKED_REASON- : 'Say your assistant’s name while dictating to give it commands.'- }- disabled={privateMode}- rightElement={- <SettingsSwitch- accessibilityLabel="Voice Assistant"- value={voiceEnabled && !privateMode}- disabled={privateMode}- onValueChange={(enabled) => {- safeHaptics('light');- void updateConfig(voiceAssistantToggleConfig(config, enabled));- }}- />- }- showChevron={false}- />- {voiceEnabled && !privateMode ? (- <SettingsRow- iconStyle="line"- icon="slider.horizontal.3"- mdIcon="SlidersHorizontal"- title="Voice Assistant Settings"- subtitle={agentName}- onPress={() => router.push('/(account)/dictation-agent')}- />- ) : null}- </SettingsSection>- {chatEnabled || voiceEnabled ? null : (- <SectionFooter>Note chat and the voice assistant are off.</SectionFooter>- )}- </>+ <WorkflowSwitchCard+ title="Enable Voice Assistant"+ label="Voice Assistant"+ description={+ privateMode+ ? PRIVATE_MODE_LOCKED_REASON+ : 'Say your assistant’s name while dictating to give it commands.'+ }+ icon="person.wave.2"+ mdIcon="UserRoundCog"+ enabled={enabled && !privateMode}+ disabled={privateMode}+ onToggle={(value) => {+ safeHaptics('light');+ void updateConfig({ dictationAgentEnabled: value });+ }}+ offNote="Saying your assistant’s name gives no commands; what you dictate is inserted as usual."+ >+ <SettingsRow+ iconStyle="line"+ icon="slider.horizontal.3"+ mdIcon="SlidersHorizontal"+ title="Voice Assistant Settings"+ subtitle={agentName}+ onPress={() => router.push('/(account)/dictation-agent')}+ />+ </WorkflowSwitchCard>);}@@ -410,19 +403,15 @@ function WorkflowSettings({ scope }: { scope: MobileInferenceScope }): React.JSX// Keys are stored per provider (per server for Custom), so every workflow on it shares one.const keyOwner =provider?.id === 'custom' ? 'this server' : providerDisplayName(provider?.id ?? '');- // Text Cleanup, and note chat with the voice assistant, can be switched off; then they use no key.- const switchedOff = (workflow: MobileInferenceScope): boolean =>- (workflow === 'cleanup' && !(config?.cleanupEnabled ?? true)) ||- (workflow === 'agent' &&- !!config &&- !isNoteChatEnabled(config) &&- !isDictationAgentEnabled(config));- const workflowOff = switchedOff(scope);+ const workflowOff = workflowSwitchedOff(config, scope);+ // A switched-off workflow uses no key, nor does the voice assistant in Local Mode.+ const usesKey = (workflow: MobileInferenceScope): boolean =>+ !workflowSwitchedOff(config, workflow) && !(activeMode === 'private' && workflow === 'agent');const sharedWith = WORKFLOWS.filter((other) => {const saved = config?.inference?.[other];return (other !== scope &&- !switchedOff(other) &&+ usesKey(other) &&saved?.mode === 'providers' &&saved.providerId === provider?.id &&(provider?.id !== 'custom' ||@@ -819,7 +808,8 @@ function WorkflowSettings({ scope }: { scope: MobileInferenceScope }): React.JSXkeyboardDismissMode="interactive">{scope === 'cleanup' ? <CleanupSettings enabled={!workflowOff} /> : null}- {scope === 'agent' ? <AssistantSettings /> : null}+ {scope === 'noteChat' ? <NoteChatSettings enabled={!workflowOff} /> : null}+ {scope === 'agent' ? <VoiceAssistantSettings enabled={!workflowOff} /> : null}{workflowOff ? null : (<><InferenceModePickerdiff --git a/openwhispr-mobile/src/screens/__tests__/AIModelsScreen.test.tsx b/openwhispr-mobile/src/screens/__tests__/AIModelsScreen.test.tsxindex 03cd6bde2..b03226187 100644--- a/openwhispr-mobile/src/screens/__tests__/AIModelsScreen.test.tsx+++ b/openwhispr-mobile/src/screens/__tests__/AIModelsScreen.test.tsx@@ -72,6 +72,7 @@ it('shows what each workflow runs, naming the provider or on-device model', asyndictation: { mode: 'providers', providerId: 'openai', modelId: 'whisper-1' },upload: { mode: 'local', modelId: 'whisper-base' },notes: { mode: 'openwhispr' },+ noteChat: { mode: 'providers', providerId: 'custom', modelId: 'llama' },agent: { mode: 'providers', providerId: 'custom', modelId: 'llama' },},};@@ -81,7 +82,7 @@ it('shows what each workflow runs, naming the provider or on-device model', asyn// Bring Your Own Key dictation skips cleanup until a provider is saved for it.expect(screen.getByText('Not set')).toBeTruthy();expect(screen.getByText('OpenWhispr Cloud')).toBeTruthy();- expect(screen.getByText('Custom server')).toBeTruthy();+ expect(screen.getAllByText('Custom server')).toHaveLength(2);expect(screen.queryByText(/Meeting/)).toBeNull();await screen.findByText(/Status: Ready/);});@@ -215,7 +216,7 @@ it('shows provider note chat as On-Device, which answers it on this iPhone firstmockCredentialStatus.mockResolvedValue({ isConfigured: true });mockConfig = {defaultMode: 'private',- inference: { agent: { mode: 'providers', providerId: 'groq', modelId: 'llama' } },+ inference: { noteChat: { mode: 'providers', providerId: 'groq', modelId: 'llama' } },};render(<AIModelsScreen />);expect(screen.queryByText('Groq')).toBeNull();@@ -267,3 +268,11 @@ it('puts the Apple Intelligence status on its own line', async () => {'Status: Ready\nRuns On-Device text workflows, and private and signed-out note generation.',);});++it('lists Note Chat and Voice Assistant as separate workflows', async () => {+ render(<AIModelsScreen />);+ expect(screen.getByText('Note Chat')).toBeTruthy();+ expect(screen.getByText('Voice Assistant')).toBeTruthy();+ expect(screen.queryByText('Chat & Voice Assistant')).toBeNull();+ await screen.findByText(/Status: Ready/);+});diff --git a/openwhispr-mobile/src/screens/__tests__/DictationAgentScreen.test.tsx b/openwhispr-mobile/src/screens/__tests__/DictationAgentScreen.test.tsxindex 1c8ab429b..533099a65 100644--- a/openwhispr-mobile/src/screens/__tests__/DictationAgentScreen.test.tsx+++ b/openwhispr-mobile/src/screens/__tests__/DictationAgentScreen.test.tsx@@ -19,7 +19,7 @@ jest.mock('@/store/useProcessingModeStore', () => ({selector({ activeMode: mockActiveMode }),}));-const NOTICE = /skips the voice assistant until Chat & Voice Assistant has a selection/;+const NOTICE = /skips the voice assistant until you choose a provider for it in AI Models/;beforeEach(() => {jest.clearAllMocks();@@ -66,8 +66,5 @@ it('switches only the voice assistant, keeping note chat as it was', () => {render(<DictationAgentScreen />);expect(screen.queryByText(/Also turns note chat/)).toBeNull();fireEvent(screen.UNSAFE_getAllByType(Switch)[0], 'valueChange', false);- expect(mockUpdateConfig).toHaveBeenCalledWith({- dictationAgentEnabled: false,- noteChatEnabled: true,- });+ expect(mockUpdateConfig).toHaveBeenCalledWith({ dictationAgentEnabled: false });});diff --git a/openwhispr-mobile/src/screens/__tests__/NoteEditorScreen.calendarContext.test.tsx b/openwhispr-mobile/src/screens/__tests__/NoteEditorScreen.calendarContext.test.tsxindex 883c058f0..364eee6a8 100644--- a/openwhispr-mobile/src/screens/__tests__/NoteEditorScreen.calendarContext.test.tsx+++ b/openwhispr-mobile/src/screens/__tests__/NoteEditorScreen.calendarContext.test.tsx@@ -744,18 +744,15 @@ describe('NoteEditorScreen note chat', () => {expect(queryByTestId('chat-suggestion-Key decisions')).toBeNull();});- it.each([- ['note chat is off', { noteChatEnabled: false }],- ['the old shared switch was turned off', { dictationAgentEnabled: false }],- ])('hides every Ask entry point when %s', (_label, settings) => {- Object.assign(mockConfigState.config, settings);+ it('hides every Ask entry point when note chat is off', () => {+ Object.assign(mockConfigState.config, { noteChatEnabled: false });const { queryByText, queryByTestId } = render(<NoteEditorScreen />);expect(queryByText('Ask about this note')).toBeNull();expect(queryByTestId(PILL)).toBeNull();});it('keeps note chat when only the voice assistant is off', () => {- Object.assign(mockConfigState.config, { dictationAgentEnabled: false, noteChatEnabled: true });+ Object.assign(mockConfigState.config, { dictationAgentEnabled: false });const { getByTestId } = render(<NoteEditorScreen />);expect(getByTestId(PILL)).toBeTruthy();});@@ -1010,7 +1007,7 @@ describe('NoteEditorScreen On-Device and provider routes', () => {it('lets a signed-out user chat with a note when chat is On-Device', async () => {mockAuthState.user = null;- mockConfigState.config.inference = { agent: { mode: 'local' } };+ mockConfigState.config.inference = { noteChat: { mode: 'local' } };(ReasoningService.chatOverNote as jest.Mock).mockResolvedValue({ text: 'Answer', model: 'x' });const { getByTestId } = render(<NoteEditorScreen />);fireEvent.changeText(getByTestId('chat-draft'), 'Who owns the launch?');diff --git a/openwhispr-mobile/src/screens/__tests__/WorkflowSettingsScreen.test.tsx b/openwhispr-mobile/src/screens/__tests__/WorkflowSettingsScreen.test.tsxindex 88f16b309..39a4241e2 100644--- a/openwhispr-mobile/src/screens/__tests__/WorkflowSettingsScreen.test.tsx+++ b/openwhispr-mobile/src/screens/__tests__/WorkflowSettingsScreen.test.tsx@@ -544,7 +544,7 @@ it('keeps uploads on Cloud when a user with a session leaves Local Mode for a prawait waitFor(() => expect(mockUpdateConfig).toHaveBeenCalled());expect(mockUpdateConfig.mock.calls[0][0]).toMatchObject({inference: { upload: { mode: 'openwhispr' } },- pinnedInference: ['upload', 'notes', 'agent'],+ pinnedInference: ['upload', 'notes', 'agent', 'noteChat'],});});@@ -557,8 +557,8 @@ it('keeps notes and chat on this phone when dictation leaves Local Mode for a prfireEvent.press(screen.getByText('Save'));await waitFor(() => expect(mockUpdateConfig).toHaveBeenCalled());expect(mockUpdateConfig.mock.calls[0][0]).toMatchObject({- inference: { notes: { mode: 'local' }, agent: { mode: 'local' } },- pinnedInference: ['upload', 'notes', 'agent'],+ inference: { notes: { mode: 'local' }, agent: { mode: 'local' }, noteChat: { mode: 'local' } },+ pinnedInference: ['upload', 'notes', 'agent', 'noteChat'],});});@@ -886,51 +886,84 @@ it('asks for a key when none is saved', async () => {await waitFor(() => expect(mockCredentialStatus).toHaveBeenCalled());});-describe('note chat and the voice assistant', () => {+describe('the Note Chat page', () => {beforeEach(() => {- mockScope = 'agent';+ mockScope = 'noteChat';});- it('switch apart at the top of their page', () => {+ it('shows only the Note Chat switch on the Note Chat page', () => {const view = render(<WorkflowSettingsScreen />);const page = JSON.stringify(view.toJSON());expect(page.indexOf('Note Chat')).toBeLessThan(page.indexOf('OpenWhispr Cloud'));+ expect(screen.queryByLabelText('Voice Assistant')).toBeNull();fireEvent(screen.getByLabelText('Note Chat'), 'valueChange', false);expect(mockToggle).toHaveBeenCalledWith('noteChatEnabled', false);- // Note chat stops following the voice assistant's switch once that is changed.+ });++ it('hides the model choice while note chat is off', () => {+ mockConfig = { defaultMode: 'cloud', noteChatEnabled: false };+ render(<WorkflowSettingsScreen />);+ expect(screen.getByLabelText('Note Chat').props.value).toBe(false);+ expect(screen.queryByText('OpenWhispr Cloud')).toBeNull();+ });++ it('stays on when only the voice assistant is off', () => {+ mockConfig = { defaultMode: 'cloud', dictationAgentEnabled: false };+ render(<WorkflowSettingsScreen />);+ expect(screen.getByLabelText('Note Chat').props.value).toBe(true);+ });++ it('says what switching note chat off does', () => {+ mockConfig = { defaultMode: 'cloud', noteChatEnabled: false };+ render(<WorkflowSettingsScreen />);+ expect(+ screen.getByText('Notes don’t offer Ask about this note while note chat is off.'),+ ).toBeTruthy();+ });++ it('lists Note Chat and Voice Assistant as sharing a provider key', async () => {+ mockCredentialStatus.mockResolvedValue({ isConfigured: true });+ const groq = { mode: 'providers', providerId: 'groq', modelId: 'openai/gpt-oss-20b' };+ mockConfig = { defaultMode: 'cloud', inference: { noteChat: groq, agent: groq } };+ render(<WorkflowSettingsScreen />);+ expect(screen.getByText('Stays on this iPhone. Also used by Voice Assistant.')).toBeTruthy();+ await waitFor(() => expect(mockCredentialStatus).toHaveBeenCalled());+ });+});++describe('the Voice Assistant page', () => {+ beforeEach(() => {+ mockScope = 'agent';+ });++ it('shows the Voice Assistant switch and its settings on the Voice Assistant page', () => {+ const view = render(<WorkflowSettingsScreen />);+ const page = JSON.stringify(view.toJSON());+ expect(page.indexOf('Voice Assistant Settings')).toBeLessThan(page.indexOf('OpenWhispr Cloud'));+ expect(screen.queryByLabelText('Note Chat')).toBeNull();fireEvent(screen.getByLabelText('Voice Assistant'), 'valueChange', false);- expect(mockUpdateConfig).toHaveBeenCalledWith({- dictationAgentEnabled: false,- noteChatEnabled: true,- });+ expect(mockUpdateConfig).toHaveBeenCalledWith({ dictationAgentEnabled: false });fireEvent.press(screen.getByText('Voice Assistant Settings'));expect(mockPush).toHaveBeenCalledWith('/(account)/dictation-agent');});- it('keep the model choice while note chat is on and the voice assistant off', () => {+ it('hides the model choice and settings while the voice assistant is off', () => {mockConfig = { defaultMode: 'cloud', dictationAgentEnabled: false, noteChatEnabled: true };render(<WorkflowSettingsScreen />);- expect(screen.getByLabelText('Note Chat').props.value).toBe(true);expect(screen.getByLabelText('Voice Assistant').props.value).toBe(false);- expect(screen.getByText('OpenWhispr Cloud')).toBeTruthy();- expect(screen.queryByText('Voice Assistant Settings')).toBeNull();- expect(screen.queryByText('Note chat and the voice assistant are off.')).toBeNull();- });-- // The one switch both shared before is still what an existing user's choice is saved in.- it('are both off, with no model choice, when the old shared switch was turned off', () => {- mockConfig = { defaultMode: 'cloud', dictationAgentEnabled: false };- render(<WorkflowSettingsScreen />);- expect(screen.getByLabelText('Note Chat').props.value).toBe(false);expect(screen.queryByText('OpenWhispr Cloud')).toBeNull();- expect(screen.getByText('Note chat and the voice assistant are off.')).toBeTruthy();+ expect(screen.queryByText('Voice Assistant Settings')).toBeNull();+ expect(+ screen.getByText(+ 'Saying your assistant’s name gives no commands; what you dictate is inserted as usual.',+ ),+ ).toBeTruthy();});- it('show the voice assistant off in Local Mode, while note chat stays on', () => {+ it('shows the voice assistant off in Local Mode', () => {mockActiveMode = 'private';mockConfig = { defaultMode: 'private', dictationAgentEnabled: true };render(<WorkflowSettingsScreen />);- expect(screen.getByLabelText('Note Chat').props.value).toBe(true);expect(screen.getByLabelText('Voice Assistant').props.value).toBe(false);expect(screen.getByLabelText('Voice Assistant').props.disabled).toBe(true);expect(screen.getAllByText(PRIVATE_MODE_LOCKED_REASON).length).toBeGreaterThan(0);@@ -938,6 +971,39 @@ describe('note chat and the voice assistant', () => {});});+it('treats Note Chat as unused for keys once its switch is off', async () => {+ mockCredentialStatus.mockResolvedValue({ isConfigured: true });+ mockActiveMode = 'providers';+ mockScope = 'cleanup';+ const openai = { mode: 'providers', providerId: 'openai', modelId: 'gpt-5-mini' };+ mockConfig = {+ defaultMode: 'providers',+ noteChatEnabled: false,+ inference: {+ dictation: { mode: 'providers', providerId: 'openai', modelId: 'whisper-1' },+ cleanup: openai,+ noteChat: openai,+ },+ };+ render(<WorkflowSettingsScreen />);+ expect(screen.getByText('Stays on this iPhone. Also used by Dictation.')).toBeTruthy();+ await waitFor(() => expect(mockCredentialStatus).toHaveBeenCalled());+});++// Local Mode never runs the voice assistant on its saved provider.+it('treats the Voice Assistant as unused for keys in Local Mode', async () => {+ mockCredentialStatus.mockResolvedValue({ isConfigured: true });+ mockActiveMode = 'private';+ mockScope = 'noteChat';+ const groq = { mode: 'providers', providerId: 'groq', modelId: 'openai/gpt-oss-20b' };+ mockConfig = { defaultMode: 'private', inference: { noteChat: groq, agent: groq } };+ render(<WorkflowSettingsScreen />);+ expect(+ screen.getByText('Stays on this iPhone. Every workflow set to Groq uses the same key.'),+ ).toBeTruthy();+ await waitFor(() => expect(mockCredentialStatus).toHaveBeenCalled());+});+it('shows a default cleanup prompt as Default', () => {mockScope = 'cleanup';render(<WorkflowSettingsScreen />);@@ -1031,10 +1097,8 @@ it.each([});it.each([- [- 'agent',- 'In Local Mode the voice assistant is off, and note chat asks before sending a note off this iPhone.',- ],+ ['agent', 'In Local Mode the voice assistant is off.'],+ ['noteChat', 'In Local Mode note chat asks before sending a note off this iPhone.'],['notes','Local Mode formats notes on this iPhone and asks before sending one to your choice here.',@@ -1065,7 +1129,7 @@ function modeDisabled(title: string): boolean {// Every page offers every mode in Local Mode; on Dictation's, picking OpenWhispr Cloud or Bring Your// Own Key is how Local Mode is turned off.-it.each(['dictation', 'upload', 'cleanup', 'notes', 'agent'])(+it.each(['dictation', 'upload', 'cleanup', 'notes', 'noteChat', 'agent'])('locks no mode for %s in Local Mode',(scope) => {mockConfig = { defaultMode: 'private' };diff --git a/openwhispr-mobile/src/services/reasoning/ReasoningService.ts b/openwhispr-mobile/src/services/reasoning/ReasoningService.tsindex c956a05e8..d4213222c 100644--- a/openwhispr-mobile/src/services/reasoning/ReasoningService.ts+++ b/openwhispr-mobile/src/services/reasoning/ReasoningService.ts@@ -245,13 +245,13 @@ export class ReasoningService {const payload = buildChatOverNotePayload(request);const { getInferenceSelection } =require('@/lib/inferenceRouting') as typeof import('@/lib/inferenceRouting');- const selection = request.inferenceRoute ?? getInferenceSelection('agent');+ const selection = request.inferenceRoute ?? getInferenceSelection('noteChat');if (selection?.mode === 'providers' || selection?.mode === 'local') {return this.processText({text: payload.text,systemPrompt: payload.systemPrompt,signal: request.signal,- inferenceScope: 'agent',+ inferenceScope: 'noteChat',inferenceRoute: request.inferenceRoute,routing: request.routing,});diff --git a/openwhispr-mobile/src/services/reasoning/__tests__/ReasoningService.byok.test.ts b/openwhispr-mobile/src/services/reasoning/__tests__/ReasoningService.byok.test.tsindex d1dafb624..673991970 100644--- a/openwhispr-mobile/src/services/reasoning/__tests__/ReasoningService.byok.test.ts+++ b/openwhispr-mobile/src/services/reasoning/__tests__/ReasoningService.byok.test.ts@@ -148,9 +148,10 @@ it('never falls back to OpenWhispr when provider setup or execution fails', asynexpect(api.post).not.toHaveBeenCalled();});-it('routes note chat through the agent scope and retains its bounded chat prompt', async () => {+it('routes note chat by the Note Chat selection, not the voice assistant', async () => {await ReasoningService.chatOverNote({ context: 'note context', question: 'why?', history: [] });- expect(resolveMobileProviderRoute).toHaveBeenCalledWith('agent', route, false, false);+ expect(getInferenceSelection).toHaveBeenCalledWith('noteChat');+ expect(resolveMobileProviderRoute).toHaveBeenCalledWith('noteChat', route, false, false);expect(processProviderText).toHaveBeenCalledWith(expect.objectContaining({text: expect.stringContaining('NOTE OR TRANSCRIPT CONTEXT:\nnote context'),diff --git a/openwhispr-mobile/src/store/__tests__/useConfigStore.test.ts b/openwhispr-mobile/src/store/__tests__/useConfigStore.test.tsindex 6d318ee55..b03c54a70 100644--- a/openwhispr-mobile/src/store/__tests__/useConfigStore.test.ts+++ b/openwhispr-mobile/src/store/__tests__/useConfigStore.test.ts@@ -33,6 +33,8 @@ it('upgrades a Local Mode config from before the Cloud defaults before anythingconst upgraded = {defaultMode: 'private',localModeUpgraded: true,+ noteChatSplit: true,+ noteChatEnabled: true,inference: {dictation: { mode: 'local' },upload: { mode: 'local' },@@ -58,7 +60,7 @@ it('still upgrades the loaded config when saving it fails', async () => {});it('leaves an upgraded config alone', async () => {- const config = { defaultMode: 'private', localModeUpgraded: true };+ const config = { defaultMode: 'private', localModeUpgraded: true, noteChatSplit: true };mockGetConfig.mockResolvedValue(config);await useConfigStore.getState().loadConfig();@@ -72,6 +74,36 @@ it('starts a new install on the Cloud defaults', async () => {await useConfigStore.getState().loadConfig();- expect(useConfigStore.getState().config).toMatchObject({ localModeUpgraded: true });+ expect(useConfigStore.getState().config).toMatchObject({+ localModeUpgraded: true,+ noteChatSplit: true,+ });expect(mockSaveConfig).not.toHaveBeenCalled();});++// Note chat once shared the voice assistant's setting, so it keeps that setting after updating.+it('splits note chat from the voice assistant before anything reads the config', async () => {+ const groq = {+ mode: 'providers',+ providerId: 'groq',+ modelId: 'llama',+ credentialRef: 'provider.groq',+ };+ mockGetConfig.mockResolvedValue({+ defaultMode: 'cloud',+ localModeUpgraded: true,+ inference: { agent: groq },+ });++ await useConfigStore.getState().loadConfig();++ const split = {+ defaultMode: 'cloud',+ localModeUpgraded: true,+ noteChatSplit: true,+ noteChatEnabled: true,+ inference: { agent: groq, noteChat: groq },+ };+ expect(useConfigStore.getState().config).toEqual(split);+ expect(mockSaveConfig).toHaveBeenCalledWith(split);+});diff --git a/openwhispr-mobile/src/store/useConfigStore.ts b/openwhispr-mobile/src/store/useConfigStore.tsindex 4279e24c4..a990d939d 100644--- a/openwhispr-mobile/src/store/useConfigStore.ts+++ b/openwhispr-mobile/src/store/useConfigStore.ts@@ -1,7 +1,7 @@import { create } from 'zustand';import { UserConfig } from '../types';import { StorageService } from '../services/storage/StorageService';-import { localModeUpgradeConfig } from '../lib/inferenceModes';+import { localModeUpgradeConfig, noteChatSplitConfig } from '../lib/inferenceModes';import { useProcessingModeStore } from './useProcessingModeStore';interface ConfigState {@@ -17,6 +17,7 @@ const defaultConfig: UserConfig = {defaultMode: 'cloud',appleLocalIntelligenceEnabled: true,localModeUpgraded: true,+ noteChatSplit: true,};export const useConfigStore = create<ConfigState>((set, get) => ({@@ -29,12 +30,17 @@ export const useConfigStore = create<ConfigState>((set, get) => ({try {const config = await StorageService.getConfig();// A config from before Local Mode's Cloud defaults is upgraded before anything reads it, so- // its uploads and cleanup never reach Cloud. A failed save upgrades it again next launch.- const resolvedConfig = !config- ? defaultConfig- : config.localModeUpgraded+ // its uploads and cleanup never reach Cloud, and one from before note chat had a selection of+ // its own keeps the one it shared. A failed save upgrades it again next launch.+ const localModeConfig =+ !config || config.localModeUpgraded? config: { ...config, ...localModeUpgradeConfig(config) };+ const resolvedConfig = !localModeConfig+ ? defaultConfig+ : localModeConfig.noteChatSplit+ ? localModeConfig+ : { ...localModeConfig, ...noteChatSplitConfig(localModeConfig) };if (config && resolvedConfig !== config) {await StorageService.saveConfig(resolvedConfig).catch(() => undefined);}diff --git a/openwhispr-mobile/src/types/index.ts b/openwhispr-mobile/src/types/index.tsindex de12a779c..d2dba5fee 100644--- a/openwhispr-mobile/src/types/index.ts+++ b/openwhispr-mobile/src/types/index.ts@@ -23,6 +23,9 @@ export interface UserConfig {// Set once a config follows Local Mode's OpenWhispr Cloud defaults for uploads and cleanup. New// installs start with it; older configs get it from localModeUpgradeConfig at launch.localModeUpgraded?: boolean;+ // Set once note chat has its own selection, copied from the voice assistant's it used to share.+ // New installs start with it; older configs get it from noteChatSplitConfig at launch.+ noteChatSplit?: boolean;defaultMode: ProcessingMode;cleanupEnabled?: boolean;autoGenerateNoteTitle?: boolean;@@ -46,7 +49,7 @@ export interface UserConfig {appleLocalIntelligenceEnabled?: boolean;// Dictation agent (cloud-only, default on)dictationAgentEnabled?: boolean;- // Note chat, which once shared dictationAgentEnabled's switch and follows it until set.+ // Note chat, which once shared dictationAgentEnabled's switch (saved apart by noteChatSplitConfig).noteChatEnabled?: boolean;dictationAgentName?: string;dictationAgentShareContext?: boolean;