tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package tui provides a k9s-style terminal user interface for Nylas.

Package tui provides a k9s-style terminal user interface for Nylas.

Package tui provides a k9s-style terminal user interface for Nylas.

Package tui provides a k9s-style terminal user interface for Nylas.

Package tui provides a k9s-style terminal user interface for Nylas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultThemeFile

func CreateDefaultThemeFile(path string) error

CreateDefaultThemeFile creates a default theme file at the specified path.

func GetSearchHints

func GetSearchHints() string

GetSearchHints returns hints about available search operators.

func GetThemesDir

func GetThemesDir() string

GetThemesDir returns the themes directory path.

func IsBuiltInTheme

func IsBuiltInTheme(theme ThemeName) bool

IsBuiltInTheme checks if a theme name is a built-in theme.

func ListCustomThemes

func ListCustomThemes() []string

ListCustomThemes returns a list of available custom themes.

func NewStyledDetailView

func NewStyledDetailView(styles *Styles, cfg DetailViewConfig) *tview.TextView

NewStyledDetailView creates a pre-configured text view for detail panels. This consolidates the common pattern:

detail := tview.NewTextView()
detail.SetDynamicColors(true)
detail.SetBackgroundColor(v.app.styles.BgColor)
detail.SetBorder(true)
detail.SetBorderColor(v.app.styles.FocusColor)
detail.SetTitle(" Title ")
detail.SetTitleColor(v.app.styles.TitleFg)
detail.SetBorderPadding(1, 1, 2, 2)
detail.SetScrollable(true)

Usage:

detail := NewStyledDetailView(v.app.styles, DetailViewConfig{Title: "Event", Border: true})

func NewStyledInfoPanel

func NewStyledInfoPanel(styles *Styles, title string) *tview.TextView

NewStyledInfoPanel creates a text view styled for info panels (smaller padding). Common pattern used for settings, status, and timeline panels.

func NewStyledList

func NewStyledList(styles *Styles, cfg ListViewConfig) *tview.List

NewStyledList creates a pre-configured list view. This consolidates the common pattern:

list := tview.NewList()
list.SetBackgroundColor(styles.BgColor)
list.SetMainTextColor(styles.FgColor)
list.SetSecondaryTextColor(styles.InfoColor)
list.SetSelectedBackgroundColor(styles.FocusColor)
list.SetSelectedTextColor(styles.BgColor)
list.SetBorder(true)
list.SetBorderColor(styles.BorderColor)
list.SetTitle(" Title ")
list.SetTitleColor(styles.TitleFg)
list.ShowSecondaryText(false)

Usage:

list := NewStyledList(v.app.styles, ListViewConfig{Title: "Participants", ShowSecondaryText: true})

func TestAllBuiltInThemesHaveRequiredColors

func TestAllBuiltInThemesHaveRequiredColors(t *testing.T)

TestAllBuiltInThemesHaveRequiredColors verifies all themes have necessary colors set

func TestAppGetConfig

func TestAppGetConfig(t *testing.T)

func TestAppStyles

func TestAppStyles(t *testing.T)

func TestApp_Flash

func TestApp_Flash(t *testing.T)

func TestApp_GetCurrentView

func TestApp_GetCurrentView(t *testing.T)

func TestApp_GoBack

func TestApp_GoBack(t *testing.T)

func TestApp_NavigateView

func TestApp_NavigateView(t *testing.T)

func TestApp_PageNavigation

func TestApp_PageNavigation(t *testing.T)

func TestApp_PopDetail

func TestApp_PopDetail(t *testing.T)

func TestApp_SetFocus

func TestApp_SetFocus(t *testing.T)

func TestApp_ShowConfirmDialog

func TestApp_ShowConfirmDialog(t *testing.T)

func TestApp_Styles

func TestApp_Styles(t *testing.T)

func TestAvailabilityView_CalendarFields

func TestAvailabilityView_CalendarFields(t *testing.T)

func TestAvailabilityView_CalendarSelection

func TestAvailabilityView_CalendarSelection(t *testing.T)

func TestAvailabilityView_CalendarSelectionNoPrimary

func TestAvailabilityView_CalendarSelectionNoPrimary(t *testing.T)

func TestAvailabilityView_DefaultDates

func TestAvailabilityView_DefaultDates(t *testing.T)

func TestAvailabilityView_DurationDefault

func TestAvailabilityView_DurationDefault(t *testing.T)

func TestAvailabilityView_EmptyParticipants

func TestAvailabilityView_EmptyParticipants(t *testing.T)

func TestAvailabilityView_EmptySlots

func TestAvailabilityView_EmptySlots(t *testing.T)

func TestAvailabilityView_FetchAvailabilityNoParticipants

func TestAvailabilityView_FetchAvailabilityNoParticipants(t *testing.T)

func TestAvailabilityView_Filter

func TestAvailabilityView_Filter(t *testing.T)

func TestAvailabilityView_FocusPanel

func TestAvailabilityView_FocusPanel(t *testing.T)

func TestAvailabilityView_FreeBusyRendering

func TestAvailabilityView_FreeBusyRendering(t *testing.T)

func TestAvailabilityView_FullInterface

func TestAvailabilityView_FullInterface(t *testing.T)

func TestAvailabilityView_HandleKey

func TestAvailabilityView_HandleKey(t *testing.T)

func TestAvailabilityView_HandleParticipantsInput

func TestAvailabilityView_HandleParticipantsInput(t *testing.T)

func TestAvailabilityView_HandleSlotsInput

func TestAvailabilityView_HandleSlotsInput(t *testing.T)

func TestAvailabilityView_HandleTimelineInput

func TestAvailabilityView_HandleTimelineInput(t *testing.T)

func TestAvailabilityView_Hints

func TestAvailabilityView_Hints(t *testing.T)

func TestAvailabilityView_InfoPanelUpdate

func TestAvailabilityView_InfoPanelUpdate(t *testing.T)

func TestAvailabilityView_Name

func TestAvailabilityView_Name(t *testing.T)

func TestAvailabilityView_ParticipantsWithData

func TestAvailabilityView_ParticipantsWithData(t *testing.T)

func TestAvailabilityView_Primitive

func TestAvailabilityView_Primitive(t *testing.T)

func TestAvailabilityView_Refresh

func TestAvailabilityView_Refresh(t *testing.T)

func TestAvailabilityView_RemoveSelectedParticipant_Empty

func TestAvailabilityView_RemoveSelectedParticipant_Empty(t *testing.T)

func TestAvailabilityView_RemoveSelectedParticipant_OutOfBounds

func TestAvailabilityView_RemoveSelectedParticipant_OutOfBounds(t *testing.T)

func TestAvailabilityView_RenderSlotsEmpty

func TestAvailabilityView_RenderSlotsEmpty(t *testing.T)

func TestAvailabilityView_RenderSlotsLimit

func TestAvailabilityView_RenderSlotsLimit(t *testing.T)

func TestAvailabilityView_RenderSlotsWithEmails

func TestAvailabilityView_RenderSlotsWithEmails(t *testing.T)

func TestAvailabilityView_RenderTimelineAllFree

func TestAvailabilityView_RenderTimelineAllFree(t *testing.T)

func TestAvailabilityView_RenderTimelineEmpty

