cmds

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApprovePRCmd

func ApprovePRCmd(svc PRService, repo domain.Repository, prID, body string) tea.Cmd

func CheckMergeableCmd

func CheckMergeableCmd(svc PRService, repo domain.Repository, number int) tea.Cmd

func CheckoutBranchCmd added in v0.1.32

func CheckoutBranchCmd(repo domain.Repository, prNumber int, branch string, isCrossRepo bool) tea.Cmd

CheckoutBranchCmd runs git fetch + checkout for a PR branch asynchronously. If the working tree is dirty, changes are stashed before checkout. For cross-repository PRs it fetches refs/pull/<number>/head and creates a local branch named pr-<number> (with suffixes if necessary).

func ClosePRCmd added in v0.1.29

func ClosePRCmd(svc PRService, repo domain.Repository, number int, prID string) tea.Cmd

func DiscoverReposCmd

func DiscoverReposCmd(svc DiscoveryService, root string) tea.Cmd

func FetchAllPRsPageCmd

func FetchAllPRsPageCmd(svc DashboardService, repo domain.Repository, cursor string, pagesLeft int) tea.Cmd

FetchAllPRsPageCmd fires a background all-PRs page fetch for the jump index.

func LoadCommitDiffCmd added in v0.1.30

func LoadCommitDiffCmd(svc PRService, repo domain.Repository, sha string, force bool) tea.Cmd

func LoadDashboardCmd

func LoadDashboardCmd(svc DashboardService, repo domain.Repository, force bool) tea.Cmd

func LoadDiffCmd

func LoadDiffCmd(svc PRService, repo domain.Repository, number int, headSHA string, force bool) tea.Cmd

func LoadInvolvingCmd

func LoadInvolvingCmd(svc DashboardService, repo domain.Repository, viewer string, force bool) tea.Cmd

func LoadPRCommitsCmd added in v0.1.30

func LoadPRCommitsCmd(svc PRService, repo domain.Repository, number int, force bool) tea.Cmd

func LoadPRDetailCmd

func LoadPRDetailCmd(svc PRService, repo domain.Repository, number int, force bool) tea.Cmd

func LoadPreviewCmd

func LoadPreviewCmd(svc DashboardService, repo string, number int, host string, force bool) tea.Cmd

func MergePRCmd

func MergePRCmd(svc PRService, repo domain.Repository, number int, prID string, headRefOID string, method string) tea.Cmd

func PostCommentCmd

func PostCommentCmd(svc PRService, repo domain.Repository, prID, body string) tea.Cmd

func PostReviewCommentCmd

func PostReviewCommentCmd(svc PRService, repo domain.Repository, prID, body string) tea.Cmd

func RebuildPRIndexCmd

func RebuildPRIndexCmd(svc SearchService, repo domain.Repository, snap domain.DashboardSnapshot) tea.Cmd

func RebuildRepoIndexCmd

func RebuildRepoIndexCmd(svc SearchService, repos []domain.Repository) tea.Cmd

func ReopenPRCmd added in v0.1.29

func ReopenPRCmd(svc PRService, repo domain.Repository, number int, prID string) tea.Cmd

func ResolveViewerCmd

func ResolveViewerCmd(svc ViewerService, host string) tea.Cmd

func SubmitReviewWithDraftsCmd

func SubmitReviewWithDraftsCmd(svc PRService, repo domain.Repository, prID, body, event string, drafts []domain.DraftInlineComment) tea.Cmd

func UpdatePRCmd added in v0.1.37

func UpdatePRCmd(svc PRService, repo domain.Repository, number int, prID string, title string, body string) tea.Cmd

Types

type AllPRsPageLoaded

type AllPRsPageLoaded struct {
	Repo       string
	Entries    []domain.PullRequestSummary
	HasMore    bool
	NextCursor string
	PagesLeft  int
	Err        error
}

AllPRsPageLoaded is emitted when a background all-PRs page fetch completes.

type ApprovalFailed

type ApprovalFailed struct{ Err error }

type ApprovalPosted

type ApprovalPosted struct{}

type CheckoutResult added in v0.1.32

type CheckoutResult struct {
	Branch  string
	Stashed bool
	Err     error
}

CheckoutResult is emitted when the local git checkout command completes.

type CommentFailed

type CommentFailed struct{ Err error }

type CommentPosted

type CommentPosted struct{}

type CommitDiffLoaded added in v0.1.30

type CommitDiffLoaded struct {
	Repo string
	SHA  string
	Diff model.DiffModel
	Err  error
}

type CommitsLoaded added in v0.1.30

type CommitsLoaded struct {
	Repo    string
	Number  int
	Commits []domain.Commit
	Err     error
}

type DashboardLoaded

type DashboardLoaded struct {
	Repo      string
	Snapshot  domain.DashboardSnapshot
	FromCache bool
	Err       error
}

