Documentation
¶
Index ¶
- func GetOperationDescription(op *Operation) string
- type History
- func (h *History) CanRedo() bool
- func (h *History) CanUndo() bool
- func (h *History) Clear()
- func (h *History) GetUndoStack() []*Operation
- func (h *History) Len() (int, int)
- func (h *History) Record(op *Operation)
- func (h *History) Redo() *Operation
- func (h *History) RedoSize() int
- func (h *History) Undo() *Operation
- func (h *History) UndoSize() int
- type Operation
- type OperationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperationDescription ¶
GetOperationDescription returns a human-readable description of an operation
Types ¶
type History ¶
type History struct {
// contains filtered or unexported fields
}
History manages undo/redo stacks
func (*History) GetUndoStack ¶
GetUndoStack returns a copy of the undo stack for display (newest first)
type Operation ¶
type Operation struct {
Type OperationType `json:"type"`
Description string `json:"description"`
Timestamp time.Time `json:"timestamp"`
// Affected task IDs
TaskIDs []string `json:"task_ids"`
// Snapshots of tasks before and after the operation
// Before: original state before operation
// After: state after operation (for redo)
Before []core.Task `json:"before"`
After []core.Task `json:"after"`
}
Operation represents a single undoable operation
func CreateOperation ¶
func CreateOperation(opType OperationType, description string, taskIDs []string, before, after []core.Task) *Operation
CreateOperation is a helper to create a new operation record
type OperationType ¶
type OperationType int
OperationType defines the type of operation recorded in history
const ( OpCreate OperationType = iota OpUpdate OpDelete OpBulkDelete OpToggleStatus OpBulkToggleStatus OpChangePriority OpChangeDeadline OpChangeCollapsed OpBulkOperation )
func (OperationType) String ¶
func (op OperationType) String() string
Click to show internal directories.
Click to hide internal directories.