context

package
v4.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProgramContext

type ProgramContext struct {
	RepoPath          *string
	RepoUrl           *string
	User              string
	ScreenHeight      int
	ScreenWidth       int
	MainContentWidth  int
	MainContentHeight int
	Config            *config.Config
	ConfigPath        string
	View              config.ViewType
	Error             error
	StartTask         func(task Task) tea.Cmd
	Theme             theme.Theme
	Styles            Styles
}

func (*ProgramContext) GetViewSectionsConfig

func (ctx *ProgramContext) GetViewSectionsConfig() []config.SectionConfig

type State

type State = int
const (
	TaskStart State = iota
	TaskFinished
	TaskError
)

type Styles

type Styles struct {
	Colors struct {
		OpenIssue   lipgloss.AdaptiveColor
		ClosedIssue lipgloss.AdaptiveColor
		SuccessText lipgloss.AdaptiveColor
		OpenPR      lipgloss.AdaptiveColor
		ClosedPR    lipgloss.AdaptiveColor
		MergedPR    lipgloss.AdaptiveColor
	}

	Common common.CommonStyles

	PrSidebar struct {
		PillStyle lipgloss.Style
	}
	Help struct {
		Text         lipgloss.Style
		KeyText      lipgloss.Style
		BubbleStyles bbHelp.Styles
	}
	CommentBox struct {
		Text lipgloss.Style
	}
	Pager struct {
		Height int
		Root   lipgloss.Style
	}
	Section struct {
		ContainerPadding int
		ContainerStyle   lipgloss.Style
		SpinnerStyle     lipgloss.Style
		EmptyStateStyle  lipgloss.Style
		KeyStyle         lipgloss.Style
	}
	PrSection struct {
		CiCellWidth        int
		LinesCellWidth     int
		UpdatedAtCellWidth int
		PrRepoCellWidth    int
		PrAuthorCellWidth  int
	}
	Sidebar struct {
		BorderWidth    int
		PagerHeight    int
		ContentPadding int
		Root           lipgloss.Style
		PagerStyle     lipgloss.Style
	}
	ListViewPort struct {
		PagerStyle lipgloss.Style
	}
	Table struct {
		CellStyle                lipgloss.Style
		SelectedCellStyle        lipgloss.Style
		TitleCellStyle           lipgloss.Style
		SingleRuneTitleCellStyle lipgloss.Style
		HeaderStyle              lipgloss.Style
		RowStyle                 lipgloss.Style
	}
	Tabs struct {
		Tab            lipgloss.Style
		ActiveTab      lipgloss.Style
		TabSeparator   lipgloss.Style
		TabsRow        lipgloss.Style
		ViewSwitcher   lipgloss.Style
		ActiveView     lipgloss.Style
		ViewsSeparator lipgloss.Style
		InactiveView   lipgloss.Style
	}
}

func InitStyles

func InitStyles(theme theme.Theme) Styles

type Task

type Task struct {
	Id           string
	StartText    string
	FinishedText string
	State        State
	Error        error
	StartTime    time.Time
	FinishedTime *time.Time
}

Jump to

Keyboard shortcuts

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