From cceb46025cbdc3ee1b86e4d316c208339b80bc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Sun, 22 Jun 2025 21:38:39 +0300 Subject: Speed up row blink and block input during blink --- internal/ui/table.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'internal/ui') 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 { -- cgit v1.2.3