func TestAvailabilityView_RenderTimelineEmpty(t *testing.T)

func TestAvailabilityView_SetDateRange

func TestAvailabilityView_SetDateRange(t *testing.T)

func TestAvailabilityView_SetDuration

func TestAvailabilityView_SetDuration(t *testing.T)

func TestAvailabilityView_SlotsWithData

func TestAvailabilityView_SlotsWithData(t *testing.T)

func TestAvailabilityView_Title

func TestAvailabilityView_Title(t *testing.T)

func TestAvailableThemes

func TestAvailableThemes(t *testing.T)

func TestCalendarView_Focus

func TestCalendarView_Focus(t *testing.T)

func TestCalendarView_InputHandler

func TestCalendarView_InputHandler(t *testing.T)

func TestCalendarView_SetOnEventSelect

func TestCalendarView_SetOnEventSelect(t *testing.T)

func TestCommandRegistry

func TestCommandRegistry(t *testing.T)

func TestComposeView

func TestComposeView(t *testing.T)

func TestContactsView

func TestContactsView(t *testing.T)

func TestConvertToHTML

func TestConvertToHTML(t *testing.T)

func TestCreateDefaultThemeFile

func TestCreateDefaultThemeFile(t *testing.T)

func TestCreateView

func TestCreateView(t *testing.T)

func TestCustomThemeIntegration

func TestCustomThemeIntegration(t *testing.T)

func TestCustomThemeViaGetThemeStyles

func TestCustomThemeViaGetThemeStyles(t *testing.T)

TestCustomThemeViaGetThemeStyles tests that GetThemeStyles correctly loads custom themes

func TestDashboardView

func TestDashboardView(t *testing.T)

func TestDefaultStyles

func TestDefaultStyles(t *testing.T)

func TestDraftsView

func TestDraftsView(t *testing.T)

func TestEventsViewEscapeWithFocusedPanels

func TestEventsViewEscapeWithFocusedPanels(t *testing.T)

TestEventsViewEscapeWithFocusedPanels tests that Escape works regardless of which panel has focus.

func TestEventsViewKeys

func TestEventsViewKeys(t *testing.T)

func TestFormatDate

func TestFormatDate(t *testing.T)

func TestFormatParticipants

func TestFormatParticipants(t *testing.T)

func TestGetThemeStyles

func TestGetThemeStyles(t *testing.T)

func TestGetThemeStylesLoadsCustomTheme

func TestGetThemeStylesLoadsCustomTheme(t *testing.T)

TestGetThemeStylesLoadsCustomTheme verifies GetThemeStyles loads themes from ~/.config/nylas/themes/

func TestGetThemeStylesWithCustomTheme

func TestGetThemeStylesWithCustomTheme(t *testing.T)

TestGetThemeStylesWithCustomTheme tests that GetThemeStyles falls back to custom themes

func TestGetThemeStylesWithError

func TestGetThemeStylesWithError(t *testing.T)

TestGetThemeStylesWithError tests the new error-returning function

func TestGetThemesDir

func TestGetThemesDir(t *testing.T)

func TestGrantsViewSwitching

func TestGrantsViewSwitching(t *testing.T)

TestGrantsViewSwitching tests grant switching functionality.

func TestHelpView

func TestHelpView(t *testing.T)

func TestIsBuiltInTheme

func TestIsBuiltInTheme(t *testing.T)

TestIsBuiltInTheme tests the built-in theme checker

func TestIsNumeric

func TestIsNumeric(t *testing.T)

func TestIsValidColorValue

func TestIsValidColorValue(t *testing.T)

TestIsValidColorValue tests color validation

func TestListCustomThemes

func TestListCustomThemes(t *testing.T)

func TestLoadCustomThemeFromConfigDir

func TestLoadCustomThemeFromConfigDir(t *testing.T)

TestLoadCustomThemeFromConfigDir tests loading from the actual config directory

func TestLoadCustomThemeWithExtension

func TestLoadCustomThemeWithExtension(t *testing.T)

TestLoadCustomThemeWithExtension tests error when user includes .yaml extension

func TestLoadCustomTheme_NotFound

func TestLoadCustomTheme_NotFound(t *testing.T)

func TestLoadThemeFromFile_NotFound

func TestLoadThemeFromFile_NotFound(t *testing.T)

func TestMessagesViewKeys

func TestMessagesViewKeys(t *testing.T)

func TestNewApp

func TestNewApp(t *testing.T)

func TestNewAppWithThemes

func TestNewAppWithThemes(t *testing.T)

func TestNewAvailabilityView

func TestNewAvailabilityView(t *testing.T)

func TestPageStack

func TestPageStack(t *testing.T)

func TestPageStack_HasPage

func TestPageStack_HasPage(t *testing.T)

func TestPageStack_PushPop

func TestPageStack_PushPop(t *testing.T)

func TestPageStack_SwitchTo

func TestPageStack_SwitchTo(t *testing.T)

func TestParseColor

func TestParseColor(t *testing.T)

func TestParseInt

func TestParseInt(t *testing.T)

func TestParseRecipients

func TestParseRecipients(t *testing.T)

func TestStyles_DefaultStyles

func TestStyles_DefaultStyles(t *testing.T)

func TestTable

func TestTable(t *testing.T)

func TestTableSelection

func TestTableSelection(t *testing.T)

func TestTable_GetRowCount

func TestTable_GetRowCount(t *testing.T)

func TestTable_SelectedMeta

func TestTable_SelectedMeta(t *testing.T)

func TestTable_SetData

func TestTable_SetData(t *testing.T)

func TestThemeConfigToStyles

func TestThemeConfigToStyles(t *testing.T)

func TestThemeLoadError

func TestThemeLoadError(t *testing.T)

TestThemeLoadError tests the custom error type

func TestValidateTheme

func TestValidateTheme(t *testing.T)

TestValidateTheme tests the validation function

func TestValidateTheme_NonExistent

func TestValidateTheme_NonExistent(t *testing.T)

TestValidateTheme_NonExistent tests validation of non-existent theme

func TestViewInterfaces

func TestViewInterfaces(t *testing.T)

TestViewInterfaces verifies all views implement ResourceView interface

func TestViewsEscapeKeyHandling

func TestViewsEscapeKeyHandling(t *testing.T)

TestViewsEscapeKeyHandling verifies that all views properly return the Escape key event so the app can handle navigation back to the previous view. This is a regression test for the calendar view Escape key bug.

func TestWebhooksView

func TestWebhooksView(t *testing.T)

Types

type App

type App struct {
	*tview.Application
	// contains filtered or unexported fields
}

App is the main TUI application using tview (like k9s).

func NewApp

func NewApp(cfg Config) *App

NewApp creates a new TUI application.

func (*App) CanSwitchGrant

func (a *App) CanSwitchGrant() bool

CanSwitchGrant returns true if grant switching is available.

func (*App) DeleteContact

func (a *App) DeleteContact(contact *domain.Contact, onDelete func())

DeleteContact shows a confirmation dialog and deletes a contact.

func (*App) DeleteEvent

func (a *App) DeleteEvent(calendarID string, event *domain.Event, onDelete func())

DeleteEvent shows a confirmation dialog and deletes an event.

func (*App) DeleteWebhook

func (a *App) DeleteWebhook(webhook *domain.Webhook, onDelete func())

