Add ticket time tracking with reports and entry management.
Support start/stop timer, manual durations, grouped reports, and per-ticket edit/delete of time entries with undo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+39
-19
@@ -4,24 +4,28 @@ import "github.com/charmbracelet/bubbles/key"
|
||||
|
||||
// KeyMap defines vim-style bindings for the TUI.
|
||||
type KeyMap struct {
|
||||
Up key.Binding
|
||||
Down key.Binding
|
||||
New key.Binding
|
||||
Search key.Binding
|
||||
Project key.Binding
|
||||
Board key.Binding
|
||||
Status key.Binding
|
||||
Edit key.Binding
|
||||
EditInEditor key.Binding // ctrl+e — open $EDITOR while creating
|
||||
Delete key.Binding // x — confirm first
|
||||
DeleteForce key.Binding // X — immediate
|
||||
ConfirmYes key.Binding
|
||||
Toggle key.Binding // space — toggle multi-select
|
||||
Undo key.Binding
|
||||
Redo key.Binding
|
||||
Quit key.Binding
|
||||
Enter key.Binding
|
||||
Escape key.Binding
|
||||
Up key.Binding
|
||||
Down key.Binding
|
||||
New key.Binding
|
||||
Search key.Binding
|
||||
Project key.Binding
|
||||
Board key.Binding
|
||||
Status key.Binding
|
||||
Edit key.Binding
|
||||
EditInEditor key.Binding // ctrl+e — open $EDITOR while creating
|
||||
Delete key.Binding // x — confirm first
|
||||
DeleteForce key.Binding // X — immediate
|
||||
ConfirmYes key.Binding
|
||||
Toggle key.Binding // space — toggle multi-select
|
||||
Timer key.Binding // t — start/stop timer
|
||||
TimeManual key.Binding // T — manual duration
|
||||
TimeEntries key.Binding // m — manage time entries
|
||||
Report key.Binding // r — time report
|
||||
Undo key.Binding
|
||||
Redo key.Binding
|
||||
Quit key.Binding
|
||||
Enter key.Binding
|
||||
Escape key.Binding
|
||||
}
|
||||
|
||||
// DefaultKeyMap returns the default key bindings.
|
||||
@@ -79,6 +83,22 @@ func DefaultKeyMap() KeyMap {
|
||||
key.WithKeys(" "),
|
||||
key.WithHelp("space", "toggle"),
|
||||
),
|
||||
Timer: key.NewBinding(
|
||||
key.WithKeys("t"),
|
||||
key.WithHelp("t", "timer"),
|
||||
),
|
||||
TimeManual: key.NewBinding(
|
||||
key.WithKeys("T"),
|
||||
key.WithHelp("T", "log time"),
|
||||
),
|
||||
TimeEntries: key.NewBinding(
|
||||
key.WithKeys("m"),
|
||||
key.WithHelp("m", "time entries"),
|
||||
),
|
||||
Report: key.NewBinding(
|
||||
key.WithKeys("r"),
|
||||
key.WithHelp("r", "report"),
|
||||
),
|
||||
Undo: key.NewBinding(
|
||||
key.WithKeys("u", "ctrl+z"),
|
||||
key.WithHelp("u", "undo"),
|
||||
@@ -104,7 +124,7 @@ func DefaultKeyMap() KeyMap {
|
||||
|
||||
// ShortHelp implements help.KeyMap.
|
||||
func (k KeyMap) ShortHelp() []key.Binding {
|
||||
return []key.Binding{k.Up, k.New, k.Search, k.Project, k.Board, k.Status, k.Edit, k.Delete, k.DeleteForce, k.Undo, k.Redo, k.Quit}
|
||||
return []key.Binding{k.Up, k.New, k.Search, k.Project, k.Board, k.Status, k.Edit, k.Timer, k.TimeManual, k.TimeEntries, k.Report, k.Delete, k.DeleteForce, k.Undo, k.Redo, k.Quit}
|
||||
}
|
||||
|
||||
// FullHelp implements help.KeyMap.
|
||||
|
||||
Reference in New Issue
Block a user