tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderProgressDots

func RenderProgressDots(current, total int) string

RenderProgressDots renders a dot-based progress indicator Example: "● ● ● ○ ○ ○ ○ ○" for question 3 of 8

Types

type CalendarDateChangedMsg

type CalendarDateChangedMsg struct {
	Date string
}

CalendarDateChangedMsg is sent when the cursor moves to a new date

type CalendarDateSelectedMsg

type CalendarDateSelectedMsg struct {
	Date string
}

CalendarDateSelectedMsg is sent when a date is selected (Enter pressed)

type CalendarModel

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

CalendarModel represents a single-month calendar view

func NewCalendar

func NewCalendar() CalendarModel

NewCalendar creates a new calendar model for the current month

func (*CalendarModel) GoToDate

func (m *CalendarModel) GoToDate(date string)

GoToDate navigates to a specific date

func (CalendarModel) Init

func (m CalendarModel) Init() tea.Cmd

Init implements tea.Model

func (CalendarModel) IsFocused

func (m CalendarModel) IsFocused() bool

IsFocused returns whether the calendar has focus

func (CalendarModel) Month

func (m CalendarModel) Month() time.Month

Month returns the currently displayed month

func (CalendarModel) SelectedDate

func (m CalendarModel) SelectedDate() string

SelectedDate returns the currently selected date as "YYYY-MM-DD"

func (*CalendarModel) SetDatesWithEntries

func (m *CalendarModel) SetDatesWithEntries(dates []string)

SetDatesWithEntries updates the set of dates that have entries

func (*CalendarModel) SetFocused

func (m *CalendarModel) SetFocused(focused bool)

SetFocused sets whether the calendar has focus

func (CalendarModel) Update

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

Update implements tea.Model

func (CalendarModel) View

func (m CalendarModel) View() string

View implements tea.Model

func (CalendarModel) Year

func (m CalendarModel) Year() int

Year returns the currently displayed year

type EntryCursorChangedMsg

type EntryCursorChangedMsg struct {
	Entry EntryPreview
	Index int
}

EntryCursorChangedMsg is sent when the cursor moves

type EntryListModel

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

EntryListModel represents the entry preview list

func NewEntryList

func NewEntryList() EntryListModel

NewEntryList creates a new entry list model

func (EntryListModel) Entries

func (m EntryListModel) Entries() []EntryPreview

Entries returns all entries

func (EntryListModel) Init

func (m EntryListModel) Init() tea.Cmd

Init implements tea.Model

func (EntryListModel) IsFocused

func (m EntryListModel) IsFocused() bool

IsFocused returns whether the list has focus

func (*EntryListModel) SelectByDate

func (m *EntryListModel) SelectByDate(date string)

SelectByDate selects the first entry matching the given date

func (EntryListModel) SelectedEntry

func (m EntryListModel) SelectedEntry() *EntryPreview

SelectedEntry returns the currently selected entry (or nil if empty)

func (*EntryListModel) SetEmptyMessage

func (m *EntryListModel) SetEmptyMessage(msg string)

SetEmptyMessage sets the message shown when there are no entries

func (*EntryListModel) SetEntries

func (m *EntryListModel) SetEntries(entries []EntryPreview)

SetEntries updates the list of entries

func (*EntryListModel) SetFocused

func (m *EntryListModel) SetFocused(focused bool)

SetFocused sets whether the list has focus

func (EntryListModel) Update

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

Update implements tea.Model

func (EntryListModel) View

func (m EntryListModel) View() string

View implements tea.Model

type EntryPreview

type EntryPreview struct {
	Date      string
	EntryType storage.EntryType
	Energy    int
	Entry     storage.RitualEntry
}

EntryPreview represents a single entry in the list

type EntrySelectedMsg

type EntrySelectedMsg struct {
	Entry EntryPreview
	Index int
}

EntrySelectedMsg is sent when an entry is selected (Enter pressed)

type EntryViewCloseMsg

type EntryViewCloseMsg struct{}

EntryViewCloseMsg is sent when the user wants to close the view

type EntryViewModel

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

EntryViewModel displays a full entry in detail

func NewEntryView

func NewEntryView() EntryViewModel

NewEntryView creates a new entry view model

func (EntryViewModel) CurrentEntry

func (m EntryViewModel) CurrentEntry() *EntryPreview

CurrentEntry returns the currently displayed entry

func (EntryViewModel) Init

func (m EntryViewModel) Init() tea.Cmd

Init implements tea.Model

func (*EntryViewModel) SetCurrentIndex

func (m *EntryViewModel) SetCurrentIndex(index int)

SetCurrentIndex sets the currently displayed entry

func (*EntryViewModel) SetEntries

func (m *EntryViewModel) SetEntries(entries []EntryPreview)

SetEntries sets the list of entries for navigation

func (EntryViewModel) Update

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

Update implements tea.Model

func (EntryViewModel) View

func (m EntryViewModel) View() string

View implements tea.Model

type EntryViewQuitMsg

type EntryViewQuitMsg struct{}

EntryViewQuitMsg is sent when the user wants to quit entirely

type FocusedPanel

type FocusedPanel int

FocusedPanel represents which panel has focus

const (
	FocusCalendar FocusedPanel = iota
	FocusList
)

type LogModel

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

LogModel is the main log view orchestrator

func NewLog

func NewLog(store *storage.Store) LogModel

NewLog creates a new log model

func (LogModel) Init

func (m LogModel) Init() tea.Cmd

Init implements tea.Model

func (LogModel) Update

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

Update implements tea.Model

func (LogModel) View

func (m LogModel) View() string

View implements tea.Model

type LogViewMode

type LogViewMode int

LogViewMode represents the current view mode

const (
	LogViewModeSplit LogViewMode = iota
	LogViewModeFullscreen
)

type Mode

type Mode int

Mode represents startup or shutdown ritual.

const (
	ModeStartup Mode = iota
	ModeShutdown
)

Ritual modes.

func (Mode) String

func (m Mode) String() string

type Model

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

Model is the main Bubble Tea model

func New

func New(mode Mode, store *storage.Store, quick bool) Model

New creates a new Model for the given mode

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

type State

type State int

State represents the current app state.

const (
	StateAnswering State = iota
	StateSummary
)

App states.

type SummaryCloseMsg

type SummaryCloseMsg struct{} // Return to previous view

Messages

type SummaryModel

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

SummaryModel displays a weekly summary

func NewSummary

func NewSummary(
	s summary.WeeklySummary,
	reflection *storage.WeeklyReflection,
	streakInfo streak.StreakInfo,
	summaryStore *storage.WeeklySummaryStore,
	fromLogBrowser bool,
) SummaryModel

NewSummary creates a new summary view model

func (SummaryModel) Init

func (m SummaryModel) Init() tea.Cmd

Init implements tea.Model

func (SummaryModel) Update

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

Update implements tea.Model

func (SummaryModel) View

func (m SummaryModel) View() string

View implements tea.Model

type SummaryQuitMsg

type SummaryQuitMsg struct{} // Quit entirely

type SummarySavedMsg

type SummarySavedMsg struct{} // Reflection was saved

Jump to

Keyboard shortcuts

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