DeleteWebhook shows a confirmation dialog and deletes a webhook.

func (*App) Flash

func (a *App) Flash(level FlashLevel, msg string, args ...any)

Flash displays a temporary message.

func (*App) GetConfig

func (a *App) GetConfig() Config

Config returns the app config.

func (*App) PopDetail

func (a *App) PopDetail()

PopDetail pops a detail view from the stack

func (*App) PushDetail

func (a *App) PushDetail(name string, view tview.Primitive)

PushDetail pushes a detail view onto the stack (for message detail, etc.)

func (*App) Run

func (a *App) Run() error

func (*App) ShowConfirmDialog

func (a *App) ShowConfirmDialog(title, message string, onConfirm func())

ShowConfirmDialog displays a confirm dialog and returns.

func (*App) ShowContactForm

func (a *App) ShowContactForm(contact *domain.Contact, onSave func(*domain.Contact))

ShowContactForm displays a contact form for create/edit.

func (*App) ShowErrorDialog

func (a *App) ShowErrorDialog(title, message string)

ShowErrorDialog displays an error dialog.

func (*App) ShowEventForm

func (a *App) ShowEventForm(calendarID string, event *domain.Event, onSave func(*domain.Event))

ShowEventForm displays an event form for create/edit.

func (*App) ShowForm

func (a *App) ShowForm(title string, fields []FormField, onSubmit func(map[string]string))

ShowForm displays a form and handles submit/cancel.

func (*App) ShowInfoDialog

func (a *App) ShowInfoDialog(title, message string)

ShowInfoDialog displays an info dialog.

func (*App) ShowWebhookForm

func (a *App) ShowWebhookForm(webhook *domain.Webhook, onSave func(*domain.Webhook))

ShowWebhookForm displays a webhook form for create/edit.

func (*App) Stop

func (a *App) Stop()

Stop stops the application.

func (*App) Styles

func (a *App) Styles() *Styles

Styles returns the app styles.

func (*App) SwitchGrant

func (a *App) SwitchGrant(grantID, email, provider string) error

SwitchGrant switches to a different grant and updates the UI. Returns an error if GrantStore is not configured or the switch fails.

type AttachmentInfo

type AttachmentInfo struct {
	MessageID  string
	Attachment domain.Attachment
}

AttachmentInfo holds attachment metadata for download reference.

type AvailabilityView

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

AvailabilityView displays free/busy information and helps find meeting times.

func NewAvailabilityView

func NewAvailabilityView(app *App) *AvailabilityView

NewAvailabilityView creates a new availability view.

func (*AvailabilityView) Filter

func (v *AvailabilityView) Filter(string)

func (*AvailabilityView) HandleKey

func (v *AvailabilityView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*AvailabilityView) Hints

func (v *AvailabilityView) Hints() []Hint

func (*AvailabilityView) Load

func (v *AvailabilityView) Load()

func (*AvailabilityView) Name

func (v *AvailabilityView) Name() string

func (*AvailabilityView) Primitive

func (v *AvailabilityView) Primitive() tview.Primitive

func (*AvailabilityView) Refresh

func (v *AvailabilityView) Refresh()

func (*AvailabilityView) Title

func (v *AvailabilityView) Title() string

type BaseTableView

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

BaseTableView provides common table view functionality.

func (*BaseTableView) Filter

func (v *BaseTableView) Filter(f string)

func (*BaseTableView) HandleKey

func (v *BaseTableView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*BaseTableView) Hints

func (v *BaseTableView) Hints() []Hint

func (*BaseTableView) Name

func (v *BaseTableView) Name() string

func (*BaseTableView) Primitive

func (v *BaseTableView) Primitive() tview.Primitive

func (*BaseTableView) Title

func (v *BaseTableView) Title() string

type BodyStyle

type BodyStyle struct {
	FgColor   string `yaml:"fgColor"`
	BgColor   string `yaml:"bgColor"`
	LogoColor string `yaml:"logoColor"`
}

BodyStyle for general body colors.

type BorderStyle

type BorderStyle struct {
	FgColor    string `yaml:"fgColor"`
	FocusColor string `yaml:"focusColor"`
}

BorderStyle for borders.

type CalendarView

type CalendarView struct {
	*tview.Box
	// contains filtered or unexported fields
}

CalendarView displays a Google Calendar-style calendar.

func NewCalendarView

func NewCalendarView(app *App) *CalendarView

NewCalendarView creates a new calendar view.

func (*CalendarView) Draw

func (c *CalendarView) Draw(screen tcell.Screen)

func (*CalendarView) Focus

func (c *CalendarView) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*CalendarView) GetCalendars

func (c *CalendarView) GetCalendars() []domain.Calendar

GetCalendars returns all available calendars.

func (*CalendarView) GetCurrentCalendar

func (c *CalendarView) GetCurrentCalendar() *domain.Calendar

GetCurrentCalendar returns the currently selected calendar.

func (*CalendarView) GetCurrentCalendarID

func (c *CalendarView) GetCurrentCalendarID() string

GetCurrentCalendarID returns the current calendar ID.

func (*CalendarView) GetEventsForDate

func (c *CalendarView) GetEventsForDate(date time.Time) []domain.Event

GetEventsForDate returns events for a specific date.

func (*CalendarView) GetSelectedDate

func (c *CalendarView) GetSelectedDate() time.Time

GetSelectedDate returns the currently selected date.

func (*CalendarView) GoToToday

func (c *CalendarView) GoToToday()

GoToToday navigates to today.

func (*CalendarView) HasFocus

func (c *CalendarView) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*CalendarView) InputHandler

func (c *CalendarView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*CalendarView) MouseHandler

func (c *CalendarView) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns the mouse handler for the calendar.

func (*CalendarView) NextCalendar

func (c *CalendarView) NextCalendar()

NextCalendar switches to the next calendar.

func (*CalendarView) NextMonth

func (c *CalendarView) NextMonth()

NextMonth moves to the next month.

func (*CalendarView) NextWeek

func (c *CalendarView) NextWeek()

NextWeek moves to the next week.

func (*CalendarView) PrevCalendar

func (c *CalendarView) PrevCalendar()

PrevCalendar switches to the previous calendar.

func (*CalendarView) PrevMonth

func (c *CalendarView) PrevMonth()

PrevMonth moves to the previous month.

func (*CalendarView) PrevWeek

func (c *CalendarView) PrevWeek()

PrevWeek moves to the previous week.

func (*CalendarView) SetCalendarByIndex

func (c *CalendarView) SetCalendarByIndex(index int)

SetCalendarByIndex sets the current calendar by index.

func (*CalendarView) SetCalendars

func (c *CalendarView) SetCalendars(calendars []domain.Calendar)

SetCalendars sets the available calendars.

func (*CalendarView) SetEvents

func (c *CalendarView) SetEvents(events []domain.Event)

SetEvents sets the events to display.

func (*CalendarView) SetOnCalendarChange

func (c *CalendarView) SetOnCalendarChange(handler func(string))

SetOnCalendarChange sets the callback for when calendar changes.

func (*CalendarView) SetOnDateSelect

func (c *CalendarView) SetOnDateSelect(handler func(time.Time))

SetOnDateSelect sets the callback for date selection.

func (*CalendarView) SetOnEventSelect

