aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-16 02:26:14 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-16 02:26:14 +0300
commit72770305d388fd5ec247493e05a89b686c6d0026 (patch)
tree44d95c9c69042ab07e27ace37853e190b6f00ba0 /src/ui
parent58c379f1f07adb4113e5f9ee673768b2e4b5be07 (diff)
feat: add hook-owned custom agent status labels
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/mobile.rs4
-rw-r--r--src/ui/sidebar.rs8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ui/mobile.rs b/src/ui/mobile.rs
index 9a09f3e0..9e8c57e9 100644
--- a/src/ui/mobile.rs
+++ b/src/ui/mobile.rs
@@ -599,6 +599,9 @@ fn mobile_agent_detail(entry: &AgentPanelEntry) -> String {
if let Some(agent_label) = entry.agent_label.as_deref() {
parts.push(agent_label.to_string());
}
+ if let Some(custom_status) = entry.custom_status.as_deref() {
+ parts.push(custom_status.to_string());
+ }
format!(" {}", parts.join(" · "))
}
@@ -909,6 +912,7 @@ mod tests {
agent_label: agent_label.map(str::to_string),
state: AgentState::Idle,
seen: true,
+ custom_status: None,
}
}
diff --git a/src/ui/sidebar.rs b/src/ui/sidebar.rs
index f10c4241..29f3525d 100644
--- a/src/ui/sidebar.rs
+++ b/src/ui/sidebar.rs
@@ -24,6 +24,7 @@ pub(crate) struct AgentPanelEntry {
pub agent_label: Option<String>,
pub state: AgentState,
pub seen: bool,
+ pub custom_status: Option<String>,
}
fn sidebar_section_heights(total_h: u16, split_ratio: f32) -> (u16, u16) {
@@ -126,6 +127,7 @@ pub(crate) fn agent_panel_entries(app: &AppState) -> Vec<AgentPanelEntry> {
agent_label: None,
state: detail.state,
seen: detail.seen,
+ custom_status: detail.custom_status,
})
.collect()
}
@@ -147,6 +149,7 @@ pub(crate) fn agent_panel_entries(app: &AppState) -> Vec<AgentPanelEntry> {
agent_label: Some(detail.agent_label),
state: detail.state,
seen: detail.seen,
+ custom_status: detail.custom_status,
})
})
.collect(),
@@ -836,6 +839,10 @@ fn render_agent_detail(app: &AppState, frame: &mut Frame, area: Rect) {
status_spans.push(Span::styled(" · ", agent_style));
status_spans.push(Span::styled(agent_label, agent_style));
}
+ if let Some(custom_status) = &detail.custom_status {
+ status_spans.push(Span::styled(" · ", agent_style));
+ status_spans.push(Span::styled(custom_status.clone(), agent_style));
+ }
frame.render_widget(
Paragraph::new(Line::from(status_spans)).style(row_style),
Rect::new(body.x, row_y, body.width, 1),
@@ -934,6 +941,7 @@ mod tests {
agent_label: Some("claude".into()),
state: AgentState::Idle,
seen: true,
+ custom_status: None,
};
let label = format_agent_panel_primary_label(&entry, 18);