diff --git a/.beans/claudbg-e4ac--tui-selected-agent-highlights-in-agents-widget-whe.md b/.beans/claudbg-e4ac--tui-selected-agent-highlights-in-agents-widget-whe.md index 14627b8..43562a5 100644 --- a/.beans/claudbg-e4ac--tui-selected-agent-highlights-in-agents-widget-whe.md +++ b/.beans/claudbg-e4ac--tui-selected-agent-highlights-in-agents-widget-whe.md @@ -1,10 +1,15 @@ --- # claudbg-e4ac title: 'TUI: selected agent highlights in agents widget when viewing agent transcript' -status: todo +status: completed type: feature +priority: normal created_at: 2026-03-31T23:45:09Z -updated_at: 2026-03-31T23:45:09Z +updated_at: 2026-04-01T05:55:52Z --- When an agent transcript is being viewed, the corresponding agent entry in the agents widget panel should be highlighted/selected to show which agent is active. + +## Summary of Changes + +In `render_transcript` (`src/tui/screens/transcript.rs`), changed the agent highlight condition to check two cases: `is_viewing` (current screen is `SubagentTranscript` with matching `agent_id`) OR `is_panel_selected` (index matches `subagent_selected` and panel has focus). The agent in view is always highlighted regardless of which panel has focus. diff --git a/src/tui/screens/transcript.rs b/src/tui/screens/transcript.rs index 3a93979..96fe827 100644 --- a/src/tui/screens/transcript.rs +++ b/src/tui/screens/transcript.rs @@ -496,7 +496,16 @@ pub fn render_transcript(f: &mut Frame, area: Rect, state: &AppState) { agent.agent_id.clone() }; let agent_type = agent.agent_type.as_deref().unwrap_or("agent").to_string(); - if i == state.subagent_selected && state.focus == Focus::SubagentsPanel { + // Highlight when this agent is the one currently being viewed + // (SubagentTranscript) OR when it is selected in the panel. + let is_viewing = matches!( + &state.screen, + crate::tui::state::Screen::SubagentTranscript { agent_id, .. } + if *agent_id == agent.agent_id + ); + let is_panel_selected = + i == state.subagent_selected && state.focus == Focus::SubagentsPanel; + if is_viewing || is_panel_selected { Line::from(Span::styled( format!("> {short_id} {agent_type}"), Style::default().fg(Color::Yellow),