app

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys = KeyMap{
	Quit: key.NewBinding(
		key.WithKeys("q", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
	Tab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("Tab", "toggle sidebar"),
	),
	Next: key.NewBinding(
		key.WithKeys("n"),
		key.WithHelp("n", "next lesson"),
	),
	Prev: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "previous lesson"),
	),
	Advance: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("Enter", "advance phase"),
	),
	AdvancePhase: key.NewBinding(
		key.WithKeys("right"),
		key.WithHelp("→", "next phase"),
	),
	Back: key.NewBinding(
		key.WithKeys("backspace", "left"),
		key.WithHelp("←/Bksp", "previous phase"),
	),
	Help: key.NewBinding(
		key.WithKeys("?"),
		key.WithHelp("?", "help"),
	),
	Up: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "scroll up"),
	),
	Down: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "scroll down"),
	),
	Select: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("Enter", "select"),
	),
	Space: key.NewBinding(
		key.WithKeys(" "),
		key.WithHelp("Space", "interact"),
	),
	Reset: key.NewBinding(
		key.WithKeys("r"),
		key.WithHelp("r", "reset"),
	),
}

Functions

This section is empty.

Types

type AppModel

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

AppModel is the root Bubbletea model.

func NewAppModel

func NewAppModel(version string) AppModel

func (AppModel) Init

func (m AppModel) Init() tea.Cmd

func (AppModel) Update

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

func (AppModel) View

func (m AppModel) View() string

type KeyMap

type KeyMap struct {
	Quit         key.Binding
	Tab          key.Binding
	Next         key.Binding
	Prev         key.Binding
	Advance      key.Binding
	AdvancePhase key.Binding
	Back         key.Binding
	Help         key.Binding
	Up           key.Binding
	Down         key.Binding
	Select       key.Binding
	Space        key.Binding
	Reset        key.Binding
}

KeyMap defines all keybindings for the application.

type LessonChangeMsg

type LessonChangeMsg struct {
	LessonIdx int
}

LessonChangeMsg is sent when the user navigates to a different lesson.

type LessonCompleteMsg

type LessonCompleteMsg struct {
	LessonID int
}

LessonCompleteMsg signals a lesson has been fully completed.

type PhaseAdvanceMsg

type PhaseAdvanceMsg struct{}

PhaseAdvanceMsg is sent when a lesson phase completes.

type PhaseBackMsg

type PhaseBackMsg struct{}

PhaseBackMsg is sent when user goes back a phase.

type ShowHelpMsg

type ShowHelpMsg struct{}

ShowHelpMsg toggles the help overlay.

type ToggleSidebarMsg

type ToggleSidebarMsg struct{}

ToggleSidebarMsg is sent when user presses Tab.

type WindowSizeMsg

type WindowSizeMsg = tea.WindowSizeMsg

WindowSizeMsg wraps tea.WindowSizeMsg for convenience.

Jump to

Keyboard shortcuts

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