aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorYoungTaek <soomtong@gmail.com>2026-05-09 23:21:03 +0900
committerGitHub <noreply@github.com>2026-05-09 17:21:03 +0300
commit78904186dd9c9150326b2996ebebc4e8914d68d5 (patch)
tree93bc01394326b97ef934094d34743c94839aa408 /src/ui
parentdb2360f8f80d46e98e88b8649e0f2cd8a8cdbd57 (diff)
Show focus on active agent in agents panel like spaces panel does (#84)
* feat: show focus on active agent in agents panel like spaces panel does * refactor: improve to calculation and binding style
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/sidebar.rs25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/ui/sidebar.rs b/src/ui/sidebar.rs
index 36d1385a..04a3acd9 100644
--- a/src/ui/sidebar.rs
+++ b/src/ui/sidebar.rs
@@ -788,12 +788,29 @@ fn render_agent_detail(app: &AppState, frame: &mut Frame, area: Rect) {
break;
}
+ // Check if this agent entry corresponds to the active session
+ let is_active = app.is_active_pane(detail.ws_idx, detail.tab_idx, detail.pane_id);
+
let (icon, icon_style) = agent_icon(detail.state, detail.seen, app.spinner_tick, p);
let label_color = state_label_color(detail.state, detail.seen, p);
let label = state_label(detail.state, detail.seen);
- let name_style = Style::default().fg(p.subtext0).add_modifier(Modifier::BOLD);
- let status_style = Style::default().fg(label_color).add_modifier(Modifier::DIM);
+ let row_style = if is_active {
+ Style::default().bg(p.surface_dim)
+ } else {
+ Style::default()
+ };
+
+ let name_style = if is_active {
+ Style::default().fg(p.text).add_modifier(Modifier::BOLD)
+ } else {
+ Style::default().fg(p.subtext0).add_modifier(Modifier::BOLD)
+ };
+ let status_style = if is_active {
+ Style::default().fg(label_color)
+ } else {
+ Style::default().fg(label_color).add_modifier(Modifier::DIM)
+ };
let agent_style = Style::default().fg(p.overlay0).add_modifier(Modifier::DIM);
let primary_label =
@@ -805,7 +822,7 @@ fn render_agent_detail(app: &AppState, frame: &mut Frame, area: Rect) {
Span::styled(primary_label, name_style),
]);
frame.render_widget(
- Paragraph::new(name_line),
+ Paragraph::new(name_line).style(row_style),
Rect::new(body.x, row_y, body.width, 1),
);
row_y += 1;
@@ -819,7 +836,7 @@ fn render_agent_detail(app: &AppState, frame: &mut Frame, area: Rect) {
status_spans.push(Span::styled(agent_label, agent_style));
}
frame.render_widget(
- Paragraph::new(Line::from(status_spans)),
+ Paragraph::new(Line::from(status_spans)).style(row_style),
Rect::new(body.x, row_y, body.width, 1),
);
row_y += 1;