ui

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("205")).
				MarginBottom(1)

	TabActiveStyle = lipgloss.NewStyle().
					Bold(true).
					Underline(true).
					Foreground(lipgloss.Color("255"))

	TabInactiveStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("240"))

	GroupHeaderStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("39")).
						MarginTop(1)

	LabelStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("252"))

	PercentStyle = lipgloss.NewStyle().
					Width(8).
					Align(lipgloss.Right).
					Foreground(lipgloss.Color("170"))

	ResetTimeStyle = lipgloss.NewStyle().
					Width(26).
					Align(lipgloss.Left).
					Foreground(lipgloss.Color("241")).
					MarginLeft(2)

	HelpStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("241")).
				MarginTop(1)

	HelpKeyStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("39"))

	HelpSectionStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("252"))

	ActionMenuTitleStyle = lipgloss.NewStyle().
							Bold(true).
							Foreground(lipgloss.Color("39"))

	ActionMenuSelectedStyle = lipgloss.NewStyle().
							Bold(true).
							Foreground(lipgloss.Color("255"))

	ActionMenuItemStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("252"))

	ActionMenuHintStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("244"))

	ErrorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("196"))

	WarningStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("196"))

	NoticeStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("42"))

	UpdateHintStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("39"))

	InfoTitleStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("39"))

	InfoKeyStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("244"))

	InfoValueStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252"))

	InfoBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.NormalBorder()).
					BorderForeground(lipgloss.Color("240")).
					Padding(0, 1)

	SourceBadgeBracketStyle = lipgloss.NewStyle().
							Foreground(lipgloss.Color("240"))
	SourceCodexBadgeActiveStyle = lipgloss.NewStyle().
								Bold(true).
								Foreground(lipgloss.Color("205"))
	SourceOpenCodeBadgeActiveStyle = lipgloss.NewStyle().
									Bold(true).
									Foreground(lipgloss.Color("39"))
	SourceCodexBadgeMutedStyle = lipgloss.NewStyle().
								Foreground(lipgloss.Color("176"))
	SourceOpenCodeBadgeMutedStyle = lipgloss.NewStyle().
									Foreground(lipgloss.Color("31"))
	SourceBadgeSeparatorStyle = lipgloss.NewStyle().
								Foreground(lipgloss.Color("240"))

	SubscribedLabelActiveStyle = lipgloss.NewStyle().
								Bold(true).
								Underline(true).
								Foreground(lipgloss.Color("177"))
	SubscribedLabelMutedStyle = lipgloss.NewStyle().
								Foreground(lipgloss.Color("141"))
	SubscribedPercentPrefixStyle = lipgloss.NewStyle().
									Foreground(lipgloss.Color("177"))
	CompactExhaustedHeaderStyle = lipgloss.NewStyle().
								Bold(true).
								Foreground(lipgloss.Color("251"))
	BarEmptyStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("238"))
)

Functions

func ApplyToTargetsCmd

func ApplyToTargetsCmd(account *config.Account, targets []config.Source) tea.Cmd

func CancelAddAccountLoginCmd added in v0.3.0

func CancelAddAccountLoginCmd() tea.Cmd

func CopyToClipboardCmd added in v0.3.0

func CopyToClipboardCmd(text string) tea.Cmd

func DeleteAccountSourcesCmd

func DeleteAccountSourcesCmd(account *config.Account, sources []config.Source, activeKey string) tea.Cmd

func DismissUpdateVersionCmd added in v0.1.5

func DismissUpdateVersionCmd(version string) tea.Cmd

func FetchDataCmd

func FetchDataCmd(account *config.Account) tea.Cmd

func FinalizeAddAccountLoginCmd added in v0.3.0

func FinalizeAddAccountLoginCmd(account *config.Account) tea.Cmd

func OpenAddAccountLoginURLCmd added in v0.3.0

func OpenAddAccountLoginURLCmd(url string) tea.Cmd

func PollAddAccountLoginCmd added in v0.3.0

func PollAddAccountLoginCmd() tea.Cmd

func ReloadAccountsCmd

func ReloadAccountsCmd(activeKey string) tea.Cmd

func SaveUIStateCmd

func SaveUIStateCmd(compact bool) tea.Cmd

