ui

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EaseLinear = func(t float64) float64 { return t }
	EaseInOut  = func(t float64) float64 { return t * t * (3.0 - 2.0*t) }
	EaseIn     = func(t float64) float64 { return t * t }
	EaseOut    = func(t float64) float64 { return 1.0 - (1.0-t)*(1.0-t) }
)

Common easing functions

View Source
var FeatureTips = map[string]struct {
	Title       string
	Description string
	Shortcut    string
}{
	"filter.basic": {
		Title:       "Filter Notifications",
		Description: "You can filter notifications by repository, type, and more.",
		Shortcut:    "f",
	},
	"filter.complex": {
		Title:       "Advanced Filtering",
		Description: "Use complex filter expressions with AND, OR, NOT operators.",
		Shortcut:    "f",
	},
	"filter.save": {
		Title:       "Save Filters",
		Description: "Save filters for later use with the @name syntax.",
		Shortcut:    "Ctrl+S",
	},
	"group.basic": {
		Title:       "Group Notifications",
		Description: "Group notifications by repository, type, or other criteria.",
		Shortcut:    "g",
	},
	"group.smart": {
		Title:       "Smart Grouping",
		Description: "Use smart grouping to automatically organize related notifications.",
		Shortcut:    "g then s",
	},
	"search.basic": {
		Title:       "Search Notifications",
		Description: "Search across all notification content.",
		Shortcut:    "/",
	},
	"search.regex": {
		Title:       "Regex Search",
		Description: "Use regular expressions for more powerful searches.",
		Shortcut:    "/ then Alt+R",
	},
	"watch.basic": {
		Title:       "Watch Notifications",
		Description: "Watch for new notifications in real-time.",
		Shortcut:    "w",
	},
	"watch.desktop": {
		Title:       "Desktop Notifications",
		Description: "Get desktop notifications for new items.",
		Shortcut:    "w then d",
	},
	"ui.keyboard": {
		Title:       "Keyboard Shortcuts",
		Description: "Use keyboard shortcuts for faster navigation.",
		Shortcut:    "?",
	},
	"ui.batch": {
		Title:       "Batch Actions",
		Description: "Select multiple notifications with Space and perform batch actions.",
		Shortcut:    "Space",
	},
	"ui.views": {
		Title:       "View Modes",
		Description: "Switch between different view modes for notifications.",
		Shortcut:    "1-4",
	},
	"actions.read": {
		Title:       "Mark as Read",
		Description: "Mark notifications as read to keep track of what you've seen.",
		Shortcut:    "r",
	},
	"actions.open": {
		Title:       "Open in Browser",
		Description: "Open notifications in your browser to view details.",
		Shortcut:    "o",
	},
	"actions.archive": {
		Title:       "Archive Notifications",
		Description: "Archive notifications to keep your list clean.",
		Shortcut:    "a",
	},
	"actions.subscribe": {
		Title:       "Subscribe to Threads",
		Description: "Subscribe to notification threads to stay updated.",
		Shortcut:    "s",
	},
	"actions.undo": {
		Title:       "Undo Actions",
		Description: "Undo your last action if you make a mistake.",
		Shortcut:    "Ctrl+Z",
	},
	"config.basic": {
		Title:       "Configuration",
		Description: "Configure gh-notif to suit your preferences.",
		Shortcut:    "F2",
	},
	"tutorial.basic": {
		Title:       "Interactive Tutorial",
		Description: "Learn how to use gh-notif with the interactive tutorial.",
		Shortcut:    "F1",
	},
	"help.contextual": {
		Title:       "Contextual Help",
		Description: "Get context-specific help for the current view.",
		Shortcut:    "?",
	},
}

FeatureTips contains all feature tips

Functions

func CreateGradientText

func CreateGradientText(text string, colors []lipgloss.Color) string

CreateGradientText creates text with a gradient effect

func CreateProgressBar

func CreateProgressBar(width int, progress float64, theme EnhancedTheme) string

CreateProgressBar creates an enhanced progress bar

func CreatePulseText

func CreatePulseText(text string, colors []lipgloss.Color, frame int) string

CreatePulseText creates pulsing text animation

func CreateShimmerText

func CreateShimmerText(text string, colors []lipgloss.Color, frame int) string

