diff options
| author | Paul Bütow <1224732+snonux@users.noreply.github.com> | 2025-06-22 21:38:39 +0300 |
|---|---|---|
| committer | Paul Bütow <1224732+snonux@users.noreply.github.com> | 2025-06-22 21:38:39 +0300 |
| commit | cceb46025cbdc3ee1b86e4d316c208339b80bc9e (patch) | |
| tree | 3ed702f6382b4457b3f5fa47b001fe3683a351bb | |
| parent | 9922fd134d9328b2fe57dfcfc861f51b96a552e7 (diff) | |
Speed up row blink and block input during blink
| -rw-r--r-- | internal/ui/table.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/internal/ui/table.go b/internal/ui/table.go index 9d97f0a..1ec7313 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -114,7 +114,9 @@ type editDoneMsg struct{ err error } type blinkMsg struct{} -const blinkInterval = 250 * time.Millisecond +// blinkInterval controls how quickly the row flashes when a task changes. +// A shorter interval results in a faster blink. +const blinkInterval = 150 * time.Millisecond const blinkCycles = 8 // editCmd returns a command that edits the task and sends an @@ -302,8 +304,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, blinkCmd() } return m, nil - case tea.KeyMsg: - 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 { |
