view

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const RailWidth = 2

railWidth is the display width of one rail column (and of a node glyph), so nested content indents by a whole number of aligned columns.

Variables

This section is empty.

Functions

func RailConnector

func RailConnector(depth int) string

railConnector renders a bare connector row between two nodes at depth: the node column continued as a rail with no glyph — railSpine(depth) plus a trailing rail glyph trimmed of its trailing space, so the row is just the faint vertical bars.

func RailDetail

func RailDetail(text string, depth, width int) []string

railDetail renders detail rows under a node at depth: the detail belongs to the node's own column, which is one rail level deeper, so each row is railSpine(depth+1) plus faint (styles.ToolResultStyle) width-wrapped text. Trailing spaces are trimmed per row.

func RailNode

func RailNode(glyph, text string, depth, width int) []string

railNode renders a node row at depth: `depth` leading rail columns, then the node glyph (2 cols, e.g. styles.LitDot / styles.ToolNode(...)), then width-wrapped text hanging under the glyph. Continuation lines replace the node's glyph column with another rail level, preserving both text alignment and the step's continuous timeline. glyph is pre-styled by the caller; text is plain. Trailing spaces are trimmed per row.

func RailNodeStyled

func RailNodeStyled(glyph, text string, textStyle lipgloss.Style, depth, width int) []string

railNodeStyled is railNode with a per-line text style applied to each wrapped text row (e.g. faint tool headers) before assembly — the glyph and rail columns are left unstyled by this helper (the glyph is pre-styled by the caller; the spine carries its own faint style). railNode delegates here with a no-op style. Because the styling is zero-width ANSI, an ANSI-stripped assertion sees the SAME text as railNode.

func RailSpine

func RailSpine(n int) string

railSpine returns n leading styled rail columns ("│ " each). railSpine(0) == "". It is the quiet vertical spine shared by thinking, wrapped nodes, and tool details, so nodes at nesting depth n hang below n bars.

func WrapToWidth

func WrapToWidth(s string, width int) []string

WrapToWidth word-wraps s to width columns and trims trailing layout padding.

Types

This section is empty.

Jump to

Keyboard shortcuts

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