Allow moving tickets between projects with P.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Skruecken
2026-10-19 14:19:10 +02:00
co-authored by Cursor
parent c5920ffd54
commit 7666715f6c
13 changed files with 369 additions and 6 deletions
+9
View File
@@ -38,6 +38,7 @@ const (
typeAddTime = "add_time"
typeRemoveTime = "remove_time"
typeUpdateTime = "update_time"
typeMove = "move"
)
// HistoryPath returns DataDir/history.json.
@@ -73,6 +74,9 @@ func encodeCmd(cmd Command) (persistedCmd, error) {
case *UpdateTimeEntry:
b, a := c.Before, c.After
return persistedCmd{Type: typeUpdateTime, TimeBefore: &b, TimeAfter: &a}, nil
case *MoveTicket:
b, a := c.Before, c.After
return persistedCmd{Type: typeMove, Before: &b, After: &a}, nil
default:
return persistedCmd{}, fmt.Errorf("unsupported command type %T", cmd)
}
@@ -119,6 +123,11 @@ func decodeCmd(rec persistedCmd, store ticket.Store, timeStore ticket.TimeStore)
return nil, fmt.Errorf("update_time: time store not configured")
}
return &UpdateTimeEntry{Store: timeStore, Before: *rec.TimeBefore, After: *rec.TimeAfter}, nil
case typeMove:
if rec.Before == nil || rec.After == nil {
return nil, fmt.Errorf("move record missing before/after")
}
return &MoveTicket{Store: store, TimeStore: timeStore, Before: *rec.Before, After: *rec.After}, nil
default:
return nil, fmt.Errorf("unknown command type %q", rec.Type)
}