func (c *CalendarView) SetOnEventSelect(handler func(*domain.Event))

SetOnEventSelect sets the callback for event selection.

func (*CalendarView) SetViewMode

func (c *CalendarView) SetViewMode(mode CalendarViewMode)

SetViewMode sets the view mode.

func (*CalendarView) ToggleViewMode

func (c *CalendarView) ToggleViewMode()

ToggleViewMode cycles through view modes.

type CalendarViewMode

type CalendarViewMode int

CalendarViewMode represents the calendar display mode.

const (
	CalendarMonthView CalendarViewMode = iota
	CalendarWeekView
	CalendarAgendaView
)

type CategoryGroup

type CategoryGroup struct {
	Category CommandCategory
	Commands []Command
}

CategoryGroup holds a category and its commands.

type ColorCache

type ColorCache struct {
	Title   string // TitleFg
	Key     string // FgColor
	Value   string // InfoSectionFg
	Muted   string // BorderColor
	Info    string // InfoColor
	Hint    string // InfoColor (alias for clarity)
	Success string // SuccessColor
	Error   string // ErrorColor
	Warn    string // WarnColor
}

ColorCache provides cached hex color strings for a Styles instance. This avoids repeated colorToHex() calls during rendering.

func NewColorCache

func NewColorCache(styles *Styles) *ColorCache

NewColorCache creates a ColorCache from styles, using the cached Hex() method.

type Column

type Column struct {
	Title  string
	Width  int  // Fixed width, 0 for auto
	Expand bool // Expand to fill space
}

Column defines a table column.

type Command

type Command struct {
	Name        string          // Primary command name (e.g., "messages")
	Aliases     []string        // Short aliases (e.g., ["m", "msg"])
	Description string          // Human-readable description
	Category    CommandCategory // For grouping in help/palette
	Shortcut    string          // Direct key shortcut if any (e.g., "n" for compose)
	SubCommands []Command       // Nested sub-commands
	ContextView string          // View where this command is available ("" = all views)
}

Command represents a TUI command with metadata.

func (Command) AllNames

func (c Command) AllNames() []string

AllNames returns all names including aliases for this command.

func (Command) DisplayAliases

func (c Command) DisplayAliases() string

DisplayAliases returns a formatted string of aliases for display.

type CommandCategory

type CommandCategory string

CommandCategory groups related commands for organization in help and palette.

const (
	CategoryNavigation CommandCategory = "Navigation"
	CategoryMessages   CommandCategory = "Messages"
	CategoryCalendar   CommandCategory = "Calendar"
	CategoryContacts   CommandCategory = "Contacts"
	CategoryWebhooks   CommandCategory = "Webhooks"
	CategoryFolders    CommandCategory = "Folders"
	CategoryVim        CommandCategory = "Vim Commands"
	CategorySystem     CommandCategory = "System"
)

type CommandPalette

type CommandPalette struct {
	*tview.Flex
	// contains filtered or unexported fields
}

CommandPalette provides an autocomplete dropdown for command input.

func NewCommandPalette

func NewCommandPalette(app *App, registry *CommandRegistry, onExecute func(string), onCancel func()) *CommandPalette

NewCommandPalette creates a new command palette.

func (*CommandPalette) Focus

func (p *CommandPalette) Focus(delegate func(tview.Primitive))

Focus sets focus to the input field.

func (*CommandPalette) GetInput

func (p *CommandPalette) GetInput() string

GetInput returns the current input text.

func (*CommandPalette) Hide

func (p *CommandPalette) Hide()

Hide deactivates the command palette.

func (*CommandPalette) IsVisible

func (p *CommandPalette) IsVisible() bool

IsVisible returns true if the palette is visible.

func (*CommandPalette) SetInput

func (p *CommandPalette) SetInput(text string)

SetInput sets the input text.

func (*CommandPalette) Show

func (p *CommandPalette) Show()

Show activates the command palette.

type CommandRegistry

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

CommandRegistry holds all registered commands and provides lookup methods.

func NewCommandRegistry

func NewCommandRegistry() *CommandRegistry

NewCommandRegistry creates a new registry with all TUI commands registered.

func (*CommandRegistry) Get

func (r *CommandRegistry) Get(name string) *Command

Get returns a command by name or alias, or nil if not found.

func (*CommandRegistry) GetAll

func (r *CommandRegistry) GetAll() []Command

GetAll returns all top-level commands sorted alphabetically.

func (*CommandRegistry) GetByCategory

func (r *CommandRegistry) GetByCategory() []CategoryGroup

GetByCategory returns commands grouped by category in display order.

func (*CommandRegistry) GetSubCommands

func (r *CommandRegistry) GetSubCommands(parent string) []Command

GetSubCommands returns sub-commands for a parent command.

func (*CommandRegistry) HasSubCommands

func (r *CommandRegistry) HasSubCommands(name string) bool

HasSubCommands returns true if the command has sub-commands.

func (*CommandRegistry) Register

func (r *CommandRegistry) Register(cmd Command)

Register adds a command to the registry.

func (*CommandRegistry) Search

func (r *CommandRegistry) Search(query string) []Command

Search returns commands matching the query using fuzzy matching. Results are sorted by relevance (exact match > prefix match > contains).

func (*CommandRegistry) SearchSubCommands

func (r *CommandRegistry) SearchSubCommands(parent, query string) []Command

SearchSubCommands searches sub-commands for a parent command.

type ComposeMode

type ComposeMode int

ComposeMode indicates the type of compose action.

const (
	ComposeModeNew ComposeMode = iota
	ComposeModeReply
	ComposeModeReplyAll
	ComposeModeForward
	ComposeModeDraft // Editing an existing draft
)

type ComposeView

type ComposeView struct {
	*tview.Flex
	// contains filtered or unexported fields
}

ComposeView provides an email compose form.

func NewComposeView

func NewComposeView(app *App, mode ComposeMode, replyTo *domain.Message) *ComposeView

NewComposeView creates a new compose email view.

func NewComposeViewForDraft

func NewComposeViewForDraft(app *App, draft *domain.Draft) *ComposeView

NewComposeViewForDraft creates a compose view for editing an existing draft.

func (*ComposeView) Focus

func (c *ComposeView) Focus(delegate func(p tview.Primitive))

Focus sets focus to the To field.

func (*ComposeView) SetOnCancel

func (c *ComposeView) SetOnCancel(handler func())

SetOnCancel sets the callback for when compose is cancelled.

func (*ComposeView) SetOnSave

func (c *ComposeView) SetOnSave(handler func())

SetOnSave sets the callback for when a draft is saved.

func (*ComposeView) SetOnSent

func (c *ComposeView) SetOnSent(handler func())

SetOnSent sets the callback for when an email is sent successfully.

type Config

type Config struct {
	Client          ports.NylasClient
	GrantStore      ports.GrantStore // Optional: enables grant switching in TUI
	GrantID         string
	Email           string
	Provider        string
	RefreshInterval time.Duration
	InitialView     string    // Initial view to navigate to (messages, events, contacts, webhooks, grants)
	Theme           ThemeName // Theme name (k9s, amber, green, apple2, vintage, ibm, futuristic, matrix)
}

Config holds the TUI configuration.

type ContactForm

type ContactForm struct {
	*tview.Flex
	// contains filtered or unexported fields
}

