tui: separator above final agent message (#4324)
Adds a separator line before the final agent message <img width="1011" height="884" alt="Screenshot 2025-09-26 at 4 55 01 PM" src="https://github.com/user-attachments/assets/7c91adbf-6035-4578-8b88-a6921f11bcbc" />
This commit is contained in:
@@ -1090,6 +1090,40 @@ pub(crate) fn new_reasoning_summary_block(
|
||||
Box::new(new_reasoning_block(full_reasoning_buffer, config))
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FinalMessageSeparator {
|
||||
elapsed_seconds: Option<u64>,
|
||||
}
|
||||
impl FinalMessageSeparator {
|
||||
pub(crate) fn new(elapsed_seconds: Option<u64>) -> Self {
|
||||
Self { elapsed_seconds }
|
||||
}
|
||||
}
|
||||
impl HistoryCell for FinalMessageSeparator {
|
||||
fn display_lines(&self, width: u16) -> Vec<Line<'static>> {
|
||||
let elapsed_seconds = self
|
||||
.elapsed_seconds
|
||||
.map(super::status_indicator_widget::fmt_elapsed_compact);
|
||||
if let Some(elapsed_seconds) = elapsed_seconds {
|
||||
let worked_for = format!("─ Worked for {elapsed_seconds} ─");
|
||||
let worked_for_width = worked_for.width();
|
||||
vec![
|
||||
Line::from_iter([
|
||||
worked_for,
|
||||
"─".repeat((width as usize).saturating_sub(worked_for_width)),
|
||||
])
|
||||
.dim(),
|
||||
]
|
||||
} else {
|
||||
vec![Line::from_iter(["─".repeat(width as usize).dim()])]
|
||||
}
|
||||
}
|
||||
|
||||
fn transcript_lines(&self) -> Vec<Line<'static>> {
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
|
||||
fn format_mcp_invocation<'a>(invocation: McpInvocation) -> Line<'a> {
|
||||
let args_str = invocation
|
||||
.arguments
|
||||
|
||||
Reference in New Issue
Block a user