feat(claudbg-mfpd): Esc/Backspace returns to session transcript from agent transcript

When on SubagentTranscript, Esc or Backspace now goes back to the parent
session's Transcript view (lazy-reloads entries) instead of jumping all
the way to the session list. Transcript → session list path unchanged.

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

@ -1,10 +1,17 @@
---
# claudbg-mfpd
title: 'TUI: navigate back to main session transcript from agent transcript'
status: todo
status: completed
type: feature
priority: normal
created_at: 2026-03-31T23:45:12Z
updated_at: 2026-03-31T23:45:12Z
updated_at: 2026-04-01T05:55:11Z
---
There is currently no way to navigate back to the main session transcript after drilling into an agent transcript. Add a keybinding (e.g. Backspace or Escape) to return to the parent session view.
## Summary of Changes
Added `go_back_to_transcript(parent_session_id)` to `AppState` in `state.rs`: transitions to `Screen::Transcript { session_id: parent_session_id }`, clears transcript entries (to trigger lazy-reload), and leaves `subagents` intact (they belong to the parent session).
Changed the Esc/Backspace arm in `handle_transcript_event` (`transcript.rs`) to be context-aware: when on `SubagentTranscript`, calls `go_back_to_transcript` to return to the parent session view; when on `Transcript`, calls `go_back` to return to the session list. Backspace is added as a second binding alongside Escape.

@ -551,9 +551,17 @@ pub fn handle_transcript_event(event: Event, state: &mut AppState) -> bool {
};
true
}
// Navigate back to the session list.
KeyCode::Esc => {
state.go_back();
// Navigate back: from SubagentTranscript → parent session transcript;
// from Transcript → session list.
KeyCode::Esc | KeyCode::Backspace => {
if let crate::tui::state::Screen::SubagentTranscript {
parent_session_id, ..
} = state.screen.clone()
{
state.go_back_to_transcript(&parent_session_id);
} else {
state.go_back();
}
true
}
// Show quit dialog (don't exit immediately on transcript screen).

@ -300,6 +300,27 @@ impl AppState {
self.focus = Focus::ChatLog;
}
/// Return to the parent session's transcript from a sub-agent transcript.
///
/// Clears transcript entries so the lazy-loader will reload the parent
/// session's content. The sub-agents list is left intact because it
/// belongs to the parent session and will still be accurate.
pub fn go_back_to_transcript(&mut self, parent_session_id: &str) {
self.screen = Screen::Transcript {
session_id: parent_session_id.to_string(),
};
self.transcript_entries.clear();
self.transcript_scroll = 0;
self.transcript_h_scroll = 0;
self.search_input.clear();
self.search_active.clear();
self.search_match_lines.clear();
self.search_current_match = 0;
self.pending_g = false;
self.focus = Focus::ChatLog;
// Leave subagents intact — they belong to the parent session.
}
/// Return to the session-list screen.
///
/// Clears transcript and sub-agent data. The session list and the

Loading…
Cancel
Save