aboutsummaryrefslogtreecommitdiff
path: root/src/detect.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-03-30 14:54:21 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-03-30 14:54:21 +0300
commit55684493890b4f67c73ea07b5af5911ec1b4d80e (patch)
tree60d84536c377bc9a124c11a4b02f9e6da854caba /src/detect.rs
parentca93e6e2511d13b7041504e0665fff2d7a402c28 (diff)
refactor sidebar status rollup and preserve pane order
Diffstat (limited to 'src/detect.rs')
-rw-r--r--src/detect.rs40
1 files changed, 0 insertions, 40 deletions
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<Agent>, 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]