ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppState

type AppState int
const (
	StateWelcome AppState = iota
	StateTyping
	StateSummary
	StateFileSelect
)

type Model

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

Model represents the application state

func NewModel

func NewModel() *Model

NewModel creates a new application model

func (*Model) Cleanup

func (m *Model) Cleanup()

Cleanup properly closes audio resources

func (*Model) GetFinalStats

func (m *Model) GetFinalStats() core.SessionStats

GetFinalStats returns the final session statistics

func (*Model) GetMPIStats

func (m *Model) GetMPIStats() map[string]interface{}

GetMPIStats returns muscle power indicator statistics

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model

func (*Model) LoadFile

func (m *Model) LoadFile(filepath string) error

LoadFile loads a code file for typing practice

func (*Model) SetAudioEnabled

func (m *Model) SetAudioEnabled(enabled bool)

SetAudioEnabled enables or disables audio feedback

func (*Model) StartPracticeDirectly

func (m *Model) StartPracticeDirectly()

StartPracticeDirectly skips welcome screen and starts practice immediately

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 TickMsg

type TickMsg time.Time

TickMsg is sent every second to update metrics

Jump to

Keyboard shortcuts

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