board

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package board is the status board's one renderer (spc-2610031844142274): two views, the product thinker's and the facilitator's, each in two forms, text for a Terminal or a pipe and a markdown list a host session pastes unchanged.

It takes the board's data and returns lines. It never writes to a stream and never reads the environment: the front door reads the window, the colour rung and the locale and hands them in a Frame, so every view and form is a golden test. It holds its own colour rungs rather than importing internal/term, which carries raw-mode terminal code the transport-agnostic core does not depend on (spc-2610030944505997, open question 2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(in Input, f Frame) []string

Render draws the board in the frame's view and form.

Types

type Form

type Form int

Form is how the lines are drawn.

const (
	// Text is for a Terminal or a pipe: fitted or wrapped to the window.
	Text Form = iota
	// Markdown is a list for a host session to paste unchanged: no escape
	// byte, no fitted title, every line the label, a blank or a list item.
	Markdown
)

type Frame

type Frame struct {
	View  View
	Form  Form
	Width int  // the window's columns; ignored by Markdown
	Rung  Rung // Mono in a pipe, under NO_COLOR and --no-color
	ASCII bool // no UTF-8 locale: the plain-text symbols and ellipsis
}

Frame is what the front door read about where the board is drawn.

type Input

type Input struct {
	Dir    string
	Status *statusblock.Block
	Rows   []Row
	// Version is the installed version, the same core.VersionInfo
	// `abcd --version` reports; it is drawn as the board's last line in both
	// views and both forms (spc-2610100613109045, decision 4), and the line is
	// left out only when no version is handed in.
	Version core.VersionInfo
}

Input is everything the views draw from.

type Row

type Row struct {
	Label string
	Text  string
	Items []string
}

Row is one of the facilitator's labelled rows, already worded by the front door (the presence, peers, inbox, oracle and reviews readers live there): a label and its value, and the lines nested one level under it.

type Rung

type Rung int

Rung is how much colour the Terminal shows, the front door's reading of the colour ladder (term.ResolveColorMode) in the core's own terms.

const (
	// Mono paints nothing: a pipe, NO_COLOR, --no-color, a dumb terminal.
	Mono Rung = iota
	// Ansi16 paints the sixteen colours.
	Ansi16
	// Ansi256 paints the 256-colour set.
	Ansi256
	// TrueColor paints 24-bit colour, the only rung the view label is painted at.
	TrueColor
)

type View

type View int

View is whose view of the board is drawn.

const (
	// Product is the product thinker's view, the default: what is being
	// built, the next three things, and how many more wait.
	Product View = iota
	// Facilitator is the facilitator's view: every row of the full board, with
	// each planned row's spec and a lane's in-flight mark.
	Facilitator
)

Jump to

Keyboard shortcuts

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