CreateShimmerText creates shimmering text animation

func CreateTableView

func CreateTableView(notifications []*github.Notification, width, height int) table.Model

CreateTableView creates a table view for notifications

func CreateTipModels

func CreateTipModels(manager *discovery.DiscoveryManager) map[string]TipModel

CreateTipModels creates tip models for all feature tips

func DetectTerminalCapabilities

func DetectTerminalCapabilities() (trueColor, color256, basic bool)

DetectTerminalCapabilities detects terminal color capabilities

func DisplayActionUI

func DisplayActionUI(notifications []*github.Notification) error

DisplayActionUI displays the action UI

func DisplayEnhancedNotifications

func DisplayEnhancedNotifications(notifications []*github.Notification) error

DisplayEnhancedNotifications displays notifications using the enhanced UI

func DisplayNotifications

func DisplayNotifications(notifications []*github.Notification) error

DisplayNotifications shows the notifications in a terminal UI

func DisplayNotificationsWithOptions

func DisplayNotificationsWithOptions(notifications []*github.Notification, options DisplayOptions) error

DisplayNotificationsWithOptions shows notifications with custom options

func GenerateAccessibleHelp

func GenerateAccessibleHelp(settings AccessibilitySettings) string

GenerateAccessibleHelp generates help text appropriate for the given accessibility settings

func GenerateAccessibleStatusBar

func GenerateAccessibleStatusBar(model Model, settings AccessibilitySettings) string

GenerateAccessibleStatusBar generates a status bar appropriate for the given accessibility settings

func OpenNotificationInBrowser

func OpenNotificationInBrowser(notification *github.Notification) error

OpenNotificationInBrowser opens a notification in the browser

func RunApp

func RunApp(ctx context.Context, client *githubclient.Client) error

RunApp runs the main application UI

func RunGroupUI

func RunGroupUI(ctx context.Context, client *githubclient.Client, notifications []*github.Notification, groupBy, secondaryGroupBy string) error

RunGroupUI runs the group UI

func RunSearchUI

func RunSearchUI(ctx context.Context, client *githubclient.Client, notifications []*github.Notification, initialQuery string) error

RunSearchUI runs the search UI

func RunWatchUI

func RunWatchUI(ctx context.Context, client *githubclient.Client, watcher *watch.Watcher) error

RunWatchUI runs the watch UI

func ScreenReaderDescription

func ScreenReaderDescription(notification *github.Notification) string

ScreenReaderDescription generates a screen reader friendly description of a notification

Types

type AccessibilityMode

type AccessibilityMode int

AccessibilityMode represents different accessibility modes

const (
	// StandardMode is the default mode
	StandardMode AccessibilityMode = iota
	// ScreenReaderMode is optimized for screen readers
	ScreenReaderMode
	// HighContrastMode uses high contrast colors
	HighContrastMode
	// LargeTextMode uses larger text
	LargeTextMode
)

type AccessibilitySettings

type AccessibilitySettings struct {
	Mode            AccessibilityMode
	ColorScheme     ColorScheme
	UseUnicode      bool
	UseAnimations   bool
	KeyboardOnly    bool
	DescriptiveText bool
}

AccessibilitySettings contains settings for accessibility

func DefaultAccessibilitySettings

func DefaultAccessibilitySettings() AccessibilitySettings

DefaultAccessibilitySettings returns the default accessibility settings

type ActionMode

type ActionMode int

ActionMode represents different action modes

const (
	// SelectMode is for selecting notifications
	SelectMode ActionMode = iota
	// ActionMenuMode is for choosing an action
	ActionMenuMode
	// ProgressMode is for showing progress
	ProgressMode
	// ResultMode is for showing results
	ResultMode
)

type ActionModel

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

ActionModel represents the action UI model

func NewActionModel

func NewActionModel(notifications []*github.Notification) ActionModel

NewActionModel creates a new action model

func (ActionModel) Init

func (m ActionModel) Init() tea.Cmd

Init initializes the model

func (ActionModel) Update

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

Update updates the model

func (ActionModel) View

func (m ActionModel) View() string

View renders the model

type AnimationState

type AnimationState struct {
	StartTime    time.Time
	Duration     time.Duration
	CurrentFrame int
	TotalFrames  int
	Easing       EasingFunction
}

