From 47941e31b49233744f3ebdac08b35b3b1a35fd08 Mon Sep 17 00:00:00 2001 From: Arjun <6592213+arkml@users.noreply.github.com> Date: Sat, 4 Jul 2026 12:21:15 +0530 Subject: [PATCH] remove headphone mode --- apps/x/VIDEO_MODE.md | 11 ++--- apps/x/apps/renderer/src/App.tsx | 36 +++------------- .../components/chat-input-with-mentions.tsx | 43 ------------------- .../renderer/src/components/chat-sidebar.tsx | 9 ---- 4 files changed, 11 insertions(+), 88 deletions(-) diff --git a/apps/x/VIDEO_MODE.md b/apps/x/VIDEO_MODE.md index de8c1dea..b2dc058d 100644 --- a/apps/x/VIDEO_MODE.md +++ b/apps/x/VIDEO_MODE.md @@ -50,11 +50,12 @@ avatar while off, no webcam frames captured), screen share toggle, mascot ⇄ assistant's spoken line run along the bottom. Typing in the composer still works mid-call; frames ride along with typed messages too. -Outside calls the composer keeps exactly two voice affordances: the **mic -button** (push-to-talk dictation, untouched) and the **read-aloud toggle** -(headphones; summary-style for typed chat — calls force full read-aloud and -restore the prior setting on hang-up). The old video dropdown, talking-head -toggle, and summary/full TTS dropdown are retired. +Outside calls the composer keeps exactly one voice affordance: the **mic +button** (push-to-talk dictation, untouched). Spoken responses exist only +inside calls (forced full read-aloud, off on hang-up). The old video +dropdown, talking-head toggle, read-aloud headphones toggle, and summary/full +TTS dropdown are all retired — a per-message "read aloud" action on assistant +messages is the planned replacement for text-in/voice-out. The call button is disabled unless both voice input (Deepgram) and voice output (TTS) are configured. `call_started` (with `preset`) is captured in diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index 7c0dbafc..880b9816 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -970,7 +970,8 @@ function App() { // Voice mode state const [voiceAvailable, setVoiceAvailable] = useState(false) const [ttsAvailable, setTtsAvailable] = useState(false) - const [ttsEnabled, setTtsEnabled] = useState(false) + // TTS plays only during calls now (the standing read-aloud toggle was + // retired; a per-message "read aloud" action may replace it later). const ttsEnabledRef = useRef(false) // Read-aloud style: 'summary' for typed chat, forced to 'full' during a // call and restored after. Context decides — the user never picks it. @@ -1032,8 +1033,6 @@ function App() { // Practice preset: adds the coaching persona to the system prompt. const [practiceMode, setPracticeMode] = useState(false) const practiceModeRef = useRef(false) - // TTS settings to restore when a call ends (a call forces full read-aloud). - const preCallTtsRef = useRef<{ enabled: boolean; mode: 'summary' | 'full' } | null>(null) const handleToggleMeetingRef = useRef<(() => void) | undefined>(undefined) const meetingTranscription = useMeetingTranscription(() => { @@ -1119,17 +1118,6 @@ function App() { } }, [voice]) - const handleToggleTts = useCallback(() => { - setTtsEnabled(prev => { - const next = !prev - ttsEnabledRef.current = next - if (!next) { - ttsRef.current.cancel() - } - return next - }) - }, []) - const handleCancelRecording = useCallback(() => { voice.cancel() setIsRecording(false) @@ -1169,8 +1157,6 @@ function App() { setIsRecording(false) isRecordingRef.current = false } - preCallTtsRef.current = { enabled: ttsEnabledRef.current, mode: ttsModeRef.current } - setTtsEnabled(true) ttsEnabledRef.current = true ttsModeRef.current = 'full' void voiceRef.current.startContinuous((text) => { @@ -1190,15 +1176,9 @@ function App() { const endCall = useCallback(() => { if (!inCallRef.current) return voiceRef.current.cancel() - const saved = preCallTtsRef.current - preCallTtsRef.current = null - const restoreEnabled = saved?.enabled ?? false - setTtsEnabled(restoreEnabled) - ttsEnabledRef.current = restoreEnabled - if (saved) { - ttsModeRef.current = saved.mode - } - if (!restoreEnabled) ttsRef.current.cancel() + ttsEnabledRef.current = false + ttsModeRef.current = 'summary' + ttsRef.current.cancel() video.stop() setPracticeMode(false) practiceModeRef.current = false @@ -6553,9 +6533,6 @@ function App() { onSubmitRecording={isActive ? handleSubmitRecording : undefined} onCancelRecording={isActive ? handleCancelRecording : undefined} voiceAvailable={isActive && voiceAvailable} - ttsAvailable={isActive && ttsAvailable} - ttsEnabled={ttsEnabled} - onToggleTts={isActive ? handleToggleTts : undefined} inCall={inCall} onStartCall={isActive ? startCall : undefined} onEndCall={isActive ? endCall : undefined} @@ -6666,9 +6643,6 @@ function App() { onSubmitRecording={handleSubmitRecording} onCancelRecording={handleCancelRecording} voiceAvailable={voiceAvailable} - ttsAvailable={ttsAvailable} - ttsEnabled={ttsEnabled} - onToggleTts={handleToggleTts} inCall={inCall} onStartCall={startCall} onEndCall={endCall} diff --git a/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx b/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx index 1aeaa3b7..ba87140d 100644 --- a/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx +++ b/apps/x/apps/renderer/src/components/chat-input-with-mentions.tsx @@ -15,7 +15,6 @@ import { FolderCog, FolderOpen, Globe, - Headphones, ImagePlus, LoaderIcon, Lock, @@ -246,9 +245,6 @@ interface ChatInputInnerProps { onSubmitRecording?: () => void | Promise onCancelRecording?: () => void voiceAvailable?: boolean - ttsAvailable?: boolean - ttsEnabled?: boolean - onToggleTts?: () => void /** A call is live (hands-free voice loop + spoken responses). */ inCall?: boolean /** Start a call with the given preset's device defaults. */ @@ -289,9 +285,6 @@ function ChatInputInner({ onSubmitRecording, onCancelRecording, voiceAvailable, - ttsAvailable, - ttsEnabled, - onToggleTts, inCall, onStartCall, onEndCall, @@ -1294,33 +1287,6 @@ function ChatInputInner({ ) : null} - {onToggleTts && ttsAvailable && ( - - - - - - {ttsEnabled ? 'Read responses aloud: on' : 'Read responses aloud: off'} - - - )} {onStartCall && (
@@ -1555,9 +1521,6 @@ export interface ChatInputWithMentionsProps { onSubmitRecording?: () => void | Promise onCancelRecording?: () => void voiceAvailable?: boolean - ttsAvailable?: boolean - ttsEnabled?: boolean - onToggleTts?: () => void inCall?: boolean onStartCall?: (preset: CallPreset) => void onEndCall?: () => void @@ -1591,9 +1554,6 @@ export function ChatInputWithMentions({ onSubmitRecording, onCancelRecording, voiceAvailable, - ttsAvailable, - ttsEnabled, - onToggleTts, inCall, onStartCall, onEndCall, @@ -1624,9 +1584,6 @@ export function ChatInputWithMentions({ onSubmitRecording={onSubmitRecording} onCancelRecording={onCancelRecording} voiceAvailable={voiceAvailable} - ttsAvailable={ttsAvailable} - ttsEnabled={ttsEnabled} - onToggleTts={onToggleTts} inCall={inCall} onStartCall={onStartCall} onEndCall={onEndCall} diff --git a/apps/x/apps/renderer/src/components/chat-sidebar.tsx b/apps/x/apps/renderer/src/components/chat-sidebar.tsx index 26ef078a..453b1e64 100644 --- a/apps/x/apps/renderer/src/components/chat-sidebar.tsx +++ b/apps/x/apps/renderer/src/components/chat-sidebar.tsx @@ -187,9 +187,6 @@ interface ChatSidebarProps { onSubmitRecording?: () => void | Promise onCancelRecording?: () => void voiceAvailable?: boolean - ttsAvailable?: boolean - ttsEnabled?: boolean - onToggleTts?: () => void inCall?: boolean onStartCall?: (preset: CallPreset) => void onEndCall?: () => void @@ -253,9 +250,6 @@ export function ChatSidebar({ onSubmitRecording, onCancelRecording, voiceAvailable, - ttsAvailable, - ttsEnabled, - onToggleTts, inCall, onStartCall, onEndCall, @@ -829,9 +823,6 @@ export function ChatSidebar({ onSubmitRecording={isActive ? onSubmitRecording : undefined} onCancelRecording={isActive ? onCancelRecording : undefined} voiceAvailable={isActive && voiceAvailable} - ttsAvailable={isActive && ttsAvailable} - ttsEnabled={ttsEnabled} - onToggleTts={isActive ? onToggleTts : undefined} inCall={inCall} onStartCall={isActive ? onStartCall : undefined} onEndCall={isActive ? onEndCall : undefined}