ContactForm provides a form for creating/editing contacts.

func NewContactForm

func NewContactForm(app *App, contact *domain.Contact, onSubmit func(*domain.Contact), onCancel func()) *ContactForm

NewContactForm creates a new contact form.

func (*ContactForm) Focus

func (f *ContactForm) Focus(delegate func(p tview.Primitive))

Focus sets focus to the form.

type ContactFormMode

type ContactFormMode int

ContactFormMode indicates if we're creating or editing.

const (
	ContactFormCreate ContactFormMode = iota
	ContactFormEdit
)

type ContactsView

type ContactsView struct {
	*BaseTableView
	// contains filtered or unexported fields
}

ContactsView displays contacts.

func NewContactsView

func NewContactsView(app *App) *ContactsView

NewContactsView creates a new contacts view.

func (*ContactsView) HandleKey

func (v *ContactsView) HandleKey(event *tcell.EventKey) *tcell.EventKey

HandleKey handles keyboard input for contacts view.

func (*ContactsView) Load

func (v *ContactsView) Load()

func (*ContactsView) Refresh

func (v *ContactsView) Refresh()

type Crumbs

type Crumbs struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Crumbs displays breadcrumb navigation like k9s.

func NewCrumbs

func NewCrumbs(styles *Styles) *Crumbs

NewCrumbs creates a new crumbs component.

func (*Crumbs) SetPath

func (c *Crumbs) SetPath(path string)

SetPath sets the breadcrumb path.

type CrumbsStyle

type CrumbsStyle struct {
	FgColor     string `yaml:"fgColor"`
	BgColor     string `yaml:"bgColor"`
	ActiveColor string `yaml:"activeColor"`
}

CrumbsStyle for breadcrumbs.

type DashboardView

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

DashboardView shows an overview.

func NewDashboardView

func NewDashboardView(app *App) *DashboardView

NewDashboardView creates a new dashboard view.

func (*DashboardView) Filter

func (v *DashboardView) Filter(string)

func (*DashboardView) HandleKey

func (v *DashboardView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*DashboardView) Hints

func (v *DashboardView) Hints() []Hint

func (*DashboardView) Load

func (v *DashboardView) Load()

func (*DashboardView) Name

func (v *DashboardView) Name() string

func (*DashboardView) Primitive

func (v *DashboardView) Primitive() tview.Primitive

func (*DashboardView) Refresh

func (v *DashboardView) Refresh()

func (*DashboardView) Title

func (v *DashboardView) Title() string

type DetailViewConfig

type DetailViewConfig struct {
	Title      string // Optional title displayed in border
	Border     bool   // Whether to show border (default false for messages, true for others)
	Scrollable bool   // Whether view is scrollable (default true)
}

DetailViewConfig holds optional configuration for detail text views.

type Dialog

type Dialog struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Dialog displays a modal dialog for confirmations or messages.

func NewConfirmDialog

func NewConfirmDialog(app *App, title, message string, onConfirm, onCancel func()) *Dialog

NewConfirmDialog creates a confirmation dialog with Yes/No buttons.

func NewErrorDialog

func NewErrorDialog(app *App, title, message string, onClose func()) *Dialog

NewErrorDialog creates an error dialog with OK button.

func NewInfoDialog

func NewInfoDialog(app *App, title, message string, onClose func()) *Dialog

NewInfoDialog creates an informational dialog with OK button.

func (*Dialog) Focus

func (d *Dialog) Focus(delegate func(p tview.Primitive))

Focus sets focus to the modal.

type DialogType

type DialogType int

DialogType defines the type of dialog.

const (
	DialogConfirm DialogType = iota
	DialogInfo
	DialogError
)

type DraftsView

type DraftsView struct {
	*BaseTableView
	// contains filtered or unexported fields
}

DraftsView displays email drafts.

func NewDraftsView

func NewDraftsView(app *App) *DraftsView

NewDraftsView creates a new drafts view.

func (*DraftsView) HandleKey

func (v *DraftsView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*DraftsView) Load

func (v *DraftsView) Load()

func (*DraftsView) Refresh

func (v *DraftsView) Refresh()

type EventForm

type EventForm struct {
	*tview.Flex
	// contains filtered or unexported fields
}

EventForm provides a form for creating/editing events.

func NewEventForm

func NewEventForm(app *App, calendarID string, event *domain.Event, onSubmit func(*domain.Event), onCancel func()) *EventForm

NewEventForm creates a new event form.

func (*EventForm) Focus

func (f *EventForm) Focus(delegate func(p tview.Primitive))

Focus sets focus to the form.

type EventFormMode

type EventFormMode int

EventFormMode indicates if we're creating or editing.

const (
	EventFormCreate EventFormMode = iota
	EventFormEdit
)

type EventsView

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

EventsView displays a Google Calendar-style calendar view.

func NewEventsView

func NewEventsView(app *App) *EventsView

NewEventsView creates a new calendar-style events view.

func (*EventsView) Filter

func (v *EventsView) Filter(string)

func (*EventsView) HandleKey

func (v *EventsView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*EventsView) Hints

func (v *EventsView) Hints() []Hint

func (*EventsView) Load

func (v *EventsView) Load()

func (*EventsView) Name

func (v *EventsView) Name() string

func (*EventsView) Primitive

func (v *EventsView) Primitive() tview.Primitive

func (*EventsView) Refresh

func (v *EventsView) Refresh()

func (*EventsView) Title

func (v *EventsView) Title() string

type FieldType

type FieldType int

FieldType defines the type of form field.

const (
	FieldText FieldType = iota
	FieldTextArea
	FieldDropdown
	FieldCheckbox
	FieldDate
	FieldTime
	FieldDateTime
)

type FlashLevel

type FlashLevel int

FlashLevel represents the severity of a flash message.

const (
	FlashInfo FlashLevel = iota
	FlashWarn
	FlashError
)

type FolderPanel

type FolderPanel struct {
	*tview.Flex
	// contains filtered or unexported fields
}

FolderPanel displays a list of email folders with unread counts.

func NewFolderPanel

func NewFolderPanel(app *App, onSelect func(folder *domain.Folder)) *FolderPanel

NewFolderPanel creates a new folder panel.

func (*FolderPanel) Focus

func (p *FolderPanel) Focus(delegate func(p tview.Primitive))

Focus sets focus to the list.

func (*FolderPanel) GetFolderBySystemName

func (p *FolderPanel) GetFolderBySystemName(systemName string) *domain.Folder

GetFolderBySystemName returns a folder by its system name.

func (*FolderPanel) GetSelectedFolder

func (p *FolderPanel) GetSelectedFolder() *domain.Folder

GetSelectedFolder returns the currently selected folder.

func (*FolderPanel) Hide

func (p *FolderPanel) Hide()

Hide makes the folder panel invisible.

func (*FolderPanel) IsVisible

func (p *FolderPanel) IsVisible() bool

IsVisible returns whether the panel is visible.

func (*FolderPanel) Load

func (p *FolderPanel) Load()

Load fetches folders from the API.

func (*FolderPanel) SetSelectedFolder

func (p *FolderPanel) SetSelectedFolder(folderID string)

SetSelectedFolder sets the currently selected folder by ID.

func (*FolderPanel) Show

