Documentation
¶
Index ¶
- Constants
- Variables
- func GetStatusColor(status string) lipgloss.Color
- func StatusBadgeStyle(status string) lipgloss.Style
- type App
- type DetailView
- type FormField
- type FormView
- func (f *FormView) FocusedField() FormField
- func (f *FormView) FocusedInput() textinput.Model
- func (f *FormView) GetApplication() model.Application
- func (f *FormView) HandleKey(msg tea.KeyMsg) (handled bool, action string)
- func (f *FormView) Reset()
- func (f *FormView) SetApplication(app *model.Application)
- func (f *FormView) SetSize(width, height int)
- func (f *FormView) UpdateInput(msg textinput.Model)
- func (f *FormView) Validate() bool
- func (f *FormView) View() string
- type KeyMap
- type ListView
- func (l *ListView) FilterStatus() string
- func (l *ListView) HandleKey(msg tea.KeyMsg) (handled bool, action string)
- func (l *ListView) IsSearchMode() bool
- func (l *ListView) MoveDown()
- func (l *ListView) MoveUp()
- func (l *ListView) SearchInput() textinput.Model
- func (l *ListView) SearchQuery() string
- func (l *ListView) SelectedApplication() *model.Application
- func (l *ListView) SetApplications(apps []model.Application)
- func (l *ListView) SetFilterStatus(status string)
- func (l *ListView) SetSize(width, height int)
- func (l *ListView) UpdateSearchInput(msg textinput.Model)
- func (l *ListView) View() string
- type ViewState
Constants ¶
const ( MaxContentWidth = 100 MinContentWidth = 60 )
Layout constants
Variables ¶
var ( // Title style for headers TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(colorPrimary). MarginBottom(1) // Subtle text style SubtleStyle = lipgloss.NewStyle(). Foreground(colorMuted) // Highlight style for selected items HighlightStyle = lipgloss.NewStyle(). Foreground(colorHighlight). Bold(true) // Error style ErrorStyle = lipgloss.NewStyle(). Foreground(colorDanger) // Success style SuccessStyle = lipgloss.NewStyle(). Foreground(colorSuccess) // Warning style WarningStyle = lipgloss.NewStyle(). Foreground(colorWarning) )
Common styles
var ( // Selected row style SelectedRowStyle = lipgloss.NewStyle(). Background(colorBgAlt). Foreground(colorHighlight). Bold(true) // Normal row style NormalRowStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#CCCCCC")) // Header style for tables HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(colorPrimary). BorderStyle(lipgloss.NormalBorder()). BorderBottom(true). BorderForeground(colorSecondary) )
List view styles
var ( // Label style for field names LabelStyle = lipgloss.NewStyle(). Foreground(colorSecondary). Width(15) // Value style for field values ValueStyle = lipgloss.NewStyle(). Foreground(colorHighlight) // Section header style SectionStyle = lipgloss.NewStyle(). Foreground(colorPrimary). Bold(true). MarginTop(1). MarginBottom(1). BorderStyle(lipgloss.NormalBorder()). BorderBottom(true). BorderForeground(colorSecondary) // Box style for detail panels BoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(colorSecondary). Padding(1, 2) )
Detail view styles
var ( // Focused input style FocusedInputStyle = lipgloss.NewStyle(). Foreground(colorPrimary). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(colorPrimary) // Blurred input style BlurredInputStyle = lipgloss.NewStyle(). Foreground(colorMuted). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(colorMuted) // Button style ButtonStyle = lipgloss.NewStyle(). Foreground(colorHighlight). Background(colorPrimary). Padding(0, 2). MarginRight(1) // Disabled button style DisabledButtonStyle = lipgloss.NewStyle(). Foreground(colorMuted). Background(colorBgAlt). Padding(0, 2). MarginRight(1) )
Form styles
var ( HelpKeyStyle = lipgloss.NewStyle(). Foreground(colorPrimary). Bold(true) HelpDescStyle = lipgloss.NewStyle(). Foreground(colorMuted) HelpSepStyle = lipgloss.NewStyle(). Foreground(colorSecondary) )
Help styles
var StatusBarStyle = lipgloss.NewStyle().
Foreground(colorMuted).
Background(colorBgAlt).
Padding(0, 1)
Status bar style
Functions ¶
func GetStatusColor ¶
GetStatusColor returns the color for a given status
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main Bubble Tea model
type DetailView ¶
type DetailView struct {
// contains filtered or unexported fields
}
DetailView displays a single job application's details
func NewDetailView ¶
func NewDetailView(app *model.Application, keys KeyMap) DetailView
NewDetailView creates a new detail view
func (*DetailView) HandleKey ¶
func (d *DetailView) HandleKey(msg tea.KeyMsg) (handled bool, action string)
HandleKey processes a key press and returns the action
func (*DetailView) SetApplication ¶
func (d *DetailView) SetApplication(app *model.Application)
SetApplication sets the application to display
func (*DetailView) SetSize ¶
func (d *DetailView) SetSize(width, height int)
SetSize sets the view dimensions
type FormView ¶
type FormView struct {
// contains filtered or unexported fields
}
FormView handles adding and editing applications
func NewFormView ¶
NewFormView creates a new form for adding/editing applications
func (*FormView) FocusedField ¶
FocusedField returns the currently focused field type
func (*FormView) FocusedInput ¶
FocusedInput returns the currently focused input
func (*FormView) GetApplication ¶
func (f *FormView) GetApplication() model.Application
GetApplication returns the application from form data
func (*FormView) SetApplication ¶
func (f *FormView) SetApplication(app *model.Application)
SetApplication populates the form for editing
func (*FormView) UpdateInput ¶
UpdateInput updates the focused input
type KeyMap ¶
type KeyMap struct {
// Navigation
Up key.Binding
Down key.Binding
Left key.Binding
Right key.Binding
Top key.Binding
Bottom key.Binding
// Actions
Add key.Binding
Edit key.Binding
Delete key.Binding
Enter key.Binding
Back key.Binding
// Status shortcuts
Status1 key.Binding
Status2 key.Binding
Status3 key.Binding
Status4 key.Binding
Status5 key.Binding
Status6 key.Binding
Status7 key.Binding
Status8 key.Binding
// Search and filter
Search key.Binding
Filter key.Binding
Clear key.Binding
// General
Help key.Binding
Quit key.Binding
Tab key.Binding
// Form specific
Submit key.Binding
Cancel key.Binding
}
KeyMap defines all keybindings for the application
type ListView ¶
type ListView struct {
// contains filtered or unexported fields
}
ListView displays a list of job applications
func NewListView ¶
func NewListView(apps []model.Application, keys KeyMap) ListView
NewListView creates a new list view
func (*ListView) FilterStatus ¶
FilterStatus returns the current filter status
func (*ListView) IsSearchMode ¶
IsSearchMode returns true if in search mode
func (*ListView) SearchInput ¶
SearchInput returns the search input model
func (*ListView) SearchQuery ¶
SearchQuery returns the current search query
func (*ListView) SelectedApplication ¶
func (l *ListView) SelectedApplication() *model.Application
SelectedApplication returns the currently selected application
func (*ListView) SetApplications ¶
func (l *ListView) SetApplications(apps []model.Application)
SetApplications updates the applications list
func (*ListView) SetFilterStatus ¶
SetFilterStatus sets the filter status
func (*ListView) UpdateSearchInput ¶
UpdateSearchInput updates the search input