promptrows

package
v0.7.204 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package promptrows renders the prompts of a review pass as rows: one line per prompt with its state, sidecar and timing. chunk review draws its own pass with it, and the watch dashboard draws a factory round's reviews.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active(rows []Row) bool

Active reports whether any row is still queued or running.

func NameWidth

func NameWidth(rows []Row) int

NameWidth is the width the name column needs to fit every row.

func RenderRow

func RenderRow(st Styles, r Row, nameWidth, spinIdx int) string

RenderRow renders one prompt line, indented two columns. nameWidth pads the name column so rows align (see NameWidth); spinIdx picks the spinner frame of a running row.

func RenderSummary

func RenderSummary(st Styles, rows []Row) string

RenderSummary renders the "2 running · 1 done" tally for rows.

Types

type Row

type Row struct {
	Name      string
	SidecarID string
	State     State
	Duration  time.Duration
	Err       string
}

Row is one prompt of a review pass as the row renderers show it. Each view fills it in from its own source, which is what lets `chunk review` and `chunk watch` draw a review identically.

type State

type State int

State is where a prompt is in its run.

const (
	Queued  State = iota // waiting for a sidecar
	Running              // executing on a sidecar
	Done                 // completed successfully
	Failed               // completed with error
)

Prompt states, in the order a prompt moves through them.

type Styles

type Styles struct {
	Dim     lipgloss.Style
	Success lipgloss.Style
	Err     lipgloss.Style
	Running lipgloss.Style
	Muted   lipgloss.Style
	VDim    lipgloss.Style
	Emph    lipgloss.Style
}

Styles holds the computed lipgloss styles the renderers use.

func NewStyles

func NewStyles(hasDark bool) Styles

NewStyles computes the styles for a light or dark terminal.

Jump to

Keyboard shortcuts

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