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): use a running-late message in the voice assistant onboarding (#2564)
Chad Piha728e9f6c4c6f
diff --git a/openwhispr-mobile/src/screens/onboarding/steps/VoiceAgentStep.tsx b/openwhispr-mobile/src/screens/onboarding/steps/VoiceAgentStep.tsxindex c984cad08..831b83e0d 100644--- a/openwhispr-mobile/src/screens/onboarding/steps/VoiceAgentStep.tsx+++ b/openwhispr-mobile/src/screens/onboarding/steps/VoiceAgentStep.tsx@@ -19,13 +19,11 @@ import { addKeyboardStatusChangedListener } from '../../../../modules/app-group-type Phase = 'start' | 'asking' | 'first-draft' | 'refined' | 'done';-// What users say in the live try, and what the example shows when the live try can't run. It's kept-// short so it's easy to repeat, and names the company and when so the draft leaves nothing to fill-// in but the sender's name, which the follow-up adds.-const REQUEST =- 'I cancelled Netflix last month but got charged again. Draft a message asking for a refund.';-const EXAMPLE_DRAFT =- 'Hi Netflix Support,\n\nI cancelled my subscription last month, but I was charged again this month. Could you please refund this charge?\n\nThanks';+// What users say in the live try, and what the example shows when the live try can't run. The agent+// brackets every fact it isn't given, so the request leaves just one (the new meeting time) for the+// follow-up to fill in.+const REQUEST = 'Tell Sam I’m running late and ask if we can push our meeting.';+const EXAMPLE_DRAFT = 'Hey Sam, I’m running late. Could we push our meeting a bit?';// The field is focused on arrival, so the first instruction points straight at the keyboard's agent// button, drawn with the same glyph the keyboard uses.@@ -37,7 +35,7 @@ const INSTRUCTIONS: Record<Phase, ReactNode> = {</>),asking: `Say: “${REQUEST}”`,- 'first-draft': 'Now tap Ask for changes and add your name. Say: “My name is …”',+ 'first-draft': 'Now tap Ask for changes and add a time. Say: “Make it 3 PM.”',refined: 'Tap ✓ to insert it.',done: 'That’s your voice assistant.',};@@ -181,7 +179,7 @@ export function VoiceAgentStep(): ReactElement {) : null}<View className="rounded-2xl border border-separator bg-secondarySystemGroupedBackground px-4 pb-4 pt-3"><Text className="mb-2 text-[11px] font-bold uppercase tracking-wider text-tertiaryLabel">- To: Support+ To: Sam</Text><TextInputref={input}diff --git a/openwhispr-mobile/src/screens/onboarding/steps/__tests__/VoiceAgentStep.test.tsx b/openwhispr-mobile/src/screens/onboarding/steps/__tests__/VoiceAgentStep.test.tsxindex 5113a0b9b..85664ac2b 100644--- a/openwhispr-mobile/src/screens/onboarding/steps/__tests__/VoiceAgentStep.test.tsx+++ b/openwhispr-mobile/src/screens/onboarding/steps/__tests__/VoiceAgentStep.test.tsx@@ -58,9 +58,8 @@ jest.mock('@/store/useAuthStore', () => ({// The field is focused on arrival, and the glyph is the keyboard's own agent button.const START = 'Tap the [wand.and.stars] button on your keyboard.';-const ASK =- 'Say: “I cancelled Netflix last month but got charged again. Draft a message asking for a refund.”';-const FOLLOW_UP = 'Now tap Ask for changes and add your name. Say: “My name is …”';+const ASK = 'Say: “Tell Sam I’m running late and ask if we can push our meeting.”';+const FOLLOW_UP = 'Now tap Ask for changes and add a time. Say: “Make it 3 PM.”';const INSERT = 'Tap ✓ to insert it.';const DONE = 'That’s your voice assistant.';const ACCOUNT_REQUIRED =@@ -109,26 +108,24 @@ it('nudges with a haptic each time the instruction changes', () => {expect(safeHaptics).toHaveBeenCalledTimes(3);fireEvent.changeText(screen.getByLabelText('Your message'),- 'Hi, please refund this charge and confirm my subscription is cancelled.',+ 'Hey Sam, I’m running late. Could we push our meeting to 3 PM?',);expect(safeHaptics).toHaveBeenLastCalledWith('success');});-it('addresses the practice email to Support', () => {+it('addresses the practice message to Sam', () => {const screen = render(<VoiceAgentStep />);- expect(screen.getByText('To: Support')).toBeTruthy();+ expect(screen.getByText('To: Sam')).toBeTruthy();});-it('shows the refund request and a drafted email when the live try is unavailable', () => {+it('shows the request and a drafted message when the live try is unavailable', () => {mockUser = null;const screen = render(<VoiceAgentStep />);expect(- screen.getByText(- '“I cancelled Netflix last month but got charged again. Draft a message asking for a refund.”',- ),+ screen.getByText('“Tell Sam I’m running late and ask if we can push our meeting.”'),).toBeTruthy();- expect(screen.getByText(/Could you please refund this charge\?/)).toBeTruthy();- expect(screen.queryByText(/confirm/)).toBeNull();+ expect(screen.getByText(/Could we push our meeting a bit\?/)).toBeTruthy();+ expect(screen.queryByText(/3 PM/)).toBeNull();expect(screen.queryByText(/lunch/)).toBeNull();});@@ -146,7 +143,7 @@ it('walks through a request, a spoken follow-up and inserting the result', () =>expect(screen.getByText(INSERT)).toBeTruthy();fireEvent.changeText(screen.getByLabelText('Your message'),- 'Hi, please refund this charge and confirm my subscription is cancelled.',+ 'Hey Sam, I’m running late. Could we push our meeting to 3 PM?',);expect(screen.getByText(DONE)).toBeTruthy();});@@ -155,7 +152,7 @@ it('does not count ordinary dictation as trying the agent', () => {const screen = render(<VoiceAgentStep />);emit('recording');emit('ready');- fireEvent.changeText(screen.getByLabelText('Your message'), 'Please refund the charge.');+ fireEvent.changeText(screen.getByLabelText('Your message'), 'Running late, can we push?');expect(screen.queryByText(DONE)).toBeNull();expect(screen.getByText(ASK)).toBeTruthy();});@@ -187,7 +184,7 @@ it('keeps the first draft insertable when the refinement fails', () => {expect(screen.queryByText('Example request')).toBeNull();fireEvent.changeText(screen.getByLabelText('Your message'),- 'Hi, please refund this charge and confirm my subscription is cancelled.',+ 'Hey Sam, I’m running late. Could we push our meeting to 3 PM?',);expect(screen.getByText(DONE)).toBeTruthy();expect(screen.queryByText('Retry')).toBeNull();@@ -211,14 +208,12 @@ it('keeps the finished step when an agent error arrives after inserting the drafemit('agent_ready', undefined, '1000');fireEvent.changeText(screen.getByLabelText('Your message'),- 'Hi, please refund this charge and confirm my subscription is cancelled.',+ 'Hey Sam, I’m running late. Could we push our meeting to 3 PM?',);emit('agent_error', 'account_required');expect(screen.getByText(DONE)).toBeTruthy();expect(- screen.getByDisplayValue(- 'Hi, please refund this charge and confirm my subscription is cancelled.',- ),+ screen.getByDisplayValue('Hey Sam, I’m running late. Could we push our meeting to 3 PM?'),).toBeTruthy();expect(screen.queryByText(ACCOUNT_REQUIRED)).toBeNull();expect(screen.queryByText('Example request')).toBeNull();