view

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package view is the item view the loop projects to every sink: a semantic status, unread and a summary line, never a sink's vocabulary.

Index

Constants

View Source
const (
	StateMerged = "MERGED"
	StateClosed = "CLOSED"
)

The states of AuthorFacts.State.

Variables

This section is empty.

Functions

func AuthorColumn

func AuthorColumn(f AuthorFacts, current Status) (to Status, unread bool, reason string, need LocalNeed)

AuthorColumn decides where an author card in current moves. to is None when it stays; need asks the caller to inspect that much of the checkout and decide again with Local set.

func HasTurn

func HasTurn(b turn.Book, intents []turn.Intent) bool

HasTurn is true when b has a turn of intents.

Types

type Applied

type Applied struct {
	Unit     unit.Unit
	Role     Role
	Status   Status
	Unread   bool
	Summary  string
	Column   string
	Override string
	At       time.Time
}

Applied is what a sink last received for an item: the column it wrote, or, when the user's placement is outside the sink's managed vocabulary, that placement as Override and no column.

func (Applied) Key

func (a Applied) Key() Key

type AuthorFacts

type AuthorFacts struct {
	State                                               string
	Draft, Approved, ChecksPass, ChangesRequestedOnHead bool
	Mergeable, Base                                     string
	// ConflictingFor is how long the pull request has been seen CONFLICTING,
	// zero when it has not or without an inventory.
	ConflictingFor, ConfirmConflictAfter time.Duration
	// Local is nil when the checkout was not inspected.
	Local *LocalFacts
	// AuthorWorkspace and ReviewWorkspace say the user's board has a
	// workspace of that role for the pull request, whose card the facts move
	// without a turn; AuthorWorkspace is false while an address round is due,
	// since that round's turn moves the card.
	AuthorWorkspace, ReviewWorkspace bool
}

AuthorFacts are what the author column of a pull request is decided from.

func (AuthorFacts) Finished

func (f AuthorFacts) Finished() bool

Finished is true for a merged or closed pull request.

type Item

type Item struct {
	Unit    unit.Unit
	Role    Role
	Status  Status
	Unread  bool
	Summary string
	// At is the time of the newest turn the item projects; the newest unit
	// owns a card shared by several.
	At time.Time
}

func Author

func Author(b turn.Book, intents []turn.Intent, last Status, f *AuthorFacts) Item

Author projects an author card. A turn of intents that asks or stopped needs me; once last, the status a sink last applied, is needs-me, the turn moving on or an answer typed into its session puts the item in progress. With f, the pull request's facts also move the card (see AuthorColumn), unless the turn needs me. Without a turn, only the facts of a pull request with an author workspace move it. Without f, or when nothing moves the card, it has no opinion.

func Review

func Review(b turn.Book, intents []turn.Intent) Item

Review projects the newest turn of intents, those whose board is review; a turn of any other intent never moves a review item.

func (Item) Key

func (it Item) Key() Key

type Key

type Key struct {
	Unit unit.Unit
	Role Role
}

Key names an item: a unit's card of one role.

type LocalFacts

type LocalFacts struct {
	Clean        bool
	Head, PRHead string
	AheadOfPR    bool
	AgentWorking bool
}

type LocalNeed

type LocalNeed int

LocalNeed is how much of the checkout AuthorColumn must read to decide.

const (
	NoLocal LocalNeed = iota
	// LocalHead reads only Head and AheadOfPR.
	LocalHead
	// LocalClean also reads Clean and AgentWorking.
	LocalClean
)

type Role

type Role string
const (
	ReviewRole Role = "review"
	AuthorRole Role = "author"
)

type Status

type Status string
const (
	None       Status = ""
	Working    Status = "working"
	NeedsMe    Status = "needs-me"
	Reviewed   Status = "reviewed"
	Done       Status = "done"
	InProgress Status = "in-progress"
	InReview   Status = "in-review"
	Ready      Status = "ready"
	Completed  Status = "completed"
	// Elsewhere is a card the sink does not manage the column of: the user's.
	Elsewhere Status = "elsewhere"
)

Jump to

Keyboard shortcuts

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