func SaveUIStateSnapshotCmd

func SaveUIStateSnapshotCmd(state config.UIState) tea.Cmd

func StartAddAccountLoginCmd added in v0.3.0

func StartAddAccountLoginCmd() tea.Cmd

Types

type AccountsMsg

type AccountsMsg struct {
	ActiveKey               string
	Accounts                []*config.Account
	Notice                  string
	SourcesByAccountID      map[string][]string
	ActiveSourcesByIdentity map[string][]string
}

type AddAccountLoginCopyResultMsg added in v0.3.0

type AddAccountLoginCopyResultMsg struct {
	Text string
	Err  error
}

type AddAccountLoginFinishedMsg added in v0.3.0

type AddAccountLoginFinishedMsg struct {
	Account *config.Account
	Err     error
}

type AddAccountLoginPendingMsg added in v0.3.0

type AddAccountLoginPendingMsg struct{}

type AddAccountLoginStartedMsg added in v0.3.0

type AddAccountLoginStartedMsg struct {
	AuthURL           string
	BrowserOpenFailed bool
}

type AnimationFrameMsg

type AnimationFrameMsg struct {
	Now time.Time
}

type DataMsg

type DataMsg struct {
	AccountKey      string
	Data            api.UsageData
	Account         *config.Account
	ReloadAccounts  bool
	ReloadActiveKey string
}

type ErrMsg

type ErrMsg struct {
	AccountKey string
	Err        error
}

type Model

type Model struct {
	Data                    api.UsageData
	Loading                 bool
	DeleteSourceSelect      bool
	DeleteSourceOptions     []config.Source
	DeleteSources           map[config.Source]bool
	DeleteSourceCursor      int
	DeleteConfirm           bool
	ApplyTargetSelect       bool
	ApplyTargets            map[config.Source]bool
	ApplyTargetCursor       int
	ApplyConfirm            bool
	HelpVisible             bool
	ActionMenuVisible       bool
	ActionMenuCursor        int
	AddAccountLoginVisible  bool
	AddAccountLoginURL      string
	AddAccountBrowserFailed bool
	AddAccountLoginStatus   string
	ShowInfo                bool
	Notice                  string

	Err                     error
	Width                   int
	Height                  int
	CompactMode             bool
	UsageData               map[string]api.UsageData
	PlanTypeByAccount       map[string]string
	LoadingMap              map[string]bool
	ErrorsMap               map[string]error
	ExhaustedSticky         map[string]bool
	Accounts                []*config.Account
	SourcesByAccountID      map[string][]string
	ActiveSourcesByIdentity map[string][]string
	ActiveAccountIx         int

	UpdatePromptVisible bool
	UpdatePromptVersion string
	UpdatePromptMethod  update.Method
	UpdatePromptCursor  int
	UpdateAvailableHint string
	// contains filtered or unexported fields
}

func InitialModel

func InitialModel(
	accounts []*config.Account,
	sourcesByAccountID map[string][]string,
	activeSourcesByIdentity map[string][]string,
	initialCompactMode bool,
) Model

func InitialModelWithStartupUpdate added in v0.1.5

func InitialModelWithStartupUpdate(
	accounts []*config.Account,
	sourcesByAccountID map[string][]string,
	activeSourcesByIdentity map[string][]string,
	uiState config.UIState,
	startupUpdate *StartupUpdatePrompt,
) Model

func InitialModelWithUIState

func InitialModelWithUIState(
	accounts []*config.Account,
	sourcesByAccountID map[string][]string,
	activeSourcesByIdentity map[string][]string,
	uiState config.UIState,
) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) PendingUpdate added in v0.1.5

func (m Model) PendingUpdate() (update.Method, bool)

func (Model) Update

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

func (Model) View

func (m Model) View() string

type NoticeMsg

type NoticeMsg struct {
	Text string
}

type NoticeTimeoutMsg

type NoticeTimeoutMsg struct {
	Seq int
}

type StartupUpdatePrompt added in v0.1.5

type StartupUpdatePrompt struct {
	Version string
	Method  update.Method
}

type UpdateAvailableMsg added in v0.1.5

type UpdateAvailableMsg struct {
	Version string
	Method  update.Method
}

Jump to

Keyboard shortcuts

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