Refactor TUI message formatting: add role label toggle, improve indentation, and adjust role label styling logic. Optimize provider handling.

This commit is contained in:
2025-09-27 07:11:57 +02:00
parent 306104c5b4
commit 6ddc66d864
3 changed files with 24 additions and 13 deletions

View File

@@ -30,6 +30,11 @@ impl MessageFormatter {
self.wrap_width = width.max(20);
}
/// Whether role labels should be shown alongside messages
pub fn show_role_labels(&self) -> bool {
self.show_role_labels
}
pub fn format_message(&self, message: &Message) -> Vec<String> {
// 1) Normalize line breaks to '\n' (handles CR, NEL, LS, PS)
let normalized: String = message