AnimationState tracks animation state

type AnimationTickMsg

type AnimationTickMsg struct {
	Time time.Time
}

Animation messages

type BatchResultMsg

type BatchResultMsg struct {
	Result *common.BatchResult
}

BatchResultMsg is a message containing a batch result

type ColorScheme

type ColorScheme int

ColorScheme represents different color schemes

const (
	// DarkScheme is the default dark color scheme
	DarkScheme ColorScheme = iota
	// LightScheme is a light color scheme
	LightScheme
	// HighContrastScheme is a high contrast scheme for accessibility
	HighContrastScheme
)

type ColorSchemeMsg

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

ColorSchemeMsg changes the color scheme

type DisplayOptions

type DisplayOptions struct {
	InitialViewMode   ViewMode
	ColorScheme       ColorScheme
	AccessibilityMode AccessibilityMode
	UseUnicode        bool
	UseAnimations     bool
}

DisplayOptions contains options for customizing the notification display

func DefaultDisplayOptions

func DefaultDisplayOptions() DisplayOptions

DefaultDisplayOptions returns the default display options

type EasingFunction

type EasingFunction func(t float64) float64

EasingFunction defines animation easing

type EnhancedAccessibilitySettings

type EnhancedAccessibilitySettings struct {
	AccessibilitySettings

	// Screen reader support
	ScreenReaderMode    bool
	VerboseDescriptions bool
	AnnounceChanges     bool

	// Keyboard navigation
	TabNavigation      bool
	ArrowKeyNavigation bool
	VimKeyBindings     bool
	CustomKeyBindings  map[string]string

	// Visual accessibility
	HighContrastMode   bool
	LargeText          bool
	ReducedMotion      bool
	ColorBlindFriendly bool

	// Audio feedback
	SoundEffects  bool
	VoiceFeedback bool

	// Timing and interaction
	SlowAnimations   bool
	ExtendedTimeouts bool
	ConfirmActions   bool
}

EnhancedAccessibilitySettings extends accessibility settings with more options

func DefaultEnhancedAccessibilitySettings

func DefaultEnhancedAccessibilitySettings() EnhancedAccessibilitySettings

DefaultEnhancedAccessibilitySettings returns default enhanced accessibility settings

type EnhancedKeyMap

type EnhancedKeyMap struct {
	// Navigation
	Up       key.Binding
	Down     key.Binding
	Left     key.Binding
	Right    key.Binding
	PageUp   key.Binding
	PageDown key.Binding
	Home     key.Binding
	End      key.Binding

	// Actions
	Select        key.Binding
	MarkAsRead    key.Binding
	MarkAllAsRead key.Binding
	Archive       key.Binding
	Open          key.Binding

	// UI Controls
	ToggleView    key.Binding
	ToggleTheme   key.Binding
	ToggleCompact key.Binding
	ToggleFilter  key.Binding
	ToggleHelp    key.Binding
	Refresh       key.Binding

	// System
	Quit   key.Binding
	Cancel key.Binding
}

EnhancedKeyMap defines enhanced key bindings

func DefaultEnhancedKeyMap

func DefaultEnhancedKeyMap() EnhancedKeyMap

DefaultEnhancedKeyMap returns default enhanced key bindings

type EnhancedModel

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

EnhancedModel represents the enhanced UI model with modern components

func NewEnhancedModel

func NewEnhancedModel(notifications []*github.Notification) *EnhancedModel

NewEnhancedModel creates a new enhanced UI model

func (*EnhancedModel) Init

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

Init initializes the enhanced model

func (*EnhancedModel) Update

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

Update handles messages and updates the enhanced model

func (*EnhancedModel) View

func (m *EnhancedModel) View() string

View renders the enhanced model

type EnhancedStyles

