models

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnimSparkle = iota
	AnimMatrix
	AnimWipeRight
	AnimWipeLeft
	AnimRainbow
	AnimWave
	AnimBinary
	AnimDissolve
	AnimFlip
	AnimPulse
	AnimTypewriter
	AnimParticle
	AnimRedact
	AnimChaos
	AnimConverge
	AnimBounce
	AnimSpin
	AnimZipper
	AnimEraser
	AnimGlitch
	AnimMoons
	AnimBraille
	AnimHex
	AnimReverse
	AnimCaseFlip
	AnimWide
	AnimTraffic
	AnimCenterStrike
	AnimLoading
	AnimSlider

	AnimCount = 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppData

type AppData struct {
	ThemeIndex   int
	SortMode     SortMode
	Tasks        []Task
	DeletedTasks []Task
}

func LoadData

func LoadData() AppData

type AppState

type AppState int
const (
	StateBrowse AppState = iota
	StateEditing
	StateCreating
	StateEditingDescription
	StateCreatingDescription
	StateBinView
	StateTutorial
	StateHelp
)

type Model

type Model struct {
	Tasks         []Task
	State         AppState
	PreviousState AppState // Previous state for help overlay
	SortMode      SortMode
	ThemeIndex    int
	LastAnim      int

	Cursor    int
	Width     int
	Height    int
	TextInput textinput.Model

	// Temporary storage for task creation
	TempTitle string

	// Undo functionality
	DeletedTasks []Task // Store recently deleted tasks for undo

	// Tutorial functionality
	TutorialTasks []Task // Store tutorial tasks separately
}

func (*Model) ApplySort

func (m *Model) ApplySort()

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Save

func (m *Model) Save()

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) ValidateCursor

func (m *Model) ValidateCursor()

ValidateCursor ensures the cursor is within valid bounds

func (*Model) View

func (m *Model) View() string

type SortMode

type SortMode int
const (
	SortOff SortMode = iota
	SortTodoFirst
	SortDoneFirst
)

type Task

type Task struct {
	ID          int64
	Title       string
	Description string
	Done        bool

	// UI States
	Expanded bool

	// Animation States
	IsAnimatingCheck  bool
	IsDeleting        bool
	IsRestoring       bool // Animation for restoring from bin
	IsDeletingFromBin bool // Animation for permanent deletion from bin
	AnimType          int
	AnimStart         time.Time
}

type TickMsg

type TickMsg struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL