perf(tui): avoid redundant idle rendering

This commit is contained in:
objz committed 2026-07-11 17:13:02 +02:00
1 parent d10be1676e
commit c792e1cc11
9 files changed
+144 -63

No files matched your search

+12
View File
@@ -9,6 +9,18 @@ pub mod progress;
mod render;
pub mod widgets;
use std::sync::atomic::{AtomicBool, Ordering};
static REDRAW_REQUESTED: AtomicBool = AtomicBool::new(true);
pub fn request_redraw() {
REDRAW_REQUESTED.store(true, Ordering::Release);
}
pub(super) fn take_redraw_request() -> bool {
REDRAW_REQUESTED.swap(false, Ordering::AcqRel)
}
pub type Tui = ratatui::DefaultTerminal;
pub async fn show() -> color_eyre::Result<()> {