feat(claudbg-e4ac): highlight active agent in sidebar when viewing its transcript

When the user is viewing a SubagentTranscript, the corresponding entry
in the sub-agents panel is now highlighted with '>' prefix regardless
of which panel has keyboard focus.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent 76870fa306
commit 0c6ecf1165

@ -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.

@ -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),

Loading…
Cancel
Save