common

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPalette = NewPalette()

Functions

func CircularSearch added in v0.10.0

func CircularSearch(items []screen.Searchable, query string, startIndex, cursor int, backward bool) int

CircularSearch performs a circular search through searchable items. Returns the index of the first matching item, or cursor if no match is found.

func Close

func Close() tea.Msg

func CloseApplied added in v0.9.9

func CloseApplied() tea.Msg

func Debounce added in v0.9.7

func Debounce(identifier string, duration time.Duration, cmd tea.Cmd) tea.Cmd

Debounce waits for the given duration before running cmd; newer calls with the same identifier cancel previous ones.

func DeriveScope added in v0.10.5

func DeriveScope(action keybindings.Action) string

DeriveScope determines the intent scope from generated built-in metadata. Non-built-in actions have no scope.

func FileSearch added in v0.9.1

func FileSearch(revset string, preview bool, commit *jj.Commit, rawFileOut []byte) tea.Cmd

func IsInputMessage added in v0.9.10

func IsInputMessage(msg tea.Msg) bool

func OpenTargetPicker added in v0.10.3

func OpenTargetPicker() tea.Cmd

func Quit added in v0.10.5

func Quit() tea.Cmd

func Refresh

func Refresh() tea.Msg

func RefreshAndKeepSelections added in v0.8.12

func RefreshAndKeepSelections() tea.Msg

func RefreshAndSelect

func RefreshAndSelect(selectedRevision string) tea.Cmd

func RestoreOperation added in v0.9.9

func RestoreOperation(op any) tea.Cmd

func RouteIntent added in v0.10.5

func RouteIntent(scopes []Scope, intent intents.Intent) (tea.Cmd, bool)

func SelectionChanged

func SelectionChanged(item SelectedItem) tea.Cmd

func StartAceJump added in v0.9.9

func StartAceJump() tea.Cmd

func Suspend added in v0.10.5

func Suspend() tea.Cmd

func UpdateRevSet added in v0.9.0

func UpdateRevSet(revset string) tea.Cmd

Types

type ActionCompletedMsg added in v0.10.5

type ActionCompletedMsg struct {
	ID string
}

type AutoRefreshMsg added in v0.8.12

type AutoRefreshMsg struct{}

type CloseViewMsg

type CloseViewMsg struct {
	Applied bool
}

type CommandCompletedMsg

type CommandCompletedMsg struct {
	ID     int
	Output string
	Err    error
}

type CommandRunningMsg

type CommandRunningMsg struct {
	ID      int
	Command string
}

type DispatchActionMsg added in v0.10.0

type DispatchActionMsg struct {
	Action       string
	Args         map[string]any
	BuiltIn      bool
	CompletionID string
}

type Editable added in v0.9.4

type Editable interface {
	IsEditing() bool
}

type ExecMode added in v0.9.0

type ExecMode struct {
	Mode   string
	Prompt string
}
var ExecJJ ExecMode = ExecMode{
	Mode:   "jj",
	Prompt: ": ",
}
var ExecShell ExecMode = ExecMode{
	Mode:   "sh",
	Prompt: "$ ",
}

type ExecMsg added in v0.9.0

type ExecMsg struct {
	Line string
	Mode ExecMode
}

type ExecProcessCompletedMsg added in v0.9.7

type ExecProcessCompletedMsg struct {
	Err error
	Msg ExecMsg
}

type FileSearchMsg added in v0.9.1

type FileSearchMsg struct {
	Revset       string
	PreviewShown bool
	Commit       *jj.Commit
	RawFileOut   []byte // raw output from `jj file list`
}

type Focusable

type Focusable interface {
	IsFocused() bool
}

type ImmediateModel added in v0.9.11

type ImmediateModel interface {
	Init() tea.Cmd
	Update(msg tea.Msg) tea.Cmd
	ViewRect(dl *render.DisplayContext, box layout.Box)
}

type LeakPolicy added in v0.10.5

type LeakPolicy int
const (
	LeakAll LeakPolicy = iota
	LeakGlobal
	LeakNone
)

type OpenTargetPickerMsg added in v0.10.3

type OpenTargetPickerMsg struct{}

