app

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtrlCExitDelayMs = 1000
)

Variables

This section is empty.

Functions

func App

func App(state *State, window *dom.Window) *dom.Node

func BindInput

func BindInput(props InputProps) *dom.Node

func ConfirmDialog

func ConfirmDialog(props ConfirmDialogProps) *dom.Node

ConfirmDialog creates a confirmation dialog with action and cancel buttons

Types

type ConfirmDialogProps

type ConfirmDialogProps struct {
	SelectedButton  int
	PromptText      string // e.g., "Delete todo?"
	DeleteText      string // e.g., "[Delete]" or "[OK]"
	CancelText      string // e.g., "[Cancel]"
	OnDelete        func()
	OnCancel        func()
	OnNavigateRight func()
	OnNavigateLeft  func()
}

ConfirmDialogProps contains the properties for the confirmation dialog

type InputProps

type InputProps struct {
	Placeholder string
	State       *models.InputState
	// contains filtered or unexported fields
}

type State

type State struct {
	Entries []*models.EntryView

	Input                models.InputState
	SelectedEntryIndex   int
	SelectedEntryEditing bool
	SelectedInputState   models.InputState

	SelectedShowDeleteConfirm   bool
	SelectedDeleteConfirmButton int

	EnteredEntryIndex int

	Quit func()

	Refresh func()

	OnAdd    func(string)
	OnUpdate func(id int64, text string)
	OnDelete func(id int64)

	OnAddNote func(id int64, text string)

	LastCtrlC time.Time
}

Jump to

Keyboard shortcuts

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