display

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package display renders forge and vcs models as plain text. Anything that emits a glyph, a placeholder, or a human-readable duration belongs here rather than in the data packages it reads, which is what keeps forge and vcs from importing each other.

Index

Constants

View Source
const EmDash = "—"

EmDash stands in for a value the model does not have.

Variables

This section is empty.

Functions

func BranchRelativeLastCommit

func BranchRelativeLastCommit(b vcs.BranchInfo) string

BranchRelativeLastCommit returns a human-readable relative time for the branch's last commit.

func CIConclusion

func CIConclusion(c *forge.DefaultBranchCI) string

CIConclusion rolls the workflows up into one word: failing if any failed, pending while any is still going, passing when all succeeded, and EmDash when the commit has no runs at all.

func CheckDuration

func CheckDuration(c forge.CheckDetail) string

CheckDuration renders how long the check ran, or EmDash while it's still running.

func CheckStatusDisplay

func CheckStatusDisplay(c forge.CheckDetail) string

CheckStatusDisplay returns the check's lowercased conclusion once it has completed, or its in-flight status ("queued", "in progress") before then.

func ChecksSummary

func ChecksSummary(c forge.ChecksStatus) string

ChecksSummary returns a one-word overall status for the checks.

func CommentRelativeCreated

func CommentRelativeCreated(c forge.PRComment) string

CommentRelativeCreated returns a human-readable relative time for the comment.

func CommitRelativeDate

func CommitRelativeDate(c vcs.CommitInfo) string

CommitRelativeDate returns a human-readable relative time for the commit's date.

func PRActivitySummary

func PRActivitySummary(p *forge.PullRequest) string

PRActivitySummary renders the latest activity as an age and an author, or EmDash when the pull request has neither comments nor reviews.

func PRDetailRelativeCreated

func PRDetailRelativeCreated(p forge.PRDetail) string

PRDetailRelativeCreated returns a human-readable relative time for the pull request's creation.

func PRDetailRelativeUpdated

func PRDetailRelativeUpdated(p forge.PRDetail) string

PRDetailRelativeUpdated returns a human-readable relative time for the pull request's last update.

func PRReviewGlyph

func PRReviewGlyph(p *forge.PullRequest) string

PRReviewGlyph marks an approval or a change request, or is empty otherwise.

func PRReviewStatus

func PRReviewStatus(p forge.PullRequest) string

PRReviewStatus returns a human-readable summary of the pull request's review decision.

func PRStatusDisplay

func PRStatusDisplay(p forge.PullRequest) string

PRStatusDisplay returns the pull request's display status label.

func PreviewReviewStatus

func PreviewReviewStatus(p forge.PRPreview) string

PreviewReviewStatus reports the preview's review state in the same vocabulary the full detail uses.

func RelativeTime

func RelativeTime(t time.Time) string

RelativeTime renders t as a human-readable duration relative to now (e.g. "3 days ago").

func RelativeTimeCompact added in v0.8.0

func RelativeTimeCompact(t time.Time) string

RelativeTimeCompact renders t as a duration relative to now in the narrowest form that stays readable ("3m ago", "2h ago", "5d ago"), falling back to a calendar date past a week. A table column holding a time is a handful of cells wide, which RelativeTime's "3 minutes ago" does not fit in.

func RepoRelativeModified

func RepoRelativeModified(r vcs.RepoSummary) string

RepoRelativeModified returns a human-readable relative time for the repo's last modification.

func RepoStatusSummary

func RepoStatusSummary(r vcs.RepoSummary) string

RepoStatusSummary renders a compact symbol-based summary of the repo's working tree state.

func StashRelativeDate

func StashRelativeDate(s vcs.StashDetail) string

StashRelativeDate returns a human-readable relative time for the stash's date.

func WorkflowRunStatusDisplay

func WorkflowRunStatusDisplay(w forge.WorkflowRun) string

WorkflowRunStatusDisplay returns the workflow run's display status label.

func WorkflowSummaryStatusDisplay

func WorkflowSummaryStatusDisplay(w forge.WorkflowSummary) string

WorkflowSummaryStatusDisplay returns a one-word overall status for the workflow runs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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