Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllTabs = []TabMeta{

	{TabStatus, "Status", "●", "s", "core"},
	{TabDiff, "Diff", "±", "d", "core"},
	{TabLog, "Log", "◆", "l", "core"},

	{TabBranches, "Branches", "⑂", "b", "branch"},
	{TabRemotes, "Remotes", "⇄", "m", "branch"},
	{TabStash, "Stash", "⊟", "t", "branch"},

	{TabRebase, "Rebase", "↻", "e", "advanced"},
	{TabConflicts, "Conflicts", "⚡", "x", "advanced"},
	{TabWorktrees, "Worktrees", "⌥", "w", "advanced"},
	{TabBisect, "Bisect", "◎", "i", "advanced"},
}

AllTabs is the ordered list of all tabs, grouped logically. Navigation: Tab/Shift+Tab cycles through them, or use the shortcut key.

Functions

func CmdErr

func CmdErr(err error) tea.Cmd

CmdErr creates a tea.Cmd that sends an ErrMsg.

func CmdInfo

func CmdInfo(text string) tea.Cmd

CmdInfo creates a tea.Cmd that sends an InfoMsg.

func CmdRefresh

func CmdRefresh() tea.Msg

CmdRefresh returns a RefreshMsg (use as return from tea.Cmd).

Types

type ErrMsg

type ErrMsg struct{ Err error }

ErrMsg carries an error to be displayed.

type InfoMsg

type InfoMsg struct{ Text string }

InfoMsg carries an informational message.

type RefreshMsg

type RefreshMsg struct{}

RefreshMsg signals views to reload data.

type SwitchTabMsg

type SwitchTabMsg struct{ Tab TabID }

SwitchTabMsg requests a tab switch.

type TabID

type TabID int

TabID identifies which view/tab is active.

const (
	TabStatus TabID = iota
	TabLog
	TabDiff
	TabBranches
	TabStash
	TabRemotes
	TabRebase
	TabConflicts
	TabWorktrees
	TabBisect
)

type TabMeta

type TabMeta struct {
	ID       TabID
	Name     string // Display name shown in the tab bar.
	Icon     string // Unicode icon (nerdfont-free, works in all terminals).
	Shortcut string // Mnemonic shortcut hint displayed in the tab (e.g., "s").
	Group    string // Logical group: "core", "history", "branch", "advanced".
}

TabMeta describes a tab for display purposes.

type ToggleHelpMsg

type ToggleHelpMsg struct{}

ToggleHelpMsg toggles the help overlay.

type View

type View interface {
	Init() tea.Cmd
	Update(msg tea.Msg) (View, tea.Cmd)
	View() string
	SetSize(width, height int)
	ShortHelp() []components.HelpEntry

	// InputCapture returns true when the view is in a text-input mode
	// (e.g. commit message editing) and wants to capture arrow keys,
	// letters, etc. instead of letting the app handle them for tab
	// switching.
	InputCapture() bool
}

View is the interface every tab view must implement.

Jump to

Keyboard shortcuts

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