commitview

package
v0.0.0-...-edbbb69 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseCommitViewMsg

type CloseCommitViewMsg struct{}

CloseCommitViewMsg is sent when the commit view should be closed.

type CommitDataLoadedMsg

type CommitDataLoadedMsg struct {
	Info      *git.LogEntry
	Overview  *git.CommitOverview
	Signature *git.CommitSignature
	Diffs     []git.FileDiff
	Err       error
}

CommitDataLoadedMsg is sent when commit data has been loaded.

type KeyMap

type KeyMap struct {
	// Navigation
	MoveDown       key.Binding
	MoveUp         key.Binding
	PageDown       key.Binding
	PageUp         key.Binding
	HalfPageDown   key.Binding
	HalfPageUp     key.Binding
	GoToTop        key.Binding
	GoToBottom     key.Binding
	PrevHunkHeader key.Binding
	NextHunkHeader key.Binding

	// Horizontal scroll
	ScrollLeft  key.Binding
	ScrollRight key.Binding
	ScrollStart key.Binding
	ScrollEnd   key.Binding

	// Actions
	OpenFileInWorktree key.Binding
	OpenCommitLink     key.Binding
	YankSelected       key.Binding

	// Close
	Close       key.Binding
	CloseEscape key.Binding

	// Popup triggers (for future phases)
	CherryPickPopup key.Binding
	BranchPopup     key.Binding
	CommitPopup     key.Binding
	DiffPopup       key.Binding
	PushPopup       key.Binding
	RevertPopup     key.Binding
	RebasePopup     key.Binding
	ResetPopup      key.Binding
	BisectPopup     key.Binding
	TagPopup        key.Binding
}

KeyMap defines key bindings for the commit view.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings for commit view.

type Model

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

Model is the commit view model for displaying commit details.

func New

func New(repo *git.Repository, commitID string, tokens theme.Tokens, filter []string) Model

New creates a new commit view model.

func (Model) CommitID

func (m Model) CommitID() string

CommitID returns the current commit ID.

func (Model) Done

func (m Model) Done() bool

Done returns whether the view should be closed.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) SetOverlayMode

func (m *Model) SetOverlayMode(overlay bool)

SetOverlayMode sets whether the view is rendered as a split overlay.

func (*Model) SetSize

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

SetSize updates the view dimensions.

func (Model) Update

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

Update implements tea.Model.

func (*Model) UpdateCommit

func (m *Model) UpdateCommit(commitID string, filter []string) tea.Cmd

UpdateCommit changes to a different commit (singleton support).

func (Model) View

func (m Model) View() string

View implements tea.Model.

type OpenCommitViewMsg

type OpenCommitViewMsg struct {
	CommitID string   // commit hash or ref
	Filter   []string // optional file path filter
}

OpenCommitViewMsg triggers opening the commit view at the app level.

type OpenFileMsg

type OpenFileMsg struct {
	Path string
	Line int
}

OpenFileMsg requests opening a file in the worktree.

type OpenURLMsg

type OpenURLMsg struct {
	URL string
}

OpenURLMsg requests opening a URL in the browser.

type ScrollCommitViewMsg

type ScrollCommitViewMsg struct {
	Direction int // -1 up, +1 down
}

ScrollCommitViewMsg requests scrolling the commit view.

Jump to

Keyboard shortcuts

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