type DashboardService

type DashboardService interface {
	LoadRepo(ctx context.Context, repo domain.Repository, force bool) (domain.DashboardSnapshot, error)
	LoadInvolving(ctx context.Context, repo domain.Repository, viewer string, force bool) (domain.InvolvingSnapshot, error)
	LoadPreview(ctx context.Context, repo string, number int, force bool) (domain.PRPreviewSnapshot, error)
	LoadAllPRsPage(ctx context.Context, repo domain.Repository, cursor string) ([]domain.PullRequestSummary, bool, string, error)
	InvalidateRepo(ctx context.Context, repo domain.Repository) error
}

type DiffLoaded

type DiffLoaded struct {
	Repo      string
	Number    int
	Diff      model.DiffModel
	FromCache bool
	Err       error
}

type DiscoveryService

type DiscoveryService interface {
	Discover(ctx context.Context, root string) ([]domain.Repository, error)
}

type InvolvingLoaded

type InvolvingLoaded struct {
	Repo      string
	Snapshot  domain.InvolvingSnapshot
	FromCache bool
	Err       error
}

type MergePRMsg

type MergePRMsg struct {
	Repo   string
	Number int
	Method string
	Err    error
}

type MergeableChecked

type MergeableChecked struct {
	Repo   string
	Number int
	State  domain.MergeableState
	Err    error
}

type PRDetailLoaded

type PRDetailLoaded struct {
	Repo      string
	Number    int
	Detail    domain.PRPreviewSnapshot
	FromCache bool
	Err       error
}

type PRService

type PRService interface {
	LoadDetail(ctx context.Context, repo domain.Repository, number int, force bool) (domain.PRPreviewSnapshot, bool, error)
	LoadDiff(ctx context.Context, repo domain.Repository, number int, headSHA string, force bool) (model.DiffModel, bool, error)
	LoadPRCommits(ctx context.Context, repo domain.Repository, number int, force bool) ([]domain.Commit, error)
	LoadCommitDiff(ctx context.Context, repo domain.Repository, sha string, force bool) (model.DiffModel, error)
	PostComment(ctx context.Context, repo domain.Repository, prID string, body string) error
	PostReviewComment(ctx context.Context, repo domain.Repository, prID string, body string) error
	ApprovePR(ctx context.Context, repo domain.Repository, prID string, body string) error
	SubmitReviewWithComments(ctx context.Context, repo domain.Repository, prID, body, event string, comments []domain.DraftInlineComment) error
	SaveDraftComments(ctx context.Context, repo domain.Repository, number int, headSHA string, drafts []domain.DraftInlineComment) error
	LoadDraftComments(ctx context.Context, repo domain.Repository, number int, headSHA string) ([]domain.DraftInlineComment, error)
	DeleteDraftComments(ctx context.Context, repo domain.Repository, number int, headSHA string) error
	MergePR(ctx context.Context, repo domain.Repository, number int, prID string, headRefOID string, method string) error
	CheckMergeable(ctx context.Context, repo domain.Repository, number int) (domain.MergeableState, error)
	ClosePR(ctx context.Context, repo domain.Repository, number int, prID string) error
	ReopenPR(ctx context.Context, repo domain.Repository, number int, prID string) error
	UpdatePR(ctx context.Context, repo domain.Repository, number int, prID string, title string, body string) error
}

type PRStateChangedMsg added in v0.1.29

type PRStateChangedMsg struct {
	Repo     string
	Number   int
	NewState domain.PRState
	Err      error
}

type PRUpdated added in v0.1.37

type PRUpdated struct {
	Repo   string
	Number int
	Title  string
	Body   string
	Err    error
}

type PreviewLoaded

type PreviewLoaded struct {
	Repo      string
	Number    int
	Preview   domain.PRPreviewSnapshot
	FromCache bool
	Err       error
}

type RefreshFailed

type RefreshFailed struct {
	Key string
	Err error
}

type RefreshFinished

type RefreshFinished struct {
	Key string
}

type RefreshStarted

type RefreshStarted struct {
	Key string
}

type ReposDiscovered

type ReposDiscovered struct {
	Repos []domain.Repository
	Err   error
}

type ReviewFailed

type ReviewFailed struct{ Err error }

type ReviewPosted

type ReviewPosted struct{}

type SearchIndexRebuilt

type SearchIndexRebuilt struct {
	Repo string
	Err  error
}

type SearchService

type SearchService interface {
	BuildPRIndex(repo domain.Repository, snap domain.DashboardSnapshot) error
	BuildRepoIndex(repos []domain.Repository) error
}

type ViewerResolved

type ViewerResolved struct {
	Host  string
	Login string
	Err   error
}

type ViewerService

type ViewerService interface {
	FetchViewer(ctx context.Context, host string) (string, error)
}

Jump to

Keyboard shortcuts

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