From 2a40c1bc7a1869f921c3428546f81f3f1cb26e07 Mon Sep 17 00:00:00 2001 From: Saiyed Shizain Date: Sun, 18 Jan 2026 22:03:38 +0530 Subject: add a dynamic help menu --- src/pomo/state.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/pomo/state.rs') diff --git a/src/pomo/state.rs b/src/pomo/state.rs index 3076174..f4a7a5e 100644 --- a/src/pomo/state.rs +++ b/src/pomo/state.rs @@ -31,6 +31,12 @@ pub struct Pomo { pub tasks: Vec, pub task_state: ListState, pub should_quit: bool, + pub show_help: bool +} + +pub struct Command { + pub key: &'static str, + pub desc: &'static str, } impl Pomo { @@ -47,6 +53,7 @@ impl Pomo { tasks: dummy_tasks, task_state: ListState::default(), should_quit: false, + show_help: false } } @@ -106,4 +113,14 @@ impl Pomo { self.tasks[i].is_done = !self.tasks[i].is_done; } } + + pub fn get_commands(&self) -> Vec { + vec![ + Command { key: "Space", desc: "Toggle Timer" }, + Command { key: "j/k", desc: "Navigate Tasks" }, + Command { key: "Enter", desc: "Toggle Done" }, + Command { key: "?", desc: "Toggle Help" }, + Command { key: "q", desc: "Quit" }, + ] + } } -- cgit v1.2.3