editmenu

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditTaskKeyMap

type EditTaskKeyMap struct {
	SaveField      key.Binding
	EscapeEditMode key.Binding
	SaveTask       key.Binding
	Help           key.Binding
	Quit           key.Binding
}

func (EditTaskKeyMap) FullHelp

func (e EditTaskKeyMap) FullHelp() [][]key.Binding

func (EditTaskKeyMap) ShortHelp

func (e EditTaskKeyMap) ShortHelp() []key.Binding

type ErrorMsg

type ErrorMsg struct {
	ErrorStr string
}

type EscapeEditMsg

type EscapeEditMsg struct{}

type Form

type Form struct {
	Title textinput.Model
	Desc  textinput.Model
	Date  datepicker.Model
	Done  bool
	// contains filtered or unexported fields
}

Form is a Bubble Tea sub-model that encapsulates the editable task fields.

func NewForm

func NewForm(
	title, desc string,
	dueDate time.Time,
	done bool,
	keymap *EditTaskKeyMap,
	styles Styles,
) Form

func (Form) Update

func (f Form) Update(msg tea.Msg) (Form, tea.Cmd)

func (Form) View

func (f Form) View() string

type Model

type Model struct {
	// Identity / basic metadata
	Title  string
	TaskID uuid.UUID
	IsNew  bool
	// contains filtered or unexported fields
}

Model for the edit menu.

func New

func New(task task.Task) Model

New constructs a new edit menu model with default styles.

func NewWithSize

func NewWithSize(
	width, height int,
	task task.Task,
) Model

func NewWithSizeAndStyles

func NewWithSizeAndStyles(
	width, height int,
	task task.Task,
	menuStyles Styles,
	formStyles Styles,
) Model

NewWithSizeAndStyles is the core constructor used by all others. It allows callers (like the top-level app model) to inject styling for both the edit menu container and the inner form.

func NewWithStyles

func NewWithStyles(task task.Task, menuStyles Styles, formStyles Styles) Model

NewWithStyles constructs a new edit menu model with explicit styles for the outer edit menu and the inner form.

func (Model) Height

func (m Model) Height() int

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) SetShowHelp

func (m Model) SetShowHelp(v bool) Model

func (Model) SetShowTitle

func (m Model) SetShowTitle(v bool) Model

func (Model) SetSize

func (m Model) SetSize(width int, height int) Model

func (Model) ShowHelp

func (m Model) ShowHelp() bool

ShowHelp returns whether or not the help is set to be rendered.

func (Model) ShowTitle

func (m Model) ShowTitle() bool

func (Model) Update

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

func (Model) View

func (m Model) View() string

func (Model) Width

func (m Model) Width() int

type SaveTaskMsg

type SaveTaskMsg struct {
	TaskID uuid.UUID
	Title  string
	Desc   string
	Date   time.Time
	Done   bool
	IsNew  bool
}

type Styles

type Styles struct {
	TitleBar lipgloss.Style
	Title    lipgloss.Style

	HelpStyle lipgloss.Style

	Focused lipgloss.Style
	Blurred lipgloss.Style
	Normal  lipgloss.Style

	StatusMessage lipgloss.Style
}

func DefaultStyles

func DefaultStyles() (s Styles)

Jump to

Keyboard shortcuts

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