feat(tui): optimize performance by caching display lines and token counts, and improve action handling
This commit is contained in:
@@ -21,6 +21,15 @@ use zesdex_infrastructure::ToastKind;
|
||||
|
||||
const SIDEBAR_MIN_WIDTH: u16 = 90;
|
||||
|
||||
/// Pre-render hook: update mutable caches (display lines, token count)
|
||||
/// before the immutable `draw` pass. Called once per frame when dirty.
|
||||
///
|
||||
/// This separates cache mutation from rendering so `draw` can take
|
||||
/// `&AppStateRest` (required by `terminal.draw` closure constraints).
|
||||
pub fn pre_render(state: &mut AppStateRest) {
|
||||
chat::pre_render_chat(state);
|
||||
}
|
||||
|
||||
/// Top-level render entry point called once per TUI frame.
|
||||
pub fn draw(frame: &mut Frame, state: &AppStateRest) {
|
||||
let area = frame.area();
|
||||
|
||||
Reference in New Issue
Block a user