tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTaskCmd

func AddTaskCmd(filePath, description string) tea.Cmd

AddTaskCmd appends a plain task with no task file.

func AddTaskWithMetaCmd

func AddTaskWithMetaCmd(
	filePath, summary, description string,
	start, due *time.Time,
	priority int,
	status string,
	rrule string,
	push bool,
	cfg config.Config,
) tea.Cmd

AddTaskWithMetaCmd creates a task file, writes [[uid|title]] into the target file, and optionally pushes to CalDAV.

func EditTaskCmd

func EditTaskCmd(
	t *task.Task,
	newSummary, body string,
	start, due *time.Time,
	priority int,
	status string,
	rrule string,
	push bool,
	cfg config.Config,
) tea.Cmd

EditTaskCmd saves edits to a task.

Plain task, no metadata → rewrite description in-place. Plain task, metadata set → upgrade to linked task (creates task file + wikilink). Linked task → update task file frontmatter, title, body; push to CalDAV if UID set.

func LinkExistingTaskCmd

func LinkExistingTaskCmd(
	t *task.Task,
	summary, description string,
	start, due *time.Time,
	priority int,
	status string,
	rrule string,
	push bool,
	cfg config.Config,
) tea.Cmd

LinkExistingTaskCmd converts a plain task into a linked task: creates a task file, rewrites the source line to [[uid|title]], optionally pushes.

func LoadCacheCmd added in v0.2.0

func LoadCacheCmd(cachePath string) tea.Cmd

LoadCacheCmd reads the task cache from disk and returns it instantly.

func LoadTasksCmd

func LoadTasksCmd(vaultPath, taskFilesFolder, cachePath string) tea.Cmd

LoadTasksCmd scans the vault, saves the result to cache, and returns a refresh message.

func OpenInEditorCmd added in v0.2.0

func OpenInEditorCmd(filePath string, line int) tea.Cmd

OpenInEditorCmd suspends the TUI and opens filePath in $EDITOR at the given line. vim/nvim/vi get a +N flag to jump directly to the line.

func PullCalDAVCmd

func PullCalDAVCmd(cfg config.Config) tea.Cmd

PullCalDAVCmd fetches all VTODOs from the server and syncs local task files.

func PushCalDAVCmd

func PushCalDAVCmd(cfg config.CalDAV, t *task.Task) tea.Cmd

PushCalDAVCmd pushes an existing task to CalDAV via the push form.

func ToggleTaskCmd

func ToggleTaskCmd(t *task.Task, caldavCfg config.CalDAV) tea.Cmd

ToggleTaskCmd writes the toggled checkbox back to the source file. For linked tasks, also updates status in the task file and pushes to CalDAV.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func NewApp

func NewApp(cfg config.Config) App

func (App) Init

func (a App) Init() tea.Cmd

func (App) Update

func (a App) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (App) View

func (a App) View() string

type CalDAVPushedMsg

type CalDAVPushedMsg struct {
	Task *task.Task
	UID  string
	Err  error
}

CalDAVPushedMsg is sent after pushing a task to CalDAV.

type EditorClosedMsg added in v0.2.0

type EditorClosedMsg struct{ Err error }

EditorClosedMsg is sent when the external editor process exits.

type ErrorMsg

type ErrorMsg struct {
	Err error
}

ErrorMsg represents a generic error.

type PullCalDAVMsg

type PullCalDAVMsg struct {
	Updated int    // task files updated
	Created int    // new task files created from remote
	Notify  string // non-empty if folder conflict occurred
	Err     error
}

PullCalDAVMsg is sent after pulling tasks from CalDAV.

type TaskAddedMsg

type TaskAddedMsg struct {
	Description string
	Err         error
	AutoPushErr error  // non-nil if auto-push failed (task still saved)
	AutoPushUID string // set if auto-push succeeded
}

TaskAddedMsg is sent after a new task is appended to a file.

type TaskEditedMsg

type TaskEditedMsg struct {
	Task       *task.Task
	NewSummary string
	Reload     bool // true when a plain task was upgraded to a linked task
	Err        error
	CalDAVErr  error // non-nil if save succeeded but CalDAV push failed
}

TaskEditedMsg is sent after an edit is saved to disk.

type TaskToggledMsg

type TaskToggledMsg struct {
	Task      *task.Task
	Err       error
	CalDAVErr error // non-nil if toggle succeeded but CalDAV push failed
}

TaskToggledMsg is sent after a task checkbox is written back to disk.

type TasksLoadedMsg

type TasksLoadedMsg struct {
	Tasks []task.Task
	Err   error
}

TasksLoadedMsg is sent when the task cache is loaded instantly on startup.

type TasksRefreshedMsg added in v0.2.0

type TasksRefreshedMsg struct {
	Tasks []task.Task
	Err   error
}

TasksRefreshedMsg is sent when the background vault scan completes.

Directories

Path Synopsis
components

Jump to

Keyboard shortcuts

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