func (p *FolderPanel) Show()

Show makes the folder panel visible.

func (*FolderPanel) Toggle

func (p *FolderPanel) Toggle()

Toggle toggles the visibility of the folder panel.

type Form

type Form struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Form provides a modal form for creating/editing resources.

func NewForm

func NewForm(app *App, title string, fields []FormField, onSubmit func(map[string]string), onCancel func()) *Form

NewForm creates a new form with the given fields.

func (*Form) Focus

func (f *Form) Focus(delegate func(p tview.Primitive))

Focus sets focus to the form.

func (*Form) GetValue

func (f *Form) GetValue(key string) string

GetValue returns the current value for a field.

func (*Form) SetValue

func (f *Form) SetValue(key, value string)

SetValue sets the value for a field.

type FormField

type FormField struct {
	Key         string             // Unique key for the field
	Label       string             // Display label
	Type        FieldType          // Field type
	Placeholder string             // Placeholder text
	Value       string             // Initial value
	Options     []string           // Options for dropdown
	Required    bool               // Whether field is required
	Validator   func(string) error // Optional validation function
}

FormField defines a field in a form.

type FrameStyle

type FrameStyle struct {
	Border BorderStyle `yaml:"border"`
	Menu   MenuStyle   `yaml:"menu"`
	Crumbs CrumbsStyle `yaml:"crumbs"`
	Status StatusStyle `yaml:"status"`
	Title  TitleStyle  `yaml:"title"`
}

FrameStyle for frame elements.

type GrantsView

type GrantsView struct {
	*BaseTableView
	// contains filtered or unexported fields
}

GrantsView displays grants.

func NewGrantsView

func NewGrantsView(app *App) *GrantsView

NewGrantsView creates a new grants view.

func (*GrantsView) HandleKey

func (v *GrantsView) HandleKey(event *tcell.EventKey) *tcell.EventKey

HandleKey handles key events for the grants view.

func (*GrantsView) Load

func (v *GrantsView) Load()

func (*GrantsView) Refresh

func (v *GrantsView) Refresh()

type HelpView

type HelpView struct {
	*tview.Flex
	// contains filtered or unexported fields
}

HelpView displays all available commands organized by category. It supports searching/filtering and executing commands directly.

func NewHelpView

func NewHelpView(app *App, registry *CommandRegistry, onClose func(), onExecute func(string)) *HelpView

NewHelpView creates a new help view with the command registry.

func (*HelpView) Focus

func (h *HelpView) Focus(delegate func(p tview.Primitive))

Focus sets focus to the table.

type Hint

type Hint struct {
	Key  string
	Desc string
}

Hint represents a keyboard shortcut hint.

type InboundView

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

InboundView displays inbound inboxes and their messages.

func NewInboundView

func NewInboundView(app *App) *InboundView

NewInboundView creates a new inbound view.

func (*InboundView) Filter

func (v *InboundView) Filter(string)

func (*InboundView) HandleKey

func (v *InboundView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*InboundView) Hints

func (v *InboundView) Hints() []Hint

func (*InboundView) Load

func (v *InboundView) Load()

func (*InboundView) Name

func (v *InboundView) Name() string

func (*InboundView) Primitive

func (v *InboundView) Primitive() tview.Primitive

func (*InboundView) Refresh

func (v *InboundView) Refresh()

func (*InboundView) Title

func (v *InboundView) Title() string

type InfoStyle

type InfoStyle struct {
	FgColor      string `yaml:"fgColor"`
	SectionColor string `yaml:"sectionColor"`
}

InfoStyle for info panel.

type K9sSkin

type K9sSkin struct {
	Body   BodyStyle   `yaml:"body"`
	Prompt PromptStyle `yaml:"prompt"`
	Info   InfoStyle   `yaml:"info"`
	Frame  FrameStyle  `yaml:"frame"`
	Views  ViewsStyle  `yaml:"views"`
}

K9sSkin represents the k9s skin configuration.

type ListViewConfig

type ListViewConfig struct {
	Title             string // Title displayed in border
	ShowSecondaryText bool   // Whether to show secondary text line
	HighlightFullLine bool   // Whether selection highlights full line
	UseTableSelectBg  bool   // Use TableSelectBg instead of FocusColor for selection
}

ListViewConfig holds optional configuration for styled lists.

type Logo struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Logo displays the application logo.

func NewLogo(styles *Styles) *Logo

NewLogo creates a new logo component.

type Menu struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Menu displays keyboard hints at the bottom like k9s.

func NewMenu

func NewMenu(styles *Styles) *Menu

NewMenu creates a new menu component.

func (m *Menu) SetHints(hints []Hint)

SetHints sets the keyboard hints to display.

type MenuStyle struct {
	FgColor     string `yaml:"fgColor"`
	KeyColor    string `yaml:"keyColor"`
	NumKeyColor string `yaml:"numKeyColor"`
}

MenuStyle for menu.

type MessagesView

type MessagesView struct {
	*BaseTableView
	// contains filtered or unexported fields
}

MessagesView displays email threads (conversations).

func NewMessagesView

func NewMessagesView(app *App) *MessagesView

NewMessagesView creates a new messages view.

func (*MessagesView) HandleKey

func (v *MessagesView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*MessagesView) Load

func (v *MessagesView) Load()

func (*MessagesView) Primitive

func (v *MessagesView) Primitive() tview.Primitive

Primitive returns the root primitive for this view.

func (*MessagesView) Refresh

func (v *MessagesView) Refresh()

type PageStack

type PageStack struct {
	*tview.Pages
	// contains filtered or unexported fields
}

PageStack combines tview.Pages with a navigation stack (like k9s).

func NewPageStack

func NewPageStack() *PageStack

NewPageStack creates a new page stack.

func (*PageStack) Len

func (p *PageStack) Len() int

Len returns the stack depth.

func (*PageStack) Pop

func (p *PageStack) Pop() string

Pop removes the top page and shows the previous one.

func (*PageStack) Push

func (p *PageStack) Push(name string, page tview.Primitive)

Push adds a page and shows it.

func (*PageStack) SwitchTo

func (p *PageStack) SwitchTo(name string, page tview.Primitive)

SwitchTo shows a page (adds to stack if not top).

func (*PageStack) Top

func (p *PageStack) Top() string

Top returns the current page name.

type Prompt

type Prompt struct {
	*tview.InputField
	// contains filtered or unexported fields
}

Prompt handles command/filter input like k9s.

func NewPrompt

func NewPrompt(styles *Styles, onCommand, onFilter func(string)) *Prompt

NewPrompt creates a new prompt component.

func (*Prompt) Activate

func (p *Prompt) Activate(mode PromptMode)

Activate activates the prompt in the given mode.

func (*Prompt) HandleKey

func (p *Prompt) HandleKey(event *tcell.EventKey) *tcell.EventKey

HandleKey processes key events for the prompt.

type PromptMode

type PromptMode int

PromptMode represents the type of prompt.

const (
	PromptCommand PromptMode = iota
	PromptFilter
)

type PromptStyle

type PromptStyle struct {
	FgColor      string `yaml:"fgColor"`
	BgColor      string `yaml:"bgColor"`
	SuggestColor string `yaml:"suggestColor"`
}

PromptStyle for command prompt.

type ResourceView

