pullrequests

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailModel

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

DetailModel represents the PR detail view showing description, reviewers, and changed files

func NewDetailModel

func NewDetailModel(client *azdevops.Client, pr azdevops.PullRequest) *DetailModel

NewDetailModel creates a new PR detail model with default styles

func NewDetailModelWithStyles

func NewDetailModelWithStyles(client *azdevops.Client, pr azdevops.PullRequest, s *styles.Styles) *DetailModel

NewDetailModelWithStyles creates a new PR detail model with custom styles

func (*DetailModel) GetChangedFiles

func (m *DetailModel) GetChangedFiles() []azdevops.IterationChange

GetChangedFiles returns the changed files

func (*DetailModel) GetContextItems

func (m *DetailModel) GetContextItems() []components.ContextItem

GetContextItems returns context items for the detail view

func (*DetailModel) GetPR

func (m *DetailModel) GetPR() azdevops.PullRequest

GetPR returns the pull request

func (*DetailModel) GetScrollPercent

func (m *DetailModel) GetScrollPercent() float64

GetScrollPercent returns the scroll percentage based on viewport position

func (*DetailModel) GetStatusMessage

func (m *DetailModel) GetStatusMessage() string

GetStatusMessage returns the status message

func (*DetailModel) GetThreads

func (m *DetailModel) GetThreads() []azdevops.Thread

GetThreads returns the current threads (for passing to DiffModel)

func (*DetailModel) Init

func (m *DetailModel) Init() tea.Cmd

Init initializes the detail model

func (*DetailModel) MoveDown

func (m *DetailModel) MoveDown()

MoveDown moves file selection down or scrolls viewport if at bottom

func (*DetailModel) MoveUp

func (m *DetailModel) MoveUp()

MoveUp moves file selection up or scrolls viewport if at top

func (*DetailModel) PageDown

func (m *DetailModel) PageDown()

PageDown scrolls the viewport down by one page

func (*DetailModel) PageUp

func (m *DetailModel) PageUp()

PageUp scrolls the viewport up by one page

func (*DetailModel) SelectedFile

func (m *DetailModel) SelectedFile() *azdevops.IterationChange

SelectedFile returns the currently selected changed file

func (*DetailModel) SelectedIndex

func (m *DetailModel) SelectedIndex() int

SelectedIndex returns the current file selection index

func (*DetailModel) SetChangedFiles

func (m *DetailModel) SetChangedFiles(files []azdevops.IterationChange)

SetChangedFiles sets the changed files (useful for testing)

func (*DetailModel) SetSize

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

SetSize sets the size of the detail view

func (*DetailModel) SetThreads

func (m *DetailModel) SetThreads(threads []azdevops.Thread)

SetThreads sets the threads (useful for testing) Filters out system-generated threads

func (*DetailModel) Update

func (m *DetailModel) Update(msg tea.Msg) (*DetailModel, tea.Cmd)

Update handles messages for the detail view

func (*DetailModel) View

func (m *DetailModel) View() string

View renders the detail view

type DiffModel

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

DiffModel is the diff viewer component

func NewDiffModel

func NewDiffModel(client *azdevops.Client, pr azdevops.PullRequest, threads []azdevops.Thread, s *styles.Styles) *DiffModel

NewDiffModel creates a new diff viewer model

func (*DiffModel) GetContextItems

func (m *DiffModel) GetContextItems() []components.ContextItem

GetContextItems returns context items for the current view

func (*DiffModel) GetScrollPercent

func (m *DiffModel) GetScrollPercent() float64

GetScrollPercent returns the scroll percentage

func (*DiffModel) GetStatusMessage

func (m *DiffModel) GetStatusMessage() string

GetStatusMessage returns the status message

func (*DiffModel) Init

func (m *DiffModel) Init() tea.Cmd

Init initializes the diff model by fetching changed files

func (*DiffModel) InitGeneralComments

func (m *DiffModel) InitGeneralComments() tea.Cmd

InitGeneralComments initializes the diff model and immediately opens the general comments view

func (*DiffModel) InitWithFile

func (m *DiffModel) InitWithFile(file azdevops.IterationChange) tea.Cmd

InitWithFile initializes the diff model and immediately opens a specific file's diff

func (*DiffModel) IsInputActive

func (m *DiffModel) IsInputActive() bool

IsInputActive returns true when a text input (comment or reply) is active, so that global keyboard shortcuts can be suppressed.

func (*DiffModel) SetSize

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

SetSize sets the component size

func (*DiffModel) Update

func (m *DiffModel) Update(msg tea.Msg) (*DiffModel, tea.Cmd)

Update handles messages

func (*DiffModel) View

func (m *DiffModel) View() string

View renders the diff view

type DiffViewMode

type DiffViewMode int

DiffViewMode represents the current sub-view within the diff viewer

const (
	DiffFileList DiffViewMode = iota // selectable list of changed files
	DiffFileView                     // scrollable diff for single file
)

type InputMode

type InputMode int

InputMode represents what kind of text input is active

const (
	InputNone       InputMode = iota
	InputNewComment           // creating new code comment on a line
	InputReply                // replying to existing thread
)

type Model

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

Model represents the pull request list view with sub-views

func NewModel

func NewModel(client *azdevops.MultiClient) Model

NewModel creates a new pull request list model with default styles

func NewModelWithStyles

func NewModelWithStyles(client *azdevops.MultiClient, s *styles.Styles) Model

NewModelWithStyles creates a new pull request list model with custom styles

func (Model) GetContextItems

func (m Model) GetContextItems() []components.ContextItem

GetContextItems returns context bar items for the current view

func (Model) GetScrollPercent

func (m Model) GetScrollPercent() float64

GetScrollPercent returns the scroll percentage for the current view

func (Model) GetStatusMessage

func (m Model) GetStatusMessage() string

GetStatusMessage returns the status message for the current view

func (Model) GetViewMode

func (m Model) GetViewMode() ViewMode

GetViewMode returns the current view mode (for testing)

func (Model) HasContextBar

func (m Model) HasContextBar() bool

HasContextBar returns true if the current view should show a context bar

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) IsAsReviewerActive added in v0.5.4

func (m Model) IsAsReviewerActive() bool

IsAsReviewerActive returns true if the "as reviewer" filter is active.

func (Model) IsMyPRsActive added in v0.5.4

func (m Model) IsMyPRsActive() bool

IsMyPRsActive returns true if the "my PRs" filter is active.

func (Model) IsSearching

func (m Model) IsSearching() bool

IsSearching returns true if the view has an active text input that should suppress global keyboard shortcuts. This includes search/filter mode and comment/reply input in the diff view.

func (Model) Update

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

Update handles messages

func (Model) View

func (m Model) View() string

View renders the view

type SetPRsMsg

type SetPRsMsg struct {
	PRs []azdevops.PullRequest
}

SetPRsMsg is a message to directly set the pull requests (from polling)

type ViewMode

type ViewMode int

ViewMode represents the current view in the pull requests UI

const (
	ViewList   ViewMode = iota // PR list view
	ViewDetail                 // PR detail view (description + threads)
	ViewDiff                   // Diff view (changed files + file diffs)
)

Jump to

Keyboard shortcuts

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