From 9940316ace657ec6512aae6d3822b0a48ca0c053 Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Mon, 2 Feb 2026 11:12:09 +0100 Subject: [PATCH] Add time undo and fill --- common/keymap.go | 6 ++++++ pages/timePage.go | 10 ++++++++++ test/taskchampion.sqlite3-shm | Bin 32768 -> 0 bytes test/taskchampion.sqlite3-wal | 0 timewarrior/timewarrior.go | 14 ++++++++++++++ 5 files changed, 30 insertions(+) delete mode 100644 test/taskchampion.sqlite3-shm delete mode 100644 test/taskchampion.sqlite3-wal diff --git a/common/keymap.go b/common/keymap.go index 806e82f..e6df97a 100644 --- a/common/keymap.go +++ b/common/keymap.go @@ -28,6 +28,7 @@ type Keymap struct { Insert key.Binding Tag key.Binding Undo key.Binding + Fill key.Binding StartStop key.Binding } @@ -145,6 +146,11 @@ func NewKeymap() *Keymap { key.WithHelp("undo", "Undo"), ), + Fill: key.NewBinding( + key.WithKeys("f"), + key.WithHelp("fill", "Fill gaps"), + ), + StartStop: key.NewBinding( key.WithKeys("s"), key.WithHelp("start/stop", "Start/Stop"), diff --git a/pages/timePage.go b/pages/timePage.go index b04e37f..44c8541 100644 --- a/pages/timePage.go +++ b/pages/timePage.go @@ -83,6 +83,16 @@ func (p *TimePage) Update(msg tea.Msg) (tea.Model, tea.Cmd) { editor := NewTimeEditorPage(p.common, interval) p.common.PushPage(p) return editor, editor.Init() + case key.Matches(msg, p.common.Keymap.Fill): + row := p.intervals.SelectedRow() + if row != nil { + interval := (*timewarrior.Interval)(row) + p.common.TimeW.FillInterval(interval.ID) + return p, tea.Batch(p.getIntervals(), doTick()) + } + case key.Matches(msg, p.common.Keymap.Undo): + p.common.TimeW.Undo() + return p, tea.Batch(p.getIntervals(), doTick()) } } diff --git a/test/taskchampion.sqlite3-shm b/test/taskchampion.sqlite3-shm deleted file mode 100644 index fe9ac2845eca6fe6da8a63cd096d9cf9e24ece10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIuAr62r3