type ResourceView interface {
	Name() string
	Title() string
	Primitive() tview.Primitive
	Hints() []Hint
	Load()
	Refresh()
	Filter(string)
	HandleKey(*tcell.EventKey) *tcell.EventKey
}

ResourceView interface for all views.

type RowMeta

type RowMeta struct {
	ID      string
	Data    any
	Unread  bool
	Starred bool
	Error   bool
}

RowMeta holds metadata for a row.

type SearchQuery

type SearchQuery struct {
	From          string // from: operator
	To            string // to: operator
	Subject       string // subject: operator
	HasAttachment bool   // has:attachment
	IsUnread      *bool  // is:unread or is:read
	IsStarred     *bool  // is:starred
	FreeText      string // Everything else
}

SearchQuery represents a parsed search query with operators.

func ParseSearchQuery

func ParseSearchQuery(query string) *SearchQuery

ParseSearchQuery parses a search string into operators and free text. Supported operators:

func (*SearchQuery) MatchesDraft

func (sq *SearchQuery) MatchesDraft(draft *domain.Draft) bool

MatchesDraft checks if a draft matches the search query.

func (*SearchQuery) MatchesThread

func (sq *SearchQuery) MatchesThread(thread *domain.Thread) bool

MatchesThread checks if a thread matches the search query.

type Stack

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

Stack manages a stack of components (like k9s PageStack).

func NewStack

func NewStack() *Stack

NewStack creates a new stack.

func (*Stack) Clear

func (s *Stack) Clear()

Clear empties the stack.

func (*Stack) Len

func (s *Stack) Len() int

Len returns the stack size.

func (*Stack) Pop

func (s *Stack) Pop() string

Pop removes and returns the top item.

func (*Stack) Push

func (s *Stack) Push(name string)

Push adds an item to the stack.

func (*Stack) Top

func (s *Stack) Top() string

Top returns the top item without removing it.

type StatusIndicator

type StatusIndicator struct {
	*tview.TextView
	// contains filtered or unexported fields
}

StatusIndicator shows status info like k9s.

func NewStatusIndicator

func NewStatusIndicator(styles *Styles, config Config) *StatusIndicator

NewStatusIndicator creates a new status indicator.

func (*StatusIndicator) Flash

func (s *StatusIndicator) Flash(level FlashLevel, msg string)

Flash shows a temporary message.

func (*StatusIndicator) ToggleLive

func (s *StatusIndicator) ToggleLive()

ToggleLive toggles the live refresh status.

func (*StatusIndicator) Update

func (s *StatusIndicator) Update()

Update refreshes the status display.

func (*StatusIndicator) UpdateGrant

func (s *StatusIndicator) UpdateGrant(email, provider, grantID string)

UpdateGrant updates the displayed grant info.

type StatusStyle

type StatusStyle struct {
	NewColor       string `yaml:"newColor"`
	ModifyColor    string `yaml:"modifyColor"`
	AddColor       string `yaml:"addColor"`
	PendingColor   string `yaml:"pendingColor"`
	ErrorColor     string `yaml:"errorColor"`
	HighlightColor string `yaml:"highlightColor"`
	KillColor      string `yaml:"killColor"`
	CompletedColor string `yaml:"completedColor"`
}

StatusStyle for status indicators.

type Styles

type Styles struct {
	// Base colors
	BgColor     tcell.Color
	FgColor     tcell.Color
	BorderColor tcell.Color
	FocusColor  tcell.Color

	// Logo
	LogoColor tcell.Color

	// Status/Info section
	InfoColor      tcell.Color
	InfoSectionFg  tcell.Color
	WarnColor      tcell.Color
	ErrorColor     tcell.Color
	SuccessColor   tcell.Color
	PendingColor   tcell.Color
	HighlightColor tcell.Color
	CompletedColor tcell.Color

	// Table
	TableHeaderFg    tcell.Color
	TableHeaderBg    tcell.Color
	TableSorterColor tcell.Color
	TableRowFg       tcell.Color
	TableRowBg       tcell.Color
	TableSelectFg    tcell.Color
	TableSelectBg    tcell.Color
	TableCursorFg    tcell.Color
	TableCursorBg    tcell.Color
	TableMarkColor   tcell.Color

	// Crumbs
	CrumbFg       tcell.Color
	CrumbBg       tcell.Color
	CrumbActiveFg tcell.Color
	CrumbActiveBg tcell.Color

	// Menu
	MenuKeyFg    tcell.Color
	MenuNumKeyFg tcell.Color
	MenuDescFg   tcell.Color

	// Prompt
	PromptBg     tcell.Color
	PromptFg     tcell.Color
	PromptBorder tcell.Color
	SuggestColor tcell.Color

	// Title
	TitleFg        tcell.Color
	TitleHighlight tcell.Color
	CounterColor   tcell.Color
	FilterColor    tcell.Color
	// contains filtered or unexported fields
}

Styles holds all TUI color definitions (k9s-style).

func AmberStyles

func AmberStyles() *Styles

func AppleIIStyles

func AppleIIStyles() *Styles

