aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-03-30 13:43:41 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-03-30 13:43:41 +0300
commit0426bf53d798a182bff3a5f315ffb49f1637115a (patch)
treee1b66954ac02183174ce9ba9a8066daeb31cddb0 /src/app
parente15dfae600a0e6ef319b4244aba0aeaf01dc9b53 (diff)
refactor: rename agent states to working and blocked
Diffstat (limited to 'src/app')
-rw-r--r--src/app/actions.rs26
-rw-r--r--src/app/mod.rs4
-rw-r--r--src/app/state.rs4
3 files changed, 17 insertions, 17 deletions
diff --git a/src/app/actions.rs b/src/app/actions.rs
index aa767eb3..6c42b966 100644
--- a/src/app/actions.rs
+++ b/src/app/actions.rs
@@ -19,7 +19,7 @@ fn notification_sound_for_state_change(
}
match new_state {
- AgentState::Waiting => Some(crate::sound::Sound::Request),
+ AgentState::Blocked => Some(crate::sound::Sound::Request),
AgentState::Idle if prev_state != AgentState::Idle && !is_active_ws => {
Some(crate::sound::Sound::Done)
}
@@ -37,7 +37,7 @@ fn notification_toast_for_state_change(
}
match new_state {
- AgentState::Waiting => Some(ToastKind::NeedsAttention),
+ AgentState::Blocked => Some(ToastKind::NeedsAttention),
AgentState::Idle if prev_state != AgentState::Idle => Some(ToastKind::Finished),
_ => None,
}
@@ -219,7 +219,7 @@ impl AppState {
pane.seen = false;
}
- // Waiting prompts should always make noise; done sounds stay background-only.
+ // Blocked prompts should always make noise; done sounds stay background-only.
if self.sound.allows(agent) {
if let Some(sound) =
notification_sound_for_state_change(is_active_ws, prev_state, state)
@@ -435,11 +435,11 @@ mod tests {
state.handle_app_event(AppEvent::StateChanged {
pane_id,
agent: Some(Agent::Pi),
- state: AgentState::Busy,
+ state: AgentState::Working,
});
let pane = state.workspaces[0].panes.get(&pane_id).unwrap();
- assert_eq!(pane.state, AgentState::Busy);
+ assert_eq!(pane.state, AgentState::Working);
assert_eq!(pane.detected_agent, Some(Agent::Pi));
}
@@ -449,12 +449,12 @@ mod tests {
state.active = Some(0);
let bg_pane_id = *state.workspaces[1].panes.keys().next().unwrap();
- // First set it to Busy
+ // First set it to Working
state.workspaces[1]
.panes
.get_mut(&bg_pane_id)
.unwrap()
- .state = AgentState::Busy;
+ .state = AgentState::Working;
// Now transition to Idle while in background
state.handle_app_event(AppEvent::StateChanged {
@@ -470,7 +470,7 @@ mod tests {
#[test]
fn waiting_sound_plays_even_in_active_workspace() {
assert_eq!(
- notification_sound_for_state_change(true, AgentState::Busy, AgentState::Waiting),
+ notification_sound_for_state_change(true, AgentState::Working, AgentState::Blocked),
Some(crate::sound::Sound::Request)
);
}
@@ -478,11 +478,11 @@ mod tests {
#[test]
fn done_sound_only_plays_in_background() {
assert_eq!(
- notification_sound_for_state_change(false, AgentState::Busy, AgentState::Idle),
+ notification_sound_for_state_change(false, AgentState::Working, AgentState::Idle),
Some(crate::sound::Sound::Done)
);
assert_eq!(
- notification_sound_for_state_change(true, AgentState::Busy, AgentState::Idle),
+ notification_sound_for_state_change(true, AgentState::Working, AgentState::Idle),
None
);
}
@@ -497,7 +497,7 @@ mod tests {
state.handle_app_event(AppEvent::StateChanged {
pane_id: bg_pane_id,
agent: Some(Agent::Pi),
- state: AgentState::Waiting,
+ state: AgentState::Blocked,
});
let toast = state.toast.as_ref().unwrap();
@@ -516,7 +516,7 @@ mod tests {
.panes
.get_mut(&bg_pane_id)
.unwrap()
- .state = AgentState::Busy;
+ .state = AgentState::Working;
state.handle_app_event(AppEvent::StateChanged {
pane_id: bg_pane_id,
@@ -540,7 +540,7 @@ mod tests {
state.handle_app_event(AppEvent::StateChanged {
pane_id,
agent: Some(Agent::Pi),
- state: AgentState::Waiting,
+ state: AgentState::Blocked,
});
assert!(state.toast.is_none());
diff --git a/src/app/mod.rs b/src/app/mod.rs
index 5c5467c5..37f109cf 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -1158,8 +1158,8 @@ fn parse_api_key(key: &str) -> Option<crossterm::event::KeyEvent> {
fn pane_agent_state(state: crate::detect::AgentState) -> crate::api::schema::PaneAgentState {
match state {
crate::detect::AgentState::Idle => crate::api::schema::PaneAgentState::Idle,
- crate::detect::AgentState::Busy => crate::api::schema::PaneAgentState::Busy,
- crate::detect::AgentState::Waiting => crate::api::schema::PaneAgentState::Waiting,
+ crate::detect::AgentState::Working => crate::api::schema::PaneAgentState::Working,
+ crate::detect::AgentState::Blocked => crate::api::schema::PaneAgentState::Blocked,
crate::detect::AgentState::Unknown => crate::api::schema::PaneAgentState::Unknown,
}
}
diff --git a/src/app/state.rs b/src/app/state.rs
index a52b008e..bee6c262 100644
--- a/src/app/state.rs
+++ b/src/app/state.rs
@@ -38,9 +38,9 @@ pub struct Palette {
pub mauve: Color,
/// Done / idle states.
pub green: Color,
- /// Busy / running states.
+ /// Working / running states.
pub yellow: Color,
- /// Needs attention / waiting states.
+ /// Needs attention / blocked states.
pub red: Color,
/// Unseen / done notification accent.
pub blue: Color,