summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-22 21:56:47 +0300
committerGitHub <noreply@github.com>2025-06-22 21:56:47 +0300
commit42376ab241712e14a540a5e9b94739a34136e7ac (patch)
tree63147efd20f747d603bcb7aa50253609e91fffc9
parent2258ab6628d6d93e03a265407db4690b7c659765 (diff)
parent7b3c67341c1ebbc2e9e855f43ad653e6eaac0d98 (diff)
Merge pull request #88 from snonux/codex/add-space-hotkey-to-refresh-task-list
Add space hotkey for refreshing tasks
-rw-r--r--README.md3
-rw-r--r--internal/ui/table.go18
2 files changed, 13 insertions, 8 deletions
diff --git a/README.md b/README.md
index 7750118..8a71b5d 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ Task Samurai invokes the `task` command to read and modify tasks. The tasks are
- `↑/k` and `↓/j`: move up and down
- `←/h` and `→/l`: move left and right
- `b/pgup`: page up
-- `pgdn/space`: page down
+- `pgdn`: page down
- `u` or `ctrl+u`: half page up
- `ctrl+d`: half page down
- `g/home/0`: go to start
@@ -53,6 +53,7 @@ Task Samurai invokes the `task` command to read and modify tasks. The tasks are
- `f`: change filter
- `c`: random theme
- `C`: reset theme
+- `space`: refresh tasks
- `H`: toggle help
- `q` or `esc`: close search/help or quit (press `q` when nothing is open)
diff --git a/internal/ui/table.go b/internal/ui/table.go
index 1ec7313..febb8ff 100644
--- a/internal/ui/table.go
+++ b/internal/ui/table.go
@@ -304,13 +304,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, blinkCmd()
}
return m, nil
- case tea.KeyMsg:
- // Ignore all key presses while a task is blinking to avoid
- // accidentally modifying another task.
- if m.blinkID != 0 {
- return m, nil
- }
- if m.annotating {
+ case tea.KeyMsg:
+ // Ignore all key presses while a task is blinking to avoid
+ // accidentally modifying another task.
+ if m.blinkID != 0 {
+ return m, nil
+ }
+ if m.annotating {
switch msg.Type {
case tea.KeyEnter:
if m.replaceAnnotations {
@@ -738,6 +738,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.theme = m.defaultTheme
m.applyTheme()
return m, nil
+ case " ":
+ m.reload()
+ return m, nil
case "/", "?":
m.searching = true
m.searchInput.SetValue("")
@@ -874,6 +877,7 @@ func (m Model) View() string {
"t: edit tags",
"c: random theme",
"C: reset theme",
+ "space: refresh tasks",
"/, ?: search",
"n/N: next/prev search match",
"esc: close help/search",