Goal
Allow users and contributors to add small widgets (clock, CPU, network) to the TRX status bar.
Description
Refactor src/ui/draw.rs to support a plugin-style Widget trait:
pub trait StatusWidget: Send + Sync {
fn render(&self, frame: &mut Frame, area: Rect);
fn tick(&mut self); // called on each frame
}
- Define the trait and a registry of active widgets in
App
- Implement built-in example widgets: system clock, CPU usage (via
/proc/stat), active manager name
- Allow users to enable/disable widgets via
config.toml (e.g., status_widgets = ["clock", "cpu"])
- Allocate space for widgets in the bottom status bar layout
This is a significant refactor of the draw logic — discuss the design before starting.
Tech
Rust, Ratatui, Trait Objects (dyn StatusWidget)
Difficulty
Level 3 – Advanced
Goal
Allow users and contributors to add small widgets (clock, CPU, network) to the TRX status bar.
Description
Refactor
src/ui/draw.rsto support a plugin-styleWidgettrait:App/proc/stat), active manager nameconfig.toml(e.g.,status_widgets = ["clock", "cpu"])This is a significant refactor of the draw logic — discuss the design before starting.
Tech
Rust, Ratatui, Trait Objects (
dyn StatusWidget)Difficulty
Level 3 – Advanced