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 ¶
- func CreateDefaultThemeFile(path string) error
- func GetSearchHints() string
- func GetThemesDir() string
- func IsBuiltInTheme(theme ThemeName) bool
- func ListCustomThemes() []string
- func NewStyledDetailView(styles *Styles, cfg DetailViewConfig) *tview.TextView
- func NewStyledInfoPanel(styles *Styles, title string) *tview.TextView
- func NewStyledList(styles *Styles, cfg ListViewConfig) *tview.List
- func TestAllBuiltInThemesHaveRequiredColors(t *testing.T)
- func TestAppGetConfig(t *testing.T)
- func TestAppStyles(t *testing.T)
- func TestApp_Flash(t *testing.T)
- func TestApp_GetCurrentView(t *testing.T)
- func TestApp_GoBack(t *testing.T)
- func TestApp_NavigateView(t *testing.T)
- func TestApp_PageNavigation(t *testing.T)
- func TestApp_PopDetail(t *testing.T)
- func TestApp_SetFocus(t *testing.T)
- func TestApp_ShowConfirmDialog(t *testing.T)
- func TestApp_Styles(t *testing.T)
- func TestAvailabilityView_CalendarFields(t *testing.T)
- func TestAvailabilityView_CalendarSelection(t *testing.T)
- func TestAvailabilityView_CalendarSelectionNoPrimary(t *testing.T)
- func TestAvailabilityView_DefaultDates(t *testing.T)
- func TestAvailabilityView_DurationDefault(t *testing.T)
- func TestAvailabilityView_EmptyParticipants(t *testing.T)
- func TestAvailabilityView_EmptySlots(t *testing.T)
- func TestAvailabilityView_FetchAvailabilityNoParticipants(t *testing.T)
- func TestAvailabilityView_Filter(t *testing.T)
- func TestAvailabilityView_FocusPanel(t *testing.T)
- func TestAvailabilityView_FreeBusyRendering(t *testing.T)
- func TestAvailabilityView_FullInterface(t *testing.T)
- func TestAvailabilityView_HandleKey(t *testing.T)
- func TestAvailabilityView_HandleParticipantsInput(t *testing.T)
- func TestAvailabilityView_HandleSlotsInput(t *testing.T)
- func TestAvailabilityView_HandleTimelineInput(t *testing.T)
- func TestAvailabilityView_Hints(t *testing.T)
- func TestAvailabilityView_InfoPanelUpdate(t *testing.T)
- func TestAvailabilityView_Name(t *testing.T)
- func TestAvailabilityView_ParticipantsWithData(t *testing.T)
- func TestAvailabilityView_Primitive(t *testing.T)
- func TestAvailabilityView_Refresh(t *testing.T)
- func TestAvailabilityView_RemoveSelectedParticipant_Empty(t *testing.T)
- func TestAvailabilityView_RemoveSelectedParticipant_OutOfBounds(t *testing.T)
- func TestAvailabilityView_RenderSlotsEmpty(t *testing.T)
- func TestAvailabilityView_RenderSlotsLimit(t *testing.T)
- func TestAvailabilityView_RenderSlotsWithEmails(t *testing.T)
- func TestAvailabilityView_RenderTimelineAllFree(t *testing.T)
- func TestAvailabilityView_RenderTimelineEmpty(t *testing.T)
- func TestAvailabilityView_SetDateRange(t *testing.T)
- func TestAvailabilityView_SetDuration(t *testing.T)
- func TestAvailabilityView_SlotsWithData(t *testing.T)
- func TestAvailabilityView_Title(t *testing.T)
- func TestAvailableThemes(t *testing.T)
- func TestCalendarView_Focus(t *testing.T)
- func TestCalendarView_InputHandler(t *testing.T)
- func TestCalendarView_SetOnEventSelect(t *testing.T)
- func TestCommandRegistry(t *testing.T)
- func TestComposeView(t *testing.T)
- func TestContactsView(t *testing.T)
- func TestConvertToHTML(t *testing.T)
- func TestCreateDefaultThemeFile(t *testing.T)
- func TestCreateView(t *testing.T)
- func TestCustomThemeIntegration(t *testing.T)
- func TestCustomThemeViaGetThemeStyles(t *testing.T)
- func TestDashboardView(t *testing.T)
- func TestDefaultStyles(t *testing.T)
- func TestDraftsView(t *testing.T)
- func TestEventsViewEscapeWithFocusedPanels(t *testing.T)
- func TestEventsViewKeys(t *testing.T)
- func TestFormatDate(t *testing.T)
- func TestFormatParticipants(t *testing.T)
- func TestGetThemeStyles(t *testing.T)
- func TestGetThemeStylesLoadsCustomTheme(t *testing.T)
- func TestGetThemeStylesWithCustomTheme(t *testing.T)
- func TestGetThemeStylesWithError(t *testing.T)
- func TestGetThemesDir(t *testing.T)
- func TestGrantsViewSwitching(t *testing.T)
- func TestHelpView(t *testing.T)
- func TestIsBuiltInTheme(t *testing.T)
- func TestIsNumeric(t *testing.T)
- func TestIsValidColorValue(t *testing.T)
- func TestListCustomThemes(t *testing.T)
- func TestLoadCustomThemeFromConfigDir(t *testing.T)
- func TestLoadCustomThemeWithExtension(t *testing.T)
- func TestLoadCustomTheme_NotFound(t *testing.T)
- func TestLoadThemeFromFile_NotFound(t *testing.T)
- func TestMessagesViewKeys(t *testing.T)
- func TestNewApp(t *testing.T)
- func TestNewAppWithThemes(t *testing.T)
- func TestNewAvailabilityView(t *testing.T)
- func TestPageStack(t *testing.T)
- func TestPageStack_HasPage(t *testing.T)
- func TestPageStack_PushPop(t *testing.T)
- func TestPageStack_SwitchTo(t *testing.T)
- func TestParseColor(t *testing.T)
- func TestParseInt(t *testing.T)
- func TestParseRecipients(t *testing.T)
- func TestStyles_DefaultStyles(t *testing.T)
- func TestTable(t *testing.T)
- func TestTableSelection(t *testing.T)
- func TestTable_GetRowCount(t *testing.T)
- func TestTable_SelectedMeta(t *testing.T)
- func TestTable_SetData(t *testing.T)
- func TestThemeConfigToStyles(t *testing.T)
- func TestThemeLoadError(t *testing.T)
- func TestValidateTheme(t *testing.T)
- func TestValidateTheme_NonExistent(t *testing.T)
- func TestViewInterfaces(t *testing.T)
- func TestViewsEscapeKeyHandling(t *testing.T)
- func TestWebhooksView(t *testing.T)
- type App
- func (a *App) CanSwitchGrant() bool
- func (a *App) DeleteContact(contact *domain.Contact, onDelete func())
- func (a *App) DeleteEvent(calendarID string, event *domain.Event, onDelete func())
- func (a *App) DeleteWebhook(webhook *domain.Webhook, onDelete func())
- func (a *App) Flash(level FlashLevel, msg string, args ...any)
- func (a *App) GetConfig() Config
- func (a *App) PopDetail()
- func (a *App) PushDetail(name string, view tview.Primitive)
- func (a *App) Run() error
- func (a *App) ShowConfirmDialog(title, message string, onConfirm func())
- func (a *App) ShowContactForm(contact *domain.Contact, onSave func(*domain.Contact))
- func (a *App) ShowErrorDialog(title, message string)
- func (a *App) ShowEventForm(calendarID string, event *domain.Event, onSave func(*domain.Event))
- func (a *App) ShowForm(title string, fields []FormField, onSubmit func(map[string]string))
- func (a *App) ShowInfoDialog(title, message string)
- func (a *App) ShowWebhookForm(webhook *domain.Webhook, onSave func(*domain.Webhook))
- func (a *App) Stop()
- func (a *App) Styles() *Styles
- func (a *App) SwitchGrant(grantID, email, provider string) error
- type AttachmentInfo
- type AvailabilityView
- func (v *AvailabilityView) Filter(string)
- func (v *AvailabilityView) HandleKey(event *tcell.EventKey) *tcell.EventKey
- func (v *AvailabilityView) Hints() []Hint
- func (v *AvailabilityView) Load()
- func (v *AvailabilityView) Name() string
- func (v *AvailabilityView) Primitive() tview.Primitive
- func (v *AvailabilityView) Refresh()
- func (v *AvailabilityView) Title() string
- type BaseTableView
- type BodyStyle
- type BorderStyle
- type CalendarView
- func (c *CalendarView) Draw(screen tcell.Screen)
- func (c *CalendarView) Focus(delegate func(p tview.Primitive))
- func (c *CalendarView) GetCalendars() []domain.Calendar
- func (c *CalendarView) GetCurrentCalendar() *domain.Calendar
- func (c *CalendarView) GetCurrentCalendarID() string
- func (c *CalendarView) GetEventsForDate(date time.Time) []domain.Event
- func (c *CalendarView) GetSelectedDate() time.Time
- func (c *CalendarView) GoToToday()
- func (c *CalendarView) HasFocus() bool
- func (c *CalendarView) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (c *CalendarView) MouseHandler() ...
- func (c *CalendarView) NextCalendar()
- func (c *CalendarView) NextMonth()
- func (c *CalendarView) NextWeek()
- func (c *CalendarView) PrevCalendar()
- func (c *CalendarView) PrevMonth()
- func (c *CalendarView) PrevWeek()
- func (c *CalendarView) SetCalendarByIndex(index int)
- func (c *CalendarView) SetCalendars(calendars []domain.Calendar)
- func (c *CalendarView) SetEvents(events []domain.Event)
- func (c *CalendarView) SetOnCalendarChange(handler func(string))
- func (c *CalendarView) SetOnDateSelect(handler func(time.Time))
- func (c *CalendarView) SetOnEventSelect(handler func(*domain.Event))
- func (c *CalendarView) SetViewMode(mode CalendarViewMode)
- func (c *CalendarView) ToggleViewMode()
- type CalendarViewMode
- type CategoryGroup
- type ColorCache
- type Column
- type Command
- type CommandCategory
- type CommandPalette
- type CommandRegistry
- func (r *CommandRegistry) Get(name string) *Command
- func (r *CommandRegistry) GetAll() []Command
- func (r *CommandRegistry) GetByCategory() []CategoryGroup
- func (r *CommandRegistry) GetSubCommands(parent string) []Command
- func (r *CommandRegistry) HasSubCommands(name string) bool
- func (r *CommandRegistry) Register(cmd Command)
- func (r *CommandRegistry) Search(query string) []Command
- func (r *CommandRegistry) SearchSubCommands(parent, query string) []Command
- type ComposeMode
- type ComposeView
- type Config
- type ContactForm
- type ContactFormMode
- type ContactsView
- type Crumbs
- type CrumbsStyle
- type DashboardView
- func (v *DashboardView) Filter(string)
- func (v *DashboardView) HandleKey(event *tcell.EventKey) *tcell.EventKey
- func (v *DashboardView) Hints() []Hint
- func (v *DashboardView) Load()
- func (v *DashboardView) Name() string
- func (v *DashboardView) Primitive() tview.Primitive
- func (v *DashboardView) Refresh()
- func (v *DashboardView) Title() string
- type DetailViewConfig
- type Dialog
- type DialogType
- type DraftsView
- type EventForm
- type EventFormMode
- type EventsView
- func (v *EventsView) Filter(string)
- func (v *EventsView) HandleKey(event *tcell.EventKey) *tcell.EventKey
- func (v *EventsView) Hints() []Hint
- func (v *EventsView) Load()
- func (v *EventsView) Name() string
- func (v *EventsView) Primitive() tview.Primitive
- func (v *EventsView) Refresh()
- func (v *EventsView) Title() string
- type FieldType
- type FlashLevel
- type FolderPanel
- func (p *FolderPanel) Focus(delegate func(p tview.Primitive))
- func (p *FolderPanel) GetFolderBySystemName(systemName string) *domain.Folder
- func (p *FolderPanel) GetSelectedFolder() *domain.Folder
- func (p *FolderPanel) Hide()
- func (p *FolderPanel) IsVisible() bool
- func (p *FolderPanel) Load()
- func (p *FolderPanel) SetSelectedFolder(folderID string)
- func (p *FolderPanel) Show()
- func (p *FolderPanel) Toggle()
- type Form
- type FormField
- type FrameStyle
- type GrantsView
- type HelpView
- type Hint
- type InboundView
- func (v *InboundView) Filter(string)
- func (v *InboundView) HandleKey(event *tcell.EventKey) *tcell.EventKey
- func (v *InboundView) Hints() []Hint
- func (v *InboundView) Load()
- func (v *InboundView) Name() string
- func (v *InboundView) Primitive() tview.Primitive
- func (v *InboundView) Refresh()
- func (v *InboundView) Title() string
- type InfoStyle
- type K9sSkin
- type ListViewConfig
- type Logo
- type Menu
- type MenuStyle
- type MessagesView
- type PageStack
- type Prompt
- type PromptMode
- type PromptStyle
- type ResourceView
- type RowMeta
- type SearchQuery
- type Stack
- type StatusIndicator
- type StatusStyle
- type Styles
- func AmberStyles() *Styles
- func AppleIIStyles() *Styles
- func DefaultStyles() *Styles
- func FuturisticStyles() *Styles
- func GetThemeStyles(theme ThemeName) *Styles
- func GetThemeStylesWithError(theme ThemeName) (*Styles, error)
- func GreenStyles() *Styles
- func IBMDOSStyles() *Styles
- func LoadCustomTheme(name string) (*Styles, error)
- func MatrixStyles() *Styles
- func NortonStyles() *Styles
- func VintageStyles() *Styles
- type Table
- func (t *Table) GetRowCount() int
- func (t *Table) GetSelectedRow() int
- func (t *Table) MouseHandler() ...
- func (t *Table) SelectedMeta() *RowMeta
- func (t *Table) SetColumns(cols []Column)
- func (t *Table) SetData(data [][]string, meta []RowMeta)
- func (t *Table) SetOnDoubleClick(handler func(*RowMeta))
- func (t *Table) SetOnSelect(handler func(*RowMeta))
- type TableHeaderStyle
- type TableSelectedStyle
- type TableStyle
- type ThemeConfig
- type ThemeLoadError
- type ThemeName
- type ThemeValidationResult
- type TitleStyle
- type ViewsStyle
- type WebhookForm
- type WebhookFormMode
- type WebhookServerView
- func (v *WebhookServerView) Filter(string)
- func (v *WebhookServerView) HandleKey(event *tcell.EventKey) *tcell.EventKey
- func (v *WebhookServerView) Hints() []Hint
- func (v *WebhookServerView) Load()
- func (v *WebhookServerView) Name() string
- func (v *WebhookServerView) Primitive() tview.Primitive
- func (v *WebhookServerView) Refresh()
- func (v *WebhookServerView) Title() string
- type WebhooksView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDefaultThemeFile ¶
CreateDefaultThemeFile creates a default theme file at the specified path.
func GetSearchHints ¶
func GetSearchHints() string
GetSearchHints returns hints about available search operators.
func IsBuiltInTheme ¶
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 ¶
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 ¶
TestAllBuiltInThemesHaveRequiredColors verifies all themes have necessary colors set
func TestAppGetConfig ¶
func TestAppStyles ¶
func TestApp_Flash ¶
func TestApp_GetCurrentView ¶
func TestApp_GoBack ¶
func TestApp_NavigateView ¶
func TestApp_PageNavigation ¶
func TestApp_PopDetail ¶
func TestApp_SetFocus ¶
func TestApp_Styles ¶
func TestAvailableThemes ¶
func TestCalendarView_Focus ¶
func TestCommandRegistry ¶
func TestComposeView ¶
func TestContactsView ¶
func TestConvertToHTML ¶
func TestCreateView ¶
func TestCustomThemeViaGetThemeStyles ¶
TestCustomThemeViaGetThemeStyles tests that GetThemeStyles correctly loads custom themes
func TestDashboardView ¶
func TestDefaultStyles ¶
func TestDraftsView ¶
func TestEventsViewEscapeWithFocusedPanels ¶
TestEventsViewEscapeWithFocusedPanels tests that Escape works regardless of which panel has focus.
func TestEventsViewKeys ¶
func TestFormatDate ¶
func TestFormatParticipants ¶
func TestGetThemeStyles ¶
func TestGetThemeStylesLoadsCustomTheme ¶
TestGetThemeStylesLoadsCustomTheme verifies GetThemeStyles loads themes from ~/.config/nylas/themes/
func TestGetThemeStylesWithCustomTheme ¶
TestGetThemeStylesWithCustomTheme tests that GetThemeStyles falls back to custom themes
func TestGetThemeStylesWithError ¶
TestGetThemeStylesWithError tests the new error-returning function
func TestGetThemesDir ¶
func TestGrantsViewSwitching ¶
TestGrantsViewSwitching tests grant switching functionality.
func TestHelpView ¶
func TestIsBuiltInTheme ¶
TestIsBuiltInTheme tests the built-in theme checker
func TestIsNumeric ¶
func TestIsValidColorValue ¶
TestIsValidColorValue tests color validation
func TestListCustomThemes ¶
func TestLoadCustomThemeFromConfigDir ¶
TestLoadCustomThemeFromConfigDir tests loading from the actual config directory
func TestLoadCustomThemeWithExtension ¶
TestLoadCustomThemeWithExtension tests error when user includes .yaml extension
func TestMessagesViewKeys ¶
func TestNewApp ¶
func TestNewAppWithThemes ¶
func TestNewAvailabilityView ¶
func TestPageStack ¶
func TestPageStack_HasPage ¶
func TestPageStack_PushPop ¶
func TestPageStack_SwitchTo ¶
func TestParseColor ¶
func TestParseInt ¶
func TestParseRecipients ¶
func TestTableSelection ¶
func TestTable_GetRowCount ¶
func TestTable_SelectedMeta ¶
func TestTable_SetData ¶
func TestThemeConfigToStyles ¶
func TestThemeLoadError ¶
TestThemeLoadError tests the custom error type
func TestValidateTheme ¶
TestValidateTheme tests the validation function
func TestValidateTheme_NonExistent ¶
TestValidateTheme_NonExistent tests validation of non-existent theme
func TestViewInterfaces ¶
TestViewInterfaces verifies all views implement ResourceView interface
func TestViewsEscapeKeyHandling ¶
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 ¶
Types ¶
type App ¶
type App struct {
*tview.Application
// contains filtered or unexported fields
}
App is the main TUI application using tview (like k9s).
func (*App) CanSwitchGrant ¶
CanSwitchGrant returns true if grant switching is available.
func (*App) DeleteContact ¶
DeleteContact shows a confirmation dialog and deletes a contact.
func (*App) DeleteEvent ¶
DeleteEvent shows a confirmation dialog and deletes an event.
func (*App) DeleteWebhook ¶
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) PushDetail ¶
PushDetail pushes a detail view onto the stack (for message detail, etc.)
func (*App) ShowConfirmDialog ¶
ShowConfirmDialog displays a confirm dialog and returns.
func (*App) ShowContactForm ¶
ShowContactForm displays a contact form for create/edit.
func (*App) ShowErrorDialog ¶
ShowErrorDialog displays an error dialog.
func (*App) ShowEventForm ¶
ShowEventForm displays an event form for create/edit.
func (*App) ShowInfoDialog ¶
ShowInfoDialog displays an info dialog.
func (*App) ShowWebhookForm ¶
ShowWebhookForm displays a webhook form for create/edit.
func (*App) SwitchGrant ¶
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 ¶
BorderStyle for borders.
type CalendarView ¶
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) 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) 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) DisplayAliases ¶
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 ( CategoryMessages CommandCategory = "Messages" CategoryCalendar CommandCategory = "Calendar" CategoryContacts CommandCategory = "Contacts" CategoryWebhooks CommandCategory = "Webhooks" CategoryFolders CommandCategory = "Folders" CategoryVim CommandCategory = "Vim Commands" CategorySystem CommandCategory = "System" )
type CommandPalette ¶
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) 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.
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 ¶
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 ¶
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 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 ¶
Dialog displays a modal dialog for confirmations or messages.
func NewConfirmDialog ¶
NewConfirmDialog creates a confirmation dialog with Yes/No buttons.
func NewErrorDialog ¶
NewErrorDialog creates an error dialog with OK button.
func NewInfoDialog ¶
NewInfoDialog creates an informational dialog with OK button.
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 ¶
EventForm provides a form for creating/editing events.
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 FlashLevel ¶
type FlashLevel int
FlashLevel represents the severity of a flash message.
const ( FlashInfo FlashLevel = iota FlashWarn FlashError )
type FolderPanel ¶
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) IsVisible ¶
func (p *FolderPanel) IsVisible() bool
IsVisible returns whether the panel is visible.
func (*FolderPanel) SetSelectedFolder ¶
func (p *FolderPanel) SetSelectedFolder(folderID string)
SetSelectedFolder sets the currently selected folder by ID.
func (*FolderPanel) Toggle ¶
func (p *FolderPanel) Toggle()
Toggle toggles the visibility of the folder panel.
type Form ¶
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.
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 ¶
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.
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 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 MenuStyle ¶
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 ¶
PageStack combines tview.Pages with a navigation stack (like k9s).
type Prompt ¶
type Prompt struct {
*tview.InputField
// contains filtered or unexported fields
}
Prompt handles command/filter input like k9s.
func (*Prompt) Activate ¶
func (p *Prompt) Activate(mode PromptMode)
Activate activates the prompt in the given mode.
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 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:
- from:email@example.com
- to:email@example.com
- subject:keyword
- has:attachment
- is:unread / is:read
- is:starred
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).
type StatusIndicator ¶
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 ¶
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 ¶
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 ¶
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
type Table ¶
Table wraps tview.Table with k9s-style functionality.
func (*Table) GetRowCount ¶
GetRowCount returns the number of data rows.
func (*Table) GetSelectedRow ¶
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 ¶
SelectedMeta returns the metadata for the selected row.
func (*Table) SetColumns ¶
SetColumns sets the column definitions.
func (*Table) SetOnDoubleClick ¶
SetOnDoubleClick sets the callback for double-click on a row.
func (*Table) SetOnSelect ¶
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 ¶
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 ¶
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 ¶
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()
Source Files
¶
- app_base.go
- app_commands.go
- app_control.go
- app_init.go
- app_test_app.go
- app_test_methods.go
- app_test_pagestack.go
- app_test_table.go
- app_test_views_basic.go
- app_test_views_keys.go
- app_test_views_specific.go
- app_ui.go
- availability_actions.go
- availability_base.go
- availability_test_advanced.go
- availability_test_basic.go
- availability_ui.go
- calendar.go
- calendar_draw.go
- calendar_draw_month.go
- calendar_draw_week.go
- calendar_handlers.go
- command_palette.go
- commands.go
- commands_definitions.go
- compose.go
- compose_actions.go
- contact_form.go
- crumbs.go
- dialog.go
- drafts.go
- event_form.go
- folder_panel.go
- form.go
- help.go
- logo.go
- menu.go
- prompt.go
- search.go
- stack.go
- status.go
- styles_core.go
- styles_themes.go
- table.go
- theme_config_helpers.go
- theme_config_load.go
- theme_config_types.go
- theme_test_helpers.go
- theme_test_integration.go
- theme_test_loading.go
- views_base.go
- views_contacts.go
- views_dashboard.go
- views_events.go
- views_events_detail.go
- views_events_recurring.go
- views_grants.go
- views_helpers.go
- views_inbound.go
- views_messages.go
- views_messages_actions.go
- views_messages_detail.go
- views_webhooks.go
- webhook_form.go
- webhook_server.go