From 55684493890b4f67c73ea07b5af5911ec1b4d80e Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 30 Mar 2026 14:54:21 +0300 Subject: refactor sidebar status rollup and preserve pane order --- src/detect.rs | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'src/detect.rs') diff --git a/src/detect.rs b/src/detect.rs index ae7559bd..bc59fe25 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -16,19 +16,6 @@ pub enum AgentState { Unknown, } -impl AgentState { - /// Priority for rolling up pane states to a workspace indicator. - /// Higher = more urgent. - pub fn priority(self) -> u8 { - match self { - Self::Unknown => 0, - Self::Idle => 1, - Self::Working => 2, - Self::Blocked => 3, - } - } -} - /// Which agent we detected running in a pane. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Agent { @@ -106,16 +93,6 @@ pub fn detect_state(agent: Option, screen_content: &str) -> AgentState { } } -/// Roll up multiple pane states into a single workspace state. -/// Returns the highest-priority state among all panes. -pub fn workspace_state(pane_states: &[AgentState]) -> AgentState { - pane_states - .iter() - .max_by_key(|s| s.priority()) - .copied() - .unwrap_or(AgentState::Unknown) -} - // --------------------------------------------------------------------------- // Per-agent detectors // --------------------------------------------------------------------------- @@ -622,23 +599,6 @@ mod tests { // ---- Workspace state rollup ---- - #[test] - fn workspace_state_blocked_wins() { - let states = [AgentState::Idle, AgentState::Working, AgentState::Blocked]; - assert_eq!(workspace_state(&states), AgentState::Blocked); - } - - #[test] - fn workspace_state_working_over_idle() { - let states = [AgentState::Idle, AgentState::Working, AgentState::Unknown]; - assert_eq!(workspace_state(&states), AgentState::Working); - } - - #[test] - fn workspace_state_empty() { - assert_eq!(workspace_state(&[]), AgentState::Unknown); - } - // ---- No agent → Unknown ---- #[test] -- cgit v1.2.3