feat(desktop): mirror call state onto the tray icon (cinny-desktop #4)

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
Lotus CI
2026-09-23 21:53:48 -04:00
co-authored by Claude Opus 5.5
parent b77720c3da
commit 25fa0f6ef9
+4 -1
View File
@@ -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<ThumbbarAction>('thumbbar-action', ({ action }) => {