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:
Skruecken
2026-10-19 11:05:10 +02:00
co-authored by Cursor
parent 41feba11de
commit bfc1cbd4d9
23 changed files with 2149 additions and 94 deletions
+14 -11
View File
@@ -21,12 +21,13 @@ type Executor interface {
// History is an undo/redo stack for Command values, optionally persisted to disk.
type History struct {
mu sync.Mutex
undoS []Command
redoS []Command
path string
store ticket.Store
max int
mu sync.Mutex
undoS []Command
redoS []Command
path string
store ticket.Store
timeStore ticket.TimeStore
max int
}
// NewHistory creates an empty in-memory command history (cap MaxHistory).
@@ -36,13 +37,15 @@ func NewHistory() *History {
// OpenHistory loads a persisted history from path (DataDir/history.json) or
// starts empty if the file is missing. Subsequent Do/Undo/Redo write back.
func OpenHistory(path string, store ticket.Store) (*History, error) {
// timeStore may be nil if time-entry commands are unused.
func OpenHistory(path string, store ticket.Store, timeStore ticket.TimeStore) (*History, error) {
h := &History{
path: path,
store: store,
max: MaxHistory,
path: path,
store: store,
timeStore: timeStore,
max: MaxHistory,
}
undo, redo, err := loadHistoryFile(path, store)
undo, redo, err := loadHistoryFile(path, store, timeStore)
if err != nil {
return nil, err
}