Add time undo and fill

This commit is contained in:
Martin Pander
2026-02-02 11:12:09 +01:00
parent fc8e9481c3
commit 9940316ace
5 changed files with 30 additions and 0 deletions

View File

@ -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())
}
}