type EnhancedStyles struct {
	Styles

	// Gradient styles
	HeaderGradient   lipgloss.Style
	AccentGradient   lipgloss.Style
	ProgressGradient lipgloss.Style

	// Animation styles
	Pulse   lipgloss.Style
	Shimmer lipgloss.Style
	Glow    lipgloss.Style

	// Badge styles
	BadgePrimary   lipgloss.Style
	BadgeSecondary lipgloss.Style
	BadgeSuccess   lipgloss.Style
	BadgeWarning   lipgloss.Style
	BadgeError     lipgloss.Style
	BadgeInfo      lipgloss.Style

	// Panel styles
	PanelPrimary   lipgloss.Style
	PanelSecondary lipgloss.Style
	PanelBordered  lipgloss.Style
	PanelElevated  lipgloss.Style

	// Interactive styles
	ButtonPrimary   lipgloss.Style
	ButtonSecondary lipgloss.Style
	ButtonDisabled  lipgloss.Style
	ButtonHover     lipgloss.Style
	ButtonPressed   lipgloss.Style

	// Form styles
	InputFocused lipgloss.Style
	InputError   lipgloss.Style
	InputSuccess lipgloss.Style
	Label        lipgloss.Style
	Placeholder  lipgloss.Style

	// Layout styles
	Container   lipgloss.Style
	Sidebar     lipgloss.Style
	MainContent lipgloss.Style
	Footer      lipgloss.Style
}

EnhancedStyles extends the basic styles with advanced effects

func NewEnhancedStyles

func NewEnhancedStyles(theme EnhancedTheme) EnhancedStyles

NewEnhancedStyles creates enhanced styles from a theme

type EnhancedTheme

type EnhancedTheme struct {
	Theme

	// Gradient colors
	PrimaryGradient   []lipgloss.Color
	SecondaryGradient []lipgloss.Color
	AccentGradient    []lipgloss.Color

	// Animation colors
	PulseColors   []lipgloss.Color
	ShimmerColors []lipgloss.Color

	// Special effects
	GlowColor   lipgloss.Color
	ShadowColor lipgloss.Color

	// Adaptive colors (based on terminal capabilities)
	SupportsTrue  bool
	Supports256   bool
	SupportsBasic bool
}

EnhancedTheme extends the basic theme with advanced styling capabilities

func AdaptThemeToTerminal

func AdaptThemeToTerminal(theme EnhancedTheme) EnhancedTheme

AdaptThemeToTerminal adapts a theme to terminal capabilities

func NewEnhancedDarkTheme

func NewEnhancedDarkTheme() EnhancedTheme

NewEnhancedDarkTheme creates an enhanced dark theme

func NewEnhancedLightTheme

func NewEnhancedLightTheme() EnhancedTheme

NewEnhancedLightTheme creates an enhanced light theme

type EnhancedViewMode

type EnhancedViewMode int

EnhancedViewMode represents different enhanced view modes

const (
	// EnhancedListView shows a virtualized list
	EnhancedListView EnhancedViewMode = iota
	// EnhancedDetailView shows detailed notification view
	EnhancedDetailView
	// EnhancedSplitView shows split layout
	EnhancedSplitView
	// EnhancedDashboardView shows dashboard with multiple panels
	EnhancedDashboardView
)

type ErrorMsg

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

ErrorMsg represents an error message

type FilterModel

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

FilterModel represents the filter input model

func NewFilterModel

func NewFilterModel(notifications []*github.Notification, styles Styles, onFilterChange func(string, []*github.Notification), onExit func()) FilterModel

NewFilterModel creates a new filter model

func (FilterModel) GetFilterString

func (m FilterModel) GetFilterString() string

GetFilterString returns the current filter string

func (FilterModel) GetFilteredItems

func (m FilterModel) GetFilteredItems() []*github.Notification

GetFilteredItems returns the filtered items

func (FilterModel) Init

func (m FilterModel) Init() tea.Cmd

Init initializes the filter model

func (FilterModel) IsActive

func (m FilterModel) IsActive() bool

IsActive returns whether the filter is active

func (FilterModel) Update

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

Update handles events for the filter model

func (FilterModel) View

func (m FilterModel) View() string

View renders the filter model

type FilterMsg

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

FilterMsg updates the filter string

type GroupModel

