Goal
Keep the UI smooth at a fixed frame rate even during heavy I/O operations.
Description
Currently the TUI redraws on every event (keypress, channel message, etc.), which means the frame rate is tied to event frequency. During heavy I/O (large searches, installs), the UI can appear to stutter.
Decouple rendering from event handling with a dedicated render thread:
- Move the
draw_ui call to a separate thread that targets a fixed FPS (e.g., 60 FPS = 16ms sleep between frames)
- The render thread reads from a shared
Arc<RwLock<AppState>> (or similar snapshot) rather than mutable App
- The event/logic thread continues updating
App state and writing to the shared snapshot
- Use double-buffering or dirty flags to skip renders when nothing has changed
This is a significant architectural refactor. Discuss the design — particularly around terminal ownership and Ratatui's DefaultTerminal — before starting.
Tech
Rust, Concurrency (Arc, RwLock), Ratatui
Difficulty
Level 3 – Advanced
Goal
Keep the UI smooth at a fixed frame rate even during heavy I/O operations.
Description
Currently the TUI redraws on every event (keypress, channel message, etc.), which means the frame rate is tied to event frequency. During heavy I/O (large searches, installs), the UI can appear to stutter.
Decouple rendering from event handling with a dedicated render thread:
draw_uicall to a separate thread that targets a fixed FPS (e.g., 60 FPS = 16ms sleep between frames)Arc<RwLock<AppState>>(or similar snapshot) rather than mutableAppAppstate and writing to the shared snapshotThis is a significant architectural refactor. Discuss the design — particularly around terminal ownership and Ratatui's
DefaultTerminal— before starting.Tech
Rust, Concurrency (
Arc,RwLock), RatatuiDifficulty
Level 3 – Advanced