feat(tui): optimize performance by caching display lines and token counts, and improve action handling

This commit is contained in:
asepharyana
2026-07-20 13:52:20 +07:00
parent 148ba4e07b
commit 87abe8c335
8 changed files with 180 additions and 60 deletions
@@ -37,7 +37,7 @@ pub fn render(
)));
} else {
let start = if messages.len() > 8 { messages.len() - 8 } else { 0 };
for msg in &messages[start..] {
for msg in messages.iter().skip(start) {
let role_str = match msg.role {
Role::User => "User",
Role::Assistant => "Asst",