From 25fa0f6ef9f4beed98d0b8dcb244523ac99077a9 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Wed, 23 Sep 2026 21:53:48 -0400 Subject: [PATCH] feat(desktop): mirror call state onto the tray icon (cinny-desktop #4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sends `set_tray_call_state` from the same effect as the taskbar thumbbar, so tray and thumbbar can't disagree. Verified through a real local call: idle → active → active+muted → active+muted+deafened → active+muted → idle. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- src/app/hooks/useTauriThumbbar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/hooks/useTauriThumbbar.ts b/src/app/hooks/useTauriThumbbar.ts index 6ee6a2183..23abea140 100644 --- a/src/app/hooks/useTauriThumbbar.ts +++ b/src/app/hooks/useTauriThumbbar.ts @@ -10,7 +10,7 @@ type ThumbbarAction = { action: 'mute' | 'deafen' | 'end' }; * P5-44 — Taskbar thumbnail toolbar (call controls). While a call is active, * mirrors the mic/sound state onto the native `set_thumbbar` command (three * Mute / Deafen / End-Call buttons on the Windows taskbar thumbnail toolbar) and - * hides them when the call ends. Thumb-button clicks come back as the + * hides them when the call ends. The tray icon mirrors the same state. Thumb-button clicks come back as the * `thumbbar-action` event and drive the real call controls. No-op in the browser. */ export function useTauriThumbbar(): void { @@ -25,6 +25,9 @@ export function useTauriThumbbar(): void { useEffect(() => { invokeTauri('set_thumbbar', { active, muted, deafened }); + // [cinny-desktop #4] Same state onto the tray icon + tooltip, from the same + // effect so the tray and the thumbbar can never disagree. + invokeTauri('set_tray_call_state', { active, muted, deafened }); }, [active, muted, deafened]); useTauriEvent('thumbbar-action', ({ action }) => {