tui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DialogBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(lipgloss.Color("#874BFD")).
					Padding(1, 0).
					BorderTop(true).
					BorderLeft(true).
					BorderRight(true).
					BorderBottom(true)

	HelpStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color("240"))
	SuccessStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).Bold(true)
	InfoStyle    = lipgloss.NewStyle().Foreground(lipgloss.Color("205")).Bold(true)
)
View Source
var DocStyle = lipgloss.NewStyle().Margin(1, 2)

Functions

This section is empty.

Types

type Choice

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

func NewChoice

func NewChoice() Choice

func (Choice) Init

func (m Choice) Init() tea.Cmd

func (Choice) Update

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

func (Choice) View

func (m Choice) View() string

type ChooseServiceMsg

type ChooseServiceMsg struct {
	Service string
}

A message to indicate that the user has chosen a service.

type ClearStatusMsg

type ClearStatusMsg struct{}

ClearStatusMsg is sent to clear the status message from the view.

type Composer

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

Composer model holds the state of the email composition UI.

func NewComposer

func NewComposer(from string) *Composer

NewComposer initializes a new composer model.

func (*Composer) Init

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

func (*Composer) Update

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

func (*Composer) View

func (m *Composer) View() string

View renders the UI.

type Credentials

type Credentials struct {
	Provider string
	Name     string
	Email    string
	Password string
}

A message to indicate that the user has entered their credentials.

type EmailResultMsg

type EmailResultMsg struct {
	Err error
}

EmailResultMsg is sent after an email sending attempt. If Err is not nil, the email failed to send.

type EmailView

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

func NewEmailView

func NewEmailView(email fetcher.Email, width, height int) *EmailView

func (*EmailView) Init

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

func (*EmailView) Update

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

func (*EmailView) View

func (m *EmailView) View() string

type EmailsAppendedMsg added in v0.4.0

type EmailsAppendedMsg struct {
	Emails []fetcher.Email
}

A message to indicate that new emails have been fetched and should be appended.

type EmailsFetchedMsg

type EmailsFetchedMsg struct {
	Emails []fetcher.Email
}

A message containing the fetched emails.

type FetchErr

type FetchErr error

A message to indicate that an error occurred while fetching emails.

type FetchMoreEmailsMsg added in v0.4.0

type FetchMoreEmailsMsg struct {
	Offset uint32
}

A message to fetch more emails with a given offset.

type FetchingMoreEmailsMsg added in v0.4.0

type FetchingMoreEmailsMsg struct{}

A message to indicate that the app is fetching more emails.

type GoToInboxMsg

type GoToInboxMsg struct{}

A message to navigate to the inbox view.

type GoToSendMsg

type GoToSendMsg struct{}

A message to navigate to the composer view.

type GoToSettingsMsg added in v0.2.0

type GoToSettingsMsg struct{}

A message to navigate to the settings view.

type Inbox

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

Inbox is now stateful to handle pagination.

func NewInbox

func NewInbox(emails []fetcher.Email) *Inbox

func (*Inbox) Init

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

func (*Inbox) Update

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

func (*Inbox) View

func (m *Inbox) View() string

type Login

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

Login holds the state for the login form.

func NewLogin

func NewLogin() *Login

NewLogin creates a new login model.

func (*Login) Init

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

Init initializes the login model.

func (*Login) Update

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

Update handles messages for the login model.

func (*Login) View

func (m *Login) View() string

View renders the login form.

type SendEmailMsg

type SendEmailMsg struct {
	To      string
	Subject string
	Body    string
}

A message to indicate that an email has been sent.

type Status

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

A simple model for showing a status message

func NewStatus

func NewStatus(msg string) Status

func (Status) Init

func (m Status) Init() tea.Cmd

func (Status) Update

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

func (Status) View

func (m Status) View() string

type ViewEmailMsg

type ViewEmailMsg struct {
	Index int
}

A message to view an email.

Jump to

Keyboard shortcuts

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