Documentation
¶
Index ¶
- Variables
- func CmdOpenURL(url string) tea.Cmd
- func HintCancelScroll() string
- func HintChecklistConfirm() string
- func HintDismiss() string
- func HintDismissAndScroll() string
- func HintSubmitCancel() string
- func JoinStatus(parts ...string) string
- func MessageAborted(action string) string
- func MessageClosed(target string) string
- func MessageComplete(action string) string
- func MessageNoOutput() string
- func MessageOpening(target string) string
- func OverlayBottomCenter(bg, fg string, screenW, y int) string
- func OverlayBottomRight(bg, fg string, screenW int, screenH int) string
- func OverlayCenter(bg, fg string, screenW, screenH int) string
- func OverlayTopRight(bg, fg string, screenW int) string
- func PlaceOverlay(bg, fg string, x, y int) string
- func RelativeTimeCompact(t time.Time) string
- func RenderBadge(label string, variant BadgeVariant, nerd bool) string
- func RenderButton(label string, selected bool, nerd bool) string
- func RenderChordOverlay(prefix string, bindings []key.Binding) string
- func RenderFixedColumns(cols []FixedColumn) string
- func RenderInlineBindings(bindings ...key.Binding) string
- func RenderModalFrame(opts ModalFrameOptions) string
- func RenderPanelFrame(opts PanelFrameOptions) string
- func RenderRowHighlight(text string) string
- func StatusWithHints(message string, hints ...key.Binding) string
- type BadgeVariant
- type ChordHinter
- type CommandOutput
- type CommandOutputLog
- type CommandOutputRecorder
- type FixedColumn
- type IconSet
- type ModalFrameOptions
- type PanelFrameOptions
- type Terminal
Constants ¶
This section is empty.
Variables ¶
var ( ColorBase = lipgloss.Color("#1e1e2e") ColorDeepBg = lipgloss.Color("#11111a") ColorText = lipgloss.Color("#cdd6f4") ColorSubtle = lipgloss.Color("#a6adc8") ColorBlue = lipgloss.Color("#89b4fa") ColorGreen = lipgloss.Color("#a6e3a1") ColorYellow = lipgloss.Color("#f9e2af") ColorRed = lipgloss.Color("#f38ba8") ColorOrange = lipgloss.Color("#fab387") ColorMauve = lipgloss.Color("#cba6f7") ColorTeal = lipgloss.Color("#94e2d5") ColorSurface = lipgloss.Color("#313244") )
Base palette. This follows the Catppuccin-inspired colors already used by the status UI so the rest of the app can share one visual language.
var ( ColorGray = ColorSubtle ColorBorder = ColorSubtle ColorCyan = ColorTeal ColorMagenta = ColorMauve )
Backwards-compatible aliases still used by some call sites.
var ( StyleTitle = lipgloss.NewStyle().Foreground(ColorBlue).Bold(true) StyleHeading = lipgloss.NewStyle().Foreground(ColorText).Bold(true) StyleHelpHeading = lipgloss.NewStyle().Foreground(ColorOrange).Bold(true) StyleStrong = lipgloss.NewStyle().Foreground(ColorText).Bold(true) StyleBody = lipgloss.NewStyle().Foreground(ColorText) StyleMuted = lipgloss.NewStyle().Foreground(ColorSubtle) StyleHint = lipgloss.NewStyle().Foreground(ColorSubtle) StyleCodeLike = lipgloss.NewStyle().Foreground(ColorTeal) )
Semantic text and surface styles.
var ( StyleStatusSynced = lipgloss.NewStyle().Foreground(ColorGreen) StyleStatusAhead = lipgloss.NewStyle().Foreground(ColorMauve) StyleStatusBehind = lipgloss.NewStyle().Foreground(ColorYellow) StyleStatusDiverged = lipgloss.NewStyle().Foreground(ColorRed) StyleStatusUnknown = lipgloss.NewStyle().Foreground(ColorSubtle) )
Status styles.
var ( StyleBold = lipgloss.NewStyle().Bold(true) StyleDim = StyleMuted StyleRowHighlight = lipgloss.NewStyle().Background(ColorSurface) )
Text styles.
Functions ¶
func CmdOpenURL ¶
CmdOpenURL opens a URL with the platform's default handler.
func HintCancelScroll ¶
func HintCancelScroll() string
func HintChecklistConfirm ¶
func HintChecklistConfirm() string
func HintDismiss ¶
func HintDismiss() string
func HintDismissAndScroll ¶ added in v0.13.2
func HintDismissAndScroll() string
func HintSubmitCancel ¶
func HintSubmitCancel() string
func JoinStatus ¶
func MessageAborted ¶
func MessageClosed ¶
func MessageComplete ¶
func MessageNoOutput ¶
func MessageNoOutput() string
func MessageOpening ¶
func OverlayBottomCenter ¶ added in v0.12.4
OverlayBottomCenter places fg horizontally centered at the given y coordinate.
func OverlayBottomRight ¶ added in v0.13.2
OverlayTopRight places fg against the bottom-right corner of bg (1px horizontal margin and 2px vertical margin)
func OverlayCenter ¶
func OverlayTopRight ¶ added in v0.13.2
OverlayBottomRight places fg against the top-right corner of bg (1px margin).
func PlaceOverlay ¶
func RelativeTimeCompact ¶ added in v0.12.10
RelativeTimeCompact formats recent times for dense TUI tables, for example "2h ago", "3d ago", or "1wk 2d ago".
func RenderBadge ¶ added in v0.12.10
func RenderBadge(label string, variant BadgeVariant, nerd bool) string
RenderBadge returns a pill-shaped badge with a Catppuccin variant color theme.
func RenderButton ¶
RenderButton returns a styled button string. If selected, the button is highlighted (green, bold). If nerd is true, powerline rounded caps are added so the button looks like a pill.
func RenderChordOverlay ¶ added in v0.13.2
RenderChordOverlay renders a compact box listing the available chord completions for the given prefix key. The prefix is embedded in the top border and the "esc close" hint is right-aligned. Intended for placement in the top-right corner via OverlayTopRight.
func RenderFixedColumns ¶ added in v0.12.10
func RenderFixedColumns(cols []FixedColumn) string
RenderFixedColumns renders ANSI-safe fixed-width columns and joins them into one row. Each column is truncated and padded to its exact width.
func RenderInlineBindings ¶
RenderInlineBindings renders compact "key description" hints for transient status lines and prompts.
func RenderModalFrame ¶
func RenderModalFrame(opts ModalFrameOptions) string
func RenderPanelFrame ¶
func RenderPanelFrame(opts PanelFrameOptions) string
func RenderRowHighlight ¶ added in v0.12.10
RenderRowHighlight applies the shared row highlight background and re-applies it after nested ANSI resets so per-cell foreground colors stay visible across the full row.
Types ¶
type BadgeVariant ¶ added in v0.12.10
type BadgeVariant string
const ( BadgeVariantSurface BadgeVariant = "surface" BadgeVariantBlue BadgeVariant = "blue" BadgeVariantGreen BadgeVariant = "green" BadgeVariantYellow BadgeVariant = "yellow" BadgeVariantOrange BadgeVariant = "orange" BadgeVariantMauve BadgeVariant = "mauve" )
type ChordHinter ¶ added in v0.13.2
ChordHinter is implemented by models that expose chord completion hints. The app model queries the active child via this interface to combine app-level and child-level hints into one overlay.
type CommandOutput ¶
func (CommandOutput) String ¶
func (o CommandOutput) String() string
type CommandOutputLog ¶
type CommandOutputLog struct {
// contains filtered or unexported fields
}
func CommandOutputLogFrom ¶
func CommandOutputLogFrom(output string) *CommandOutputLog
func NewCommandOutputLog ¶
func NewCommandOutputLog() *CommandOutputLog
func (*CommandOutputLog) AppendCommand ¶
func (l *CommandOutputLog) AppendCommand(name string, args []string, output string)
func (*CommandOutputLog) String ¶
func (l *CommandOutputLog) String() string
type CommandOutputRecorder ¶
type CommandOutputRecorder struct {
// contains filtered or unexported fields
}
func NewCommandOutputRecorder ¶
func NewCommandOutputRecorder() *CommandOutputRecorder
func (*CommandOutputRecorder) Attach ¶
func (r *CommandOutputRecorder) Attach(cmd *exec.Cmd)
func (*CommandOutputRecorder) Output ¶
func (r *CommandOutputRecorder) Output() CommandOutput
type FixedColumn ¶ added in v0.12.10
type IconSet ¶
type IconSet struct {
Check string
Close string
Dash string
Branch string
Worktree string
FolderClosed string
FolderOpen string
FileModified string
FileAdded string
FileDeleted string
FileRenamed string
FileSymlink string
Ahead string
Behind string
Search string
Partial string
Staged string
}
IconSet provides semantic icon names with nerd-font and plain fallbacks.
type ModalFrameOptions ¶
type PanelFrameOptions ¶
type Terminal ¶
type Terminal int
Terminal identifies the terminal multiplexer or emulator gx is running inside.
func DetectTerminal ¶
func DetectTerminal() Terminal
DetectTerminal detects the current terminal environment from environment variables.
func DetectTerminalFrom ¶
DetectTerminalFrom detects the terminal environment using the provided getter.