diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-27 23:53:37 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-27 23:53:37 +0300 |
| commit | 0403775fd2a9458417c5349d5441125ab9b2553c (patch) | |
| tree | 37f741893e063da7cfb420e5e32c960fff105a1a /src/app/actions.rs | |
| parent | 1d867053fce00e300c4551ed8087f55885e4d3c2 (diff) | |
feat: sound notifications for agent state changes
play a chime when an agent finishes work and an alert when one needs
input. only triggers for background workspaces. configurable via
sound = true/false under [ui] in config.
Diffstat (limited to 'src/app/actions.rs')
| -rw-r--r-- | src/app/actions.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/app/actions.rs b/src/app/actions.rs index 8e2e9297..c73ba646 100644 --- a/src/app/actions.rs +++ b/src/app/actions.rs @@ -157,12 +157,29 @@ impl AppState { for (ws_idx, ws) in self.workspaces.iter_mut().enumerate() { if let Some(pane) = ws.panes.get_mut(&pane_id) { let is_active_ws = self.active == Some(ws_idx); + let prev_state = pane.state; + + // Mark unseen when transitioning to Idle in background if state == AgentState::Idle - && pane.state != AgentState::Idle + && prev_state != AgentState::Idle && !is_active_ws { pane.seen = false; } + + // Sound notifications for background state changes + if self.sound && !is_active_ws && state != prev_state { + match state { + AgentState::Idle if prev_state != AgentState::Idle => { + crate::sound::play(crate::sound::Sound::Done); + } + AgentState::Waiting => { + crate::sound::play(crate::sound::Sound::Request); + } + _ => {} + } + } + pane.detected_agent = agent; pane.state = state; break; |
