Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(phone): no End on the voice line while the finger holds the microphone (GH #212)

purple082932dbd5cd
diff --git a/src/mobile/screens/remote/__tests__/remote-voice-flow.dom.test.tsx b/src/mobile/screens/remote/__tests__/remote-voice-flow.dom.test.tsx
index 7a6b0dac..3b86d788 100644
--- a/src/mobile/screens/remote/__tests__/remote-voice-flow.dom.test.tsx
+++ b/src/mobile/screens/remote/__tests__/remote-voice-flow.dom.test.tsx
@@ -121,6 +121,8 @@ describe('push to talk', () => {
})
await flush(10)
expect(screen.getByTestId('m-remote-voice').getAttribute('data-state')).toBe('recording')
+ // The finger is on the microphone: letting go ends the take, there is no End.
+ expect(screen.queryByTestId('m-remote-voice-end')).toBeNull()
fake.level = 0.4
await flush(1200)
await act(async () => {
diff --git a/src/mobile/screens/remote/parts/RemoteVoice.tsx b/src/mobile/screens/remote/parts/RemoteVoice.tsx
index eb7be032..f8c66494 100644
--- a/src/mobile/screens/remote/parts/RemoteVoice.tsx
+++ b/src/mobile/screens/remote/parts/RemoteVoice.tsx
@@ -404,7 +404,8 @@ function Clock({ since }: { since: number }) {
export function RemoteVoiceLine({ voice }: { voice: RemoteVoice }): ReactNode {
const { phase, mode, since } = voice
if (phase === 'off') return null
- const endButton = mode === 'hold' && phase === 'recording' ? null : (
+ // While the finger is on the microphone, letting go ends the take: no End there.
+ const endButton = phase === 'recording' && mode !== 'free' ? null : (
<button type="button" className="m-rvoice-end" aria-label={S.endName} data-testid="m-remote-voice-end" onClick={voice.end}>
{S.end}
</button>