type Overlay added in v0.9.4

type Overlay interface {
	IsOverlay() bool
}

type Palette

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

func NewPalette added in v0.9.0

func NewPalette() *Palette

func (*Palette) Get added in v0.9.0

func (p *Palette) Get(selector string) lipgloss.Style

func (*Palette) GetBorder added in v0.9.0

func (p *Palette) GetBorder(selector string, border lipgloss.Border) lipgloss.Style

func (*Palette) Update added in v0.8.12

func (p *Palette) Update(styleMap map[string]config.Color)

type QuickSearchMsg added in v0.8.3

type QuickSearchMsg string

type RefreshMsg

type RefreshMsg struct {
	SelectedRevision string
	KeepSelections   bool
}

type RestoreOperationMsg added in v0.9.9

type RestoreOperationMsg struct {
	Operation any
}

type RunLuaScriptMsg added in v0.9.8

type RunLuaScriptMsg struct {
	Script       string
	CompletionID string
}

type Scope added in v0.10.5

type Scope struct {
	Name    keybindings.ScopeName
	Leak    LeakPolicy
	Global  bool
	Handler ScopeHandler
}

Scope represents one routing layer in the intent dispatch chain. Scopes are ordered from innermost (highest priority) to outermost.

func VisibleScopes added in v0.10.5

func VisibleScopes(scopes []Scope) []Scope

type ScopeHandler added in v0.10.5

type ScopeHandler interface {
	HandleIntent(intent intents.Intent) (tea.Cmd, bool)
	Update(msg tea.Msg) tea.Cmd
}

type ScopeProvider added in v0.10.5

type ScopeProvider interface {
	Scopes() []Scope
}

type SelectedCommit added in v0.9.10

type SelectedCommit struct {
	CommitId string
}

func (SelectedCommit) Equal added in v0.9.10

func (s SelectedCommit) Equal(other SelectedItem) bool

type SelectedFile added in v0.9.10

type SelectedFile struct {
	ChangeId string
	CommitId string
	File     string
}

func (SelectedFile) Equal added in v0.9.10

func (s SelectedFile) Equal(other SelectedItem) bool

type SelectedItem added in v0.9.10

type SelectedItem interface {
	Equal(other SelectedItem) bool
}

type SelectedOperation added in v0.9.10

type SelectedOperation struct {
	OperationId string
}

func (SelectedOperation) Equal added in v0.9.10

func (s SelectedOperation) Equal(other SelectedItem) bool

type SelectedRevision added in v0.9.10

type SelectedRevision struct {
	ChangeId string
	CommitId string
}

func (SelectedRevision) Equal added in v0.9.10

func (s SelectedRevision) Equal(other SelectedItem) bool

type SelectionChangedMsg

type SelectionChangedMsg struct {
	Item SelectedItem
}

type ShowChooseMsg added in v0.9.9

type ShowChooseMsg struct {
	Options []string
	Title   string
	Filter  bool
	Ordered bool
}

type ShowInputMsg added in v0.9.9

type ShowInputMsg struct {
	Title  string
	Prompt string
	Value  string
}

type ShowPreview added in v0.9.1

type ShowPreview bool

type StackedModel added in v0.10.0

type StackedModel interface {
	ImmediateModel
	ScopeProvider
}

StackedModel is the contract for models presented in the stacked overlay.

type StartAceJumpMsg added in v0.9.9

type StartAceJumpMsg struct{}

type State

type State int
const (
	Loading State = iota
	Ready
)

type ThemeChangedMsg added in v0.10.5

type ThemeChangedMsg struct{}

type TogglePasswordMsg added in v0.9.9

type TogglePasswordMsg struct {
	Prompt   string
	Password chan []byte
}

type UpdateBookmarksMsg

type UpdateBookmarksMsg struct {
	Bookmarks []string
	Revision  string
}

type UpdateRevSetMsg added in v0.9.0

type UpdateRevSetMsg string

type UpdateRevisionsFailedMsg

type UpdateRevisionsFailedMsg struct {
	Output string
	Err    error
}

type UpdateRevisionsSuccessMsg added in v0.8.12

type UpdateRevisionsSuccessMsg struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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