diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 00:32:35 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-03-28 00:32:35 +0300 |
| commit | f8c4d6a5f1bd4bcaee43ba3e1373465cd960cdc3 (patch) | |
| tree | 10e9d52f05b476f83a3ee88a87a7c8f7aca9eca6 /src/app/actions.rs | |
| parent | 787786c62009f6c27a0091b61017ae5ad5c95c0e (diff) | |
feat: add per-agent sound overrides
Diffstat (limited to 'src/app/actions.rs')
| -rw-r--r-- | src/app/actions.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/app/actions.rs b/src/app/actions.rs index c73ba646..98159fcc 100644 --- a/src/app/actions.rs +++ b/src/app/actions.rs @@ -62,7 +62,8 @@ impl AppState { pub fn resize_pane(&mut self, direction: NavDirection) { if let Some(first) = self.view.pane_infos.first() { let area = self - .view.pane_infos + .view + .pane_infos .iter() .fold(first.rect, |acc, p| acc.union(p.rect)); if let Some(ws) = self.active.and_then(|i| self.workspaces.get_mut(i)) { @@ -168,7 +169,7 @@ impl AppState { } // Sound notifications for background state changes - if self.sound && !is_active_ws && state != prev_state { + if self.sound.allows(agent) && !is_active_ws && state != prev_state { match state { AgentState::Idle if prev_state != AgentState::Idle => { crate::sound::play(crate::sound::Sound::Done); @@ -390,7 +391,11 @@ mod tests { let bg_pane_id = *state.workspaces[1].panes.keys().next().unwrap(); // First set it to Busy - state.workspaces[1].panes.get_mut(&bg_pane_id).unwrap().state = AgentState::Busy; + state.workspaces[1] + .panes + .get_mut(&bg_pane_id) + .unwrap() + .state = AgentState::Busy; // Now transition to Idle while in background state.handle_app_event(AppEvent::StateChanged { |
