From b01fc37e66aac45c7fa9eccc826d793d68608a0a Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 25 Jul 2026 23:20:08 +0300 Subject: perf: avoid full pane renders for spinner animation (#1868) --- src/ui.rs | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src/ui.rs') diff --git a/src/ui.rs b/src/ui.rs index 6d5c02f1..ed1f6a7d 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -394,19 +394,10 @@ pub fn render_with_runtime_registry( terminal_runtimes: &TerminalRuntimeRegistry, frame: &mut Frame, ) { - let sidebar_area = app.view.sidebar_rect; let tab_bar_area = app.view.tab_bar_rect; let terminal_area = app.view.terminal_area; - if app.view.layout == ViewLayout::Mobile { - render_mobile_header(app, terminal_runtimes, frame, app.view.mobile_header_rect); - } else if sidebar_area.width > 0 { - if app.sidebar_collapsed { - render_sidebar_collapsed(app, frame, sidebar_area); - } else { - render_sidebar(app, terminal_runtimes, frame, sidebar_area); - } - } + render_working_animation(app, terminal_runtimes, frame); if app.view.layout != ViewLayout::Mobile { render_tab_bar(app, frame, tab_bar_area); } @@ -457,6 +448,22 @@ pub fn render_with_runtime_registry( } } +pub(crate) fn render_working_animation( + app: &AppState, + terminal_runtimes: &TerminalRuntimeRegistry, + frame: &mut Frame, +) { + if app.view.layout == ViewLayout::Mobile { + render_mobile_header(app, terminal_runtimes, frame, app.view.mobile_header_rect); + } else if app.view.sidebar_rect.width > 0 { + if app.sidebar_collapsed { + render_sidebar_collapsed(app, frame, app.view.sidebar_rect); + } else { + render_sidebar(app, terminal_runtimes, frame, app.view.sidebar_rect); + } + } +} + fn render_notifications(app: &AppState, frame: &mut Frame, terminal_area: Rect) { let has_config_diagnostic = app.config_diagnostic.is_some(); if let Some(message) = &app.config_diagnostic { -- cgit v1.2.3