diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-07-25 23:20:08 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-25 23:20:08 +0300 |
| commit | b01fc37e66aac45c7fa9eccc826d793d68608a0a (patch) | |
| tree | add6d6755c0817289f2dfdb9c16924943fa57485 /src/ui.rs | |
| parent | da40b1aa347d07e60057182f81e5bcd1d12e9fb1 (diff) | |
perf: avoid full pane renders for spinner animation (#1868)
Diffstat (limited to 'src/ui.rs')
| -rw-r--r-- | src/ui.rs | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -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 { |