type GroupModel struct {
	// Client is the GitHub client
	Client *githubclient.Client
	// Context is the context for cancellation
	Context context.Context
	// CancelFunc is the function to cancel the context
	CancelFunc context.CancelFunc
	// GroupTable is the group table
	GroupTable table.Model
	// NotificationTable is the notification table
	NotificationTable table.Model
	// Spinner is the loading spinner
	Spinner spinner.Model
	// Width is the terminal width
	Width int
	// Height is the terminal height
	Height int
	// Notifications are all notifications
	Notifications []*github.Notification
	// Groups are the notification groups
	Groups []*grouping.Group
	// SelectedGroup is the currently selected group
	SelectedGroup *grouping.Group
	// SelectedSubgroup is the currently selected subgroup
	SelectedSubgroup *grouping.Group
	// Grouper is the notification grouper
	Grouper *grouping.Grouper
	// Styles are the UI styles
	Styles Styles
	// Error is the current error, if any
	Error error
	// Loading indicates whether the UI is loading
	Loading bool
	// Quitting indicates whether the UI is quitting
	Quitting bool
	// GroupBy is the primary grouping type
	GroupBy string
	// SecondaryGroupBy is the secondary grouping type
	SecondaryGroupBy string
	// GroupTableFocused indicates whether the group table is focused
	GroupTableFocused bool
}

GroupModel represents the group UI model

func NewGroupModel

func NewGroupModel(ctx context.Context, client *githubclient.Client, notifications []*github.Notification, groupBy, secondaryGroupBy string) GroupModel

NewGroupModel creates a new group UI model

func (GroupModel) Init

func (m GroupModel) Init() tea.Cmd

Init initializes the model

func (GroupModel) Update

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

Update updates the model

func (GroupModel) View

func (m GroupModel) View() string

View renders the model

type HelpKeyMap

type HelpKeyMap struct {
	Quit key.Binding
}

HelpKeyMap defines the keybindings for the help model

func NewHelpKeyMap

func NewHelpKeyMap() HelpKeyMap

NewHelpKeyMap creates a new key map for the help model

func (HelpKeyMap) FullHelp

func (k HelpKeyMap) FullHelp() [][]key.Binding

FullHelp returns keybindings for the expanded help view.

func (HelpKeyMap) ShortHelp

func (k HelpKeyMap) ShortHelp() []key.Binding

ShortHelp returns keybindings to be shown in the mini help view.

type HelpModel

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

HelpModel represents the help model

func NewHelpModel

func NewHelpModel(width, height int) HelpModel

NewHelpModel creates a new help model

func (*HelpModel) Hide

func (m *HelpModel) Hide()

Hide hides the help model

func (*HelpModel) IsVisible

func (m *HelpModel) IsVisible() bool

IsVisible returns whether the help model is visible

func (*HelpModel) SetContext

func (m *HelpModel) SetContext(context string)

SetContext sets the context for the help content

func (*HelpModel) SetSize

func (m *HelpModel) SetSize(width, height int)

SetSize sets the size of the help model

func (*HelpModel) Show

func (m *HelpModel) Show()

Show shows the help model

func (*HelpModel) Toggle

func (m *HelpModel) Toggle()

Toggle toggles the visibility of the help model

func (*HelpModel) Update

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

Update updates the help model

func (*HelpModel) View

func (m *HelpModel) View() string

View renders the help model

type LoadingMsg

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

LoadingMsg indicates loading state

type MarkAllAsReadMsg

type MarkAllAsReadMsg struct{}

MarkAllAsReadMsg marks all notifications as read

type MarkAsReadMsg

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

MarkAsReadMsg marks a notification as read

type MarkdownRenderer

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

MarkdownRenderer renders markdown text to styled terminal output

func NewMarkdownRenderer

func NewMarkdownRenderer(styles Styles, width int) *MarkdownRenderer

NewMarkdownRenderer creates a new markdown renderer

func (*MarkdownRenderer) Render

func (r *MarkdownRenderer) Render(markdown string) string

Render converts markdown text to styled terminal output

type Model

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

Model represents the main UI model

func NewModel

func NewModel(notifications []*github.Notification) Model

NewModel creates a new UI model

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) Update

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

Update handles UI events and updates the model

func (Model) View

func (m Model) View() string

View renders the UI

type ProgressUpdateMsg

type ProgressUpdateMsg struct {
	Completed int
	Total     int
	Errors    int
}

ProgressUpdateMsg is a message for updating progress

type RefreshCompleteMsg

type RefreshCompleteMsg struct{}

type RefreshMsg

type RefreshMsg struct{}

RefreshMsg refreshes the notifications

type SearchModel

