mirror of
https://github.com/openai/codex.git
synced 2026-05-02 12:21:26 +03:00
rework message styling (#2877)
https://github.com/user-attachments/assets/cf07f62b-1895-44bb-b9c3-7a12032eb371
This commit is contained in:
@@ -62,20 +62,13 @@ impl HeaderEmitter {
|
||||
self.emitted_this_turn = false;
|
||||
}
|
||||
|
||||
pub(crate) fn maybe_emit(&mut self, out_lines: &mut Vec<ratatui::text::Line<'static>>) -> bool {
|
||||
pub(crate) fn maybe_emit_header(&mut self) -> bool {
|
||||
if !self.emitted_in_stream && !self.emitted_this_turn {
|
||||
// Add a leading blank line before the header for visual spacing
|
||||
out_lines.push(ratatui::text::Line::from(""));
|
||||
out_lines.push(render_header_line());
|
||||
self.emitted_in_stream = true;
|
||||
self.emitted_this_turn = true;
|
||||
return true;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn render_header_line() -> ratatui::text::Line<'static> {
|
||||
use ratatui::style::Stylize;
|
||||
ratatui::text::Line::from("codex".magenta().bold())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user