ui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActiveTaskPlaceholder     = "{{task}}"
	ActiveTaskTimePlaceholder = "{{time}}"
)

Variables

View Source
var (
	ErrThemeFileHasInvalidSchema = errors.New("theme file's schema is incorrect")
	ErrThemeColorsAreInvalid     = errors.New("invalid colors provided")
)

Functions

func GenerateData added in v0.2.0

func GenerateData(db *sql.DB, numDays, numTasks uint8) error

func RenderReport

func RenderReport(db *sql.DB, style Style, writer io.Writer, plain bool, period string, agg bool, interactive bool) error

func RenderStats

func RenderStats(db *sql.DB, style Style, writer io.Writer, plain bool, period string, interactive bool) error

func RenderTaskLog

func RenderTaskLog(db *sql.DB, style Style, writer io.Writer, plain bool, period string, interactive bool) error

func RenderUI

func RenderUI(db *sql.DB, style Style) error

func ShowActiveTask

func ShowActiveTask(db *sql.DB, writer io.Writer, template string) error

Types

type Model added in v0.4.0

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

func InitialModel

func InitialModel(db *sql.DB, style Style) Model

func (Model) Init added in v0.4.0

func (m Model) Init() tea.Cmd

func (Model) Update added in v0.4.0

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

func (Model) View added in v0.4.0

func (m Model) View() string

type Style added in v0.5.0

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

func NewStyle added in v0.5.0

func NewStyle(theme Theme) Style

type Theme added in v0.5.0

type Theme struct {
	ActiveTask              string   `json:"activeTask,omitempty"`
	ActiveTaskBeginTime     string   `json:"activeTaskBeginTime,omitempty"`
	ActiveTasks             string   `json:"activeTasks,omitempty"`
	FormContext             string   `json:"formContext,omitempty"`
	FormFieldName           string   `json:"formFieldName,omitempty"`
	FormHelp                string   `json:"formHelp,omitempty"`
	HelpMsg                 string   `json:"helpMsg,omitempty"`
	HelpPrimary             string   `json:"helpPrimary,omitempty"`
	HelpSecondary           string   `json:"helpSecondary,omitempty"`
	InactiveTasks           string   `json:"inactiveTasks,omitempty"`
	InitialHelpMsg          string   `json:"initialHelpMsg,omitempty"`
	ListItemDesc            string   `json:"listItemDesc,omitempty"`
	ListItemTitle           string   `json:"listItemTitle,omitempty"`
	RecordsBorder           string   `json:"recordsBorder,omitempty"`
	RecordsDateRange        string   `json:"recordsDateRange,omitempty"`
	RecordsFooter           string   `json:"recordsFooter,omitempty"`
	RecordsHeader           string   `json:"recordsHeader,omitempty"`
	RecordsHelp             string   `json:"recordsHelp,omitempty"`
	TaskLogDetailsViewTitle string   `json:"taskLogDetails,omitempty"`
	TaskEntry               string   `json:"taskEntry,omitempty"`
	TaskLogEntry            string   `json:"taskLogEntry,omitempty"`
	TaskLogList             string   `json:"taskLogList,omitempty"`
	Tasks                   []string `json:"tasks,omitempty"`
	TitleForeground         string   `json:"titleForeground,omitempty"`
	ToolName                string   `json:"toolName,omitempty"`
	Tracking                string   `json:"tracking,omitempty"`
}

func DefaultTheme added in v0.5.0

func DefaultTheme() Theme

func LoadTheme added in v0.5.0

func LoadTheme(themeJSON []byte) (Theme, error)

Jump to

Keyboard shortcuts

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