From 50ac26e398bf11837596e6614bed6274daa25ddb Mon Sep 17 00:00:00 2001 From: Ian Keane Date: Wed, 3 Dec 2025 13:31:53 -0500 Subject: [PATCH] Rebind some basic commands --- README.md | 6 +++--- src/app.rs | 14 +++++++++++++- src/ui.rs | 11 +++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 906d7cf..f126acf 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ The three available categories of task are `Permanent Items`, for tasks that wil ### The 'View Entries' Interface -Pressing `v` on the main interface will take the user to the interface for viewing actual time entries, as created from the main interface. The default view is the 'day' view, which shows your entries for the current day. You can press `g` to `group` or `ungroup` your tasks by project. You can also navigate using `h,j,k,l` between entries, entries grouped by project, grouped by day, or all entries. You can press `y` to copy the selection to your clipboard. +Pressing `v` on the main interface will take the user to the interface for viewing actual time entries, as created from the main interface. The default view is the 'day' view, which shows your entries for the current day. You can press `p` to `group` or `ungroup` your tasks by project. You can also navigate using `h,j,k,l` between entries, entries grouped by project, grouped by day, or all entries. You can press `g` to go to the top entry or `G` to go to the bottom entry. You can press `y` to copy the selection to your clipboard. ![Navigating the daily view](./assets/2-daily-view-and-proj-selection.gif "daily-view") ### Weekly and Monthly View -When in the `view` interface, you can switch to a weekly or monthly view using `w` or `m`. Grouping works the same way in these views as in the `daily` view. You can also press 'r' to reverse the order of the days in the display. +When in the `view` interface, you can switch to a weekly or monthly view using `w` or `m`. Grouping works the same way in these views as in the `daily` view (use `p` to toggle grouping). You can also press 'r' to reverse the order of the days in the display. ![Navigating by week or month](./assets/3-weekly-view-and-day-selection.gif "week-and-month-view") @@ -71,7 +71,7 @@ Otherwise, just download the latest release for a relatively-stable binary. | `Enter` | Start/stop timer | | `n` | New entry (project + optional tag) | | `p` | Reassign project for selected item | -| `v` | View Watson log (d/w/m period, g group, e edit, x delete, y copy) | +| `v` | View Watson log (d/w/m period, p group, g/G nav, e edit, x delete, y copy) | | `x` | Delete entry | | `Ctrl+e` | Edit task config (`state.yaml`) | | `c` | Edit app config (`config.yaml`) or show config help | diff --git a/src/app.rs b/src/app.rs index 71e6c63..c43c66e 100644 --- a/src/app.rs +++ b/src/app.rs @@ -594,10 +594,22 @@ impl App { (LogViewSelection::All, LogViewGrouping::ByDate) => LogViewSelection::Day, }; } - KeyCode::Char('c') => { + KeyCode::Char('y') => { self.copy_log_to_clipboard()?; } KeyCode::Char('g') => { + // Go to top entry + self.log_view_selected = 0; + self.log_view_selection_level = LogViewSelection::Entry; + self.update_log_view_scroll(); + } + KeyCode::Char('G') => { + // Go to bottom entry + self.log_view_selected = self.log_view_frame_indices.len().saturating_sub(1); + self.log_view_selection_level = LogViewSelection::Entry; + self.update_log_view_scroll(); + } + KeyCode::Char('p') => { // Toggle grouping mode self.log_view_grouping = match self.log_view_grouping { LogViewGrouping::ByDate => LogViewGrouping::ByProject, diff --git a/src/ui.rs b/src/ui.rs index 4f28eaa..5334ea5 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -354,13 +354,14 @@ fn render_help(frame: &mut Frame, app: &App) { "Log View (press 'v'):", "Once in log view, you can:", "- Switch time periods: d (day), w (week), m (month)", - "- Toggle grouping: g (by date or by project)", + "- Toggle grouping: p (by date or by project)", "- Toggle day order: r (newest first ↔ oldest first)", "- Change selection: h/l (entry → project → day → all)", "- Navigate: j/k to move through selections", + "- Go to top/bottom: g/G (go to first/last entry)", "- Edit entry: e (entry level only)", "- Delete entry: x (entry level only)", - "- Copy to clipboard: c (works at all levels)", + "- Copy to clipboard: y (works at all levels)", "- Press ? for detailed log view help", ]; @@ -933,7 +934,7 @@ fn render_log_view_help(frame: &mut Frame, app: &App) { "- m: Switch to Month view (last 31 days)", "", "Grouping:", - "- g: Toggle between grouping by Date or by Project", + "- p: Toggle between grouping by Date or by Project", " - By Date: Shows all entries chronologically", " - By Project: Groups entries by project within each date", "", @@ -957,6 +958,8 @@ fn render_log_view_help(frame: &mut Frame, app: &App) { "- h/l or ←/→: Change selection level", " - l (right): Zoom in (All → Day → Project → Entry)", " - h (left): Zoom out (Entry → Project → Day → All)", + "- g: Go to top entry", + "- G: Go to bottom entry", "- PageUp/PageDown: Jump 10 entries (Entry level only)", "", "Selection Levels (use h/l to change):", @@ -971,7 +974,7 @@ fn render_log_view_help(frame: &mut Frame, app: &App) { "- x: Delete the selected entry (Entry level only)", "- b: Backfill - set entry start time to previous entry's end time", " (Entry level, By Date view only)", - "- c: Copy selection to clipboard (works at all levels)", + "- y: Copy selection to clipboard (works at all levels)", " Copies based on current selection level", "", "Visual Indicators (By Date view only):",