AppleIIStyles returns the Apple ][ style green theme. Based on cool-retro-term Apple ][: #00d56d

func DefaultStyles

func DefaultStyles() *Styles

DefaultStyles returns the default k9s-like color scheme. Based on k9s stock.yaml skin: https://github.com/derailed/k9s/blob/master/skins/stock.yaml

func FuturisticStyles

func FuturisticStyles() *Styles

FuturisticStyles returns the steel blue futuristic theme. Based on cool-retro-term Futuristic: #729fcf

func GetThemeStyles

func GetThemeStyles(theme ThemeName) *Styles

GetThemeStyles returns styles for the specified theme. It first checks for built-in themes, then looks for custom themes in ~/.config/nylas/themes/<name>.yaml

func GetThemeStylesWithError

func GetThemeStylesWithError(theme ThemeName) (*Styles, error)

GetThemeStylesWithError returns styles and any error that occurred while loading. This is useful for displaying error messages to users.

func GreenStyles

func GreenStyles() *Styles

GreenStyles returns the classic green phosphor CRT theme. Based on cool-retro-term Monochrome Green: #0ccc68

func IBMDOSStyles

func IBMDOSStyles() *Styles

IBMDOSStyles returns the IBM DOS white theme. Based on cool-retro-term IBM Dos: #ffffff on black

func LoadCustomTheme

func LoadCustomTheme(name string) (*Styles, error)

LoadCustomTheme loads a custom theme from ~/.config/nylas/themes/<name>.yaml

func MatrixStyles

func MatrixStyles() *Styles

MatrixStyles returns the Matrix-inspired green rain theme.

func NortonStyles

func NortonStyles() *Styles

NortonStyles returns the classic Norton Commander DOS file manager theme. Blue background with cyan text - the iconic DOS look.

func VintageStyles

func VintageStyles() *Styles

VintageStyles returns the vintage neon green theme. Based on cool-retro-term Vintage: #00ff3e

func (*Styles) Hex

func (s *Styles) Hex(c tcell.Color) string

Hex returns the cached hex string for a color. This avoids repeated fmt.Sprintf calls during rendering.

type Table

type Table struct {
	*tview.Table
	// contains filtered or unexported fields
}

Table wraps tview.Table with k9s-style functionality.

func NewTable

func NewTable(styles *Styles) *Table

NewTable creates a new table component.

func (*Table) GetRowCount

func (t *Table) GetRowCount() int

GetRowCount returns the number of data rows.

func (*Table) GetSelectedRow

func (t *Table) GetSelectedRow() int

GetSelectedRow returns the 0-based selected data row index.

func (*Table) MouseHandler

func (t *Table) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler returns the mouse handler for the table.

func (*Table) SelectedMeta

func (t *Table) SelectedMeta() *RowMeta

SelectedMeta returns the metadata for the selected row.

func (*Table) SetColumns

func (t *Table) SetColumns(cols []Column)

SetColumns sets the column definitions.

func (*Table) SetData

func (t *Table) SetData(data [][]string, meta []RowMeta)

SetData sets the table data.

func (*Table) SetOnDoubleClick

func (t *Table) SetOnDoubleClick(handler func(*RowMeta))

SetOnDoubleClick sets the callback for double-click on a row.

func (*Table) SetOnSelect

func (t *Table) SetOnSelect(handler func(*RowMeta))

SetOnSelect sets the callback for when a row is selected.

type TableHeaderStyle

type TableHeaderStyle struct {
	FgColor     string `yaml:"fgColor"`
	BgColor     string `yaml:"bgColor"`
	SorterColor string `yaml:"sorterColor"`
}

TableHeaderStyle for table headers.

type TableSelectedStyle

type TableSelectedStyle struct {
	FgColor string `yaml:"fgColor"`
	BgColor string `yaml:"bgColor"`
}

TableSelectedStyle for selected rows.

type TableStyle

type TableStyle struct {
	FgColor   string             `yaml:"fgColor"`
	BgColor   string             `yaml:"bgColor"`
	MarkColor string             `yaml:"markColor"`
	Header    TableHeaderStyle   `yaml:"header"`
	Selected  TableSelectedStyle `yaml:"selected"`
}

TableStyle for table views.

type ThemeConfig

type ThemeConfig struct {
	// Color definitions (like k9s anchors)
	Foreground string `yaml:"foreground"`
	Background string `yaml:"background"`
	Black      string `yaml:"black"`
	Red        string `yaml:"red"`
	Green      string `yaml:"green"`
	Yellow     string `yaml:"yellow"`
	Blue       string `yaml:"blue"`
	Magenta    string `yaml:"magenta"`
	Cyan       string `yaml:"cyan"`
	White      string `yaml:"white"`

	// K9s-style skin configuration
	K9s K9sSkin `yaml:"k9s"`
}

ThemeConfig represents a customizable theme loaded from YAML (k9s-style).

func LoadThemeFromFile

func LoadThemeFromFile(path string) (*ThemeConfig, error)

LoadThemeFromFile loads a theme configuration from a YAML file.

func (*ThemeConfig) ToStyles

func (c *ThemeConfig) ToStyles() *Styles

ToStyles converts a ThemeConfig to Styles.

type ThemeLoadError

type ThemeLoadError struct {
	ThemeName string
	FilePath  string
	Reason    string
	Hint      string
	Err       error
}

func (*ThemeLoadError) Error

func (e *ThemeLoadError) Error() string

func (*ThemeLoadError) Unwrap

func (e *ThemeLoadError) Unwrap() error

type ThemeName

type ThemeName string

ThemeName represents available themes.

const (
	ThemeK9s        ThemeName = "k9s"        // Default k9s style
	ThemeAmber      ThemeName = "amber"      // Amber phosphor CRT
	ThemeGreen      ThemeName = "green"      // Green phosphor CRT
	ThemeAppleII    ThemeName = "apple2"     // Apple ][ style
	ThemeVintage    ThemeName = "vintage"    // Vintage neon green
	ThemeIBMDOS     ThemeName = "ibm"        // IBM DOS white
	ThemeFuturistic ThemeName = "futuristic" // Steel blue futuristic
	ThemeMatrix     ThemeName = "matrix"     // Matrix green rain
	ThemeNorton     ThemeName = "norton"     // Norton Commander DOS style
)

func AvailableThemes

func AvailableThemes() []ThemeName

AvailableThemes returns all available theme names.

type ThemeValidationResult

type ThemeValidationResult struct {
	ThemeName   string
	FilePath    string
	FileSize    int64
	Valid       bool
	ColorsFound []string
	Warnings    []string
	Errors      []string
}

func ValidateTheme

func ValidateTheme(name string) (*ThemeValidationResult, error)

ValidateTheme validates a custom theme and returns detailed information.

type TitleStyle

type TitleStyle struct {
	FgColor        string `yaml:"fgColor"`
	BgColor        string `yaml:"bgColor"`
	HighlightColor string `yaml:"highlightColor"`
	CounterColor   string `yaml:"counterColor"`
	FilterColor    string `yaml:"filterColor"`
}

TitleStyle for titles.

type ViewsStyle

type ViewsStyle struct {
	Table TableStyle `yaml:"table"`
}

ViewsStyle for view-specific styles.

type WebhookForm

type WebhookForm struct {
	*tview.Flex
	// contains filtered or unexported fields
}

WebhookForm provides a form for creating/editing webhooks.

func NewWebhookForm

func NewWebhookForm(app *App, webhook *domain.Webhook, onSubmit func(*domain.Webhook), onCancel func()) *WebhookForm

NewWebhookForm creates a new webhook form.

func (*WebhookForm) Focus

func (f *WebhookForm) Focus(delegate func(p tview.Primitive))

Focus sets focus to the form.

type WebhookFormMode

type WebhookFormMode int

WebhookFormMode indicates if we're creating or editing.

const (
	WebhookFormCreate WebhookFormMode = iota
	WebhookFormEdit
)

type WebhookServerView

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

WebhookServerView displays webhook server status and events.

func NewWebhookServerView

func NewWebhookServerView(app *App) *WebhookServerView

NewWebhookServerView creates a new webhook server view.

func (*WebhookServerView) Filter

func (v *WebhookServerView) Filter(string)

func (*WebhookServerView) HandleKey

func (v *WebhookServerView) HandleKey(event *tcell.EventKey) *tcell.EventKey

func (*WebhookServerView) Hints

func (v *WebhookServerView) Hints() []Hint

func (*WebhookServerView) Load

func (v *WebhookServerView) Load()

func (*WebhookServerView) Name

func (v *WebhookServerView) Name() string

func (*WebhookServerView) Primitive

func (v *WebhookServerView) Primitive() tview.Primitive

func (*WebhookServerView) Refresh

func (v *WebhookServerView) Refresh()

func (*WebhookServerView) Title

func (v *WebhookServerView) Title() string

type WebhooksView

type WebhooksView struct {
	*BaseTableView
	// contains filtered or unexported fields
}

WebhooksView displays webhooks.

func NewWebhooksView

func NewWebhooksView(app *App) *WebhooksView

NewWebhooksView creates a new webhooks view.

func (*WebhooksView) HandleKey

func (v *WebhooksView) HandleKey(event *tcell.EventKey) *tcell.EventKey

HandleKey handles keyboard input for webhooks view.

func (*WebhooksView) Load

func (v *WebhooksView) Load()

func (*WebhooksView) Refresh

func (v *WebhooksView) Refresh()

Jump to

Keyboard shortcuts

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