type SearchModel struct {
	// Client is the GitHub client
	Client *githubclient.Client
	// Context is the context for cancellation
	Context context.Context
	// CancelFunc is the function to cancel the context
	CancelFunc context.CancelFunc
	// Table is the notification table
	Table table.Model
	// Spinner is the loading spinner
	Spinner spinner.Model
	// SearchInput is the search input field
	SearchInput textinput.Model
	// Width is the terminal width
	Width int
	// Height is the terminal height
	Height int
	// Notifications are all notifications
	Notifications []*github.Notification
	// Results are the search results
	Results []*search.SearchResult
	// Searcher is the notification searcher
	Searcher *search.Searcher
	// Styles are the UI styles
	Styles Styles
	// Error is the current error, if any
	Error error
	// Loading indicates whether the UI is loading
	Loading bool
	// Quitting indicates whether the UI is quitting
	Quitting bool
}

SearchModel represents the search UI model

func NewSearchModel

func NewSearchModel(ctx context.Context, client *githubclient.Client, notifications []*github.Notification, initialQuery string) SearchModel

NewSearchModel creates a new search UI model

func (SearchModel) Init

func (m SearchModel) Init() tea.Cmd

Init initializes the model

func (SearchModel) Update

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

Update updates the model

func (SearchModel) View

func (m SearchModel) View() string

View renders the model

type StatusBar

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

StatusBar represents the status bar at the bottom of the UI

func NewStatusBar

func NewStatusBar(text string) StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) SetStyle

func (s *StatusBar) SetStyle(style lipgloss.Style)

SetStyle sets the style of the status bar

func (*StatusBar) SetText

func (s *StatusBar) SetText(text string)

SetText sets the text of the status bar

func (StatusBar) View

func (s StatusBar) View() string

View renders the status bar

type Styles

type Styles struct {
	// Base styles
	App             lipgloss.Style
	Header          lipgloss.Style
	StatusBar       lipgloss.Style
	HelpBar         lipgloss.Style
	Spinner         lipgloss.Style
	Error           lipgloss.Style
	FilterPrompt    lipgloss.Style
	FilterInput     lipgloss.Style
	NoNotifications lipgloss.Style

	// List styles
	List         lipgloss.Style
	ListItem     lipgloss.Style
	SelectedItem lipgloss.Style
	UnreadItem   lipgloss.Style
	ReadItem     lipgloss.Style

	// Detail view styles
	DetailView   lipgloss.Style
	DetailHeader lipgloss.Style
	DetailBody   lipgloss.Style
	DetailFooter lipgloss.Style

	// Split view styles
	SplitLeft    lipgloss.Style
	SplitRight   lipgloss.Style
	SplitDivider lipgloss.Style

	// Table styles
	Table            lipgloss.Style
	TableHeader      lipgloss.Style
	TableCell        lipgloss.Style
	TableSelectedRow lipgloss.Style

	// Notification type styles
	Issue       lipgloss.Style
	PullRequest lipgloss.Style
	Release     lipgloss.Style
	Discussion  lipgloss.Style
	Commit      lipgloss.Style

	// Status indicators
	UnreadIndicator lipgloss.Style
	ReadIndicator   lipgloss.Style
}

Styles contains all the styles for the UI

func GetAccessibleStyles

func GetAccessibleStyles(settings AccessibilitySettings) Styles

GetAccessibleStyles returns styles appropriate for the given accessibility settings

func NewStyles

func NewStyles(theme Theme) Styles

NewStyles creates a new Styles instance based on the given theme

type Symbols

type Symbols struct {
	UnreadIndicator string
	ReadIndicator   string
	PullRequest     string
	Issue           string
	Release         string
	Discussion      string
	Commit          string
	Check           string
	Cross           string
	Warning         string
	Info            string
	ArrowRight      string
	ArrowLeft       string
	ArrowUp         string
	ArrowDown       string
	Ellipsis        string
	Star            string
	Dot             string
}

Symbols contains Unicode symbols used in the UI

func DefaultSymbols

func DefaultSymbols() Symbols

DefaultSymbols returns the default symbols

func GetAccessibleSymbols

func GetAccessibleSymbols(settings AccessibilitySettings) Symbols

GetAccessibleSymbols returns symbols appropriate for the given accessibility settings

type Theme

type Theme struct {
	// Base colors
	Background    lipgloss.Color
	Foreground    lipgloss.Color
	DimmedText    lipgloss.Color
	HighlightText lipgloss.Color
	AccentColor   lipgloss.Color
	ErrorColor    lipgloss.Color
	SuccessColor  lipgloss.Color
	WarningColor  lipgloss.Color
	InfoColor     lipgloss.Color

	// UI element colors
	BorderColor      lipgloss.Color
	SelectedBg       lipgloss.Color
	SelectedFg       lipgloss.Color
	HeaderColor      lipgloss.Color
	StatusBarColor   lipgloss.Color
	HelpTextColor    lipgloss.Color
	UnreadColor      lipgloss.Color
	ReadColor        lipgloss.Color
	FilterMatchColor lipgloss.Color

	// Notification type colors
	IssueColor       lipgloss.Color
	PullRequestColor lipgloss.Color
	ReleaseColor     lipgloss.Color
	DiscussionColor  lipgloss.Color
	CommitColor      lipgloss.Color
}

Theme defines the color palette for the UI

func DefaultDarkTheme

func DefaultDarkTheme() Theme

DefaultDarkTheme returns the default dark theme

func DefaultLightTheme

func DefaultLightTheme() Theme

DefaultLightTheme returns the default light theme

func GetAccessibleTheme

func GetAccessibleTheme(settings AccessibilitySettings) Theme

GetAccessibleTheme returns a theme appropriate for the given accessibility settings

func HighContrastTheme

func HighContrastTheme() Theme

HighContrastTheme returns a high contrast theme for accessibility

type TipModel

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

TipModel represents a feature tip

func NewTipModel

func NewTipModel(featureID, title, description, shortcut string, manager *discovery.DiscoveryManager) TipModel

NewTipModel creates a new tip model

func (*TipModel) Dismiss

func (m *TipModel) Dismiss()

Dismiss dismisses the tip

func (*TipModel) Hide

func (m *TipModel) Hide()

Hide hides the tip

func (*TipModel) IsVisible

func (m *TipModel) IsVisible() bool

IsVisible returns whether the tip is visible

func (*TipModel) SetSize

func (m *TipModel) SetSize(width, height int)

SetSize sets the size of the tip model

func (*TipModel) Show

func (m *TipModel) Show()

Show shows the tip

func (*TipModel) Update

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

Update updates the tip model

func (*TipModel) View

func (m *TipModel) View() string

View renders the tip model

type ViewMode

type ViewMode int

ViewMode represents different view modes for the notification UI

const (
	// CompactView shows a compact list of notifications
	CompactView ViewMode = iota
	// DetailedView shows detailed information for a single notification
	DetailedView
	// SplitView shows a list on the left and details on the right
	SplitView
	// TableView shows notifications in a table format
	TableView
)

type ViewModeMsg

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

ViewModeMsg changes the view mode

type WatchModel

type WatchModel struct {
	// Watcher is the notification watcher
	Watcher *watch.Watcher
	// Client is the GitHub client
	Client *githubclient.Client
	// Context is the context for cancellation
	Context context.Context
	// CancelFunc is the function to cancel the context
	CancelFunc context.CancelFunc
	// Table is the notification table
	Table table.Model
	// Spinner is the loading spinner
	Spinner spinner.Model
	// Width is the terminal width
	Width int
	// Height is the terminal height
	Height int
	// Stats are the watch statistics
	Stats watch.WatchStats
	// Notifications are the current notifications
	Notifications []*github.Notification
	// Events are the recent notification events
	Events []watch.NotificationEvent
	// MaxEvents is the maximum number of events to keep
	MaxEvents int
	// Styles are the UI styles
	Styles Styles
	// Error is the current error, if any
	Error error
	// Loading indicates whether the UI is loading
	Loading bool
	// Quitting indicates whether the UI is quitting
	Quitting bool
}

WatchModel represents the watch UI model

func NewWatchModel

func NewWatchModel(ctx context.Context, client *githubclient.Client, watcher *watch.Watcher) WatchModel

NewWatchModel creates a new watch UI model

func (WatchModel) Init

func (m WatchModel) Init() tea.Cmd

Init initializes the model

func (WatchModel) Update

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

Update updates the model

func (WatchModel) View

func (m WatchModel) View() string

View renders the model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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