tui

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package tui provides the terminal user interface for bored using the Bubble Tea framework. It implements views for configuration, board display, work item creation, and detail editing.

Index

Constants

View Source
const NotificationCheckInterval = 30 * time.Second

NotificationCheckInterval is how often to check for work item changes.

Variables

This section is empty.

Functions

func ClearCredentials

func ClearCredentials() error

ClearCredentials removes the stored credentials from the keychain

func ConfigFileExists

func ConfigFileExists() bool

ConfigFileExists checks if the config file exists

func GetConfigFilePath

func GetConfigFilePath() string

GetConfigFilePath returns the config file path for display purposes

func HasStoredCredentials

func HasStoredCredentials() bool

HasStoredCredentials checks if credentials are stored in the keychain

func LoadCredentials

func LoadCredentials() (org, project, team, areaPath, pat, username string, err error)

LoadCredentials loads the Azure DevOps credentials from the system keychain

func SaveConfigFile

func SaveConfigFile(config AppConfig) error

SaveConfigFile saves the application configuration to the config file

func SaveCredentials

func SaveCredentials(org, project, team, areaPath, pat, username string) error

SaveCredentials saves the Azure DevOps credentials to the system keychain

Types

type AppConfig

type AppConfig struct {
	// General settings
	DefaultShowAll      bool `toml:"default_show_all"`     // Default value for "show all" toggle on board
	EnableNotifications bool `toml:"enable_notifications"` // Enable sound notifications for work item changes

	// Display settings
	MaxWorkItems int `toml:"max_work_items"` // Maximum work items to fetch (default 50)
}

AppConfig represents the application configuration stored in a file

func DefaultConfig

func DefaultConfig() AppConfig

DefaultConfig returns a new AppConfig with default values

func LoadConfigFile

func LoadConfigFile() (AppConfig, error)

LoadConfigFile loads the application configuration from the config file

type Model

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

Model is the main Bubble Tea model containing all application state.

func NewModel

func NewModel() Model

NewModel creates and initializes a new Model with default values. It loads credentials from the keychain and app config from the config file.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model and returns the initial command to run.

func (Model) Update

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

Update implements tea.Model and handles all incoming messages.

func (Model) View

func (m Model) View() string

View implements tea.Model and renders the current view as a string.

type View

type View int

View represents the current screen being displayed in the TUI.

const (
	ViewConfig     View = iota // Configuration/login screen
	ViewBoard                  // Main board listing work items
	ViewCreate                 // Create new work item screen
	ViewDetail                 // Work item detail/edit screen
	ViewConfigFile             // Application settings screen
)

View constants for the different screens in the application.

Jump to

Keyboard shortcuts

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