Skip to content

[UI] Plugin/Widget API for the Status Bar #83

@yashksaini-coder

Description

@yashksaini-coder

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
}
  1. Define the trait and a registry of active widgets in App
  2. Implement built-in example widgets: system clock, CPU usage (via /proc/stat), active manager name
  3. Allow users to enable/disable widgets via config.toml (e.g., status_widgets = ["clock", "cpu"])
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions