layout

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package layout turns terminal dimensions into pane geometry, so views can ask what to draw rather than each recomputing breakpoints.

Index

Constants

View Source
const (
	MediumMinWidth = 80
	WideMinWidth   = 120

	// ShortHeight is the row count below which chrome collapses to essentials.
	ShortHeight = 20
)

Width thresholds, in columns.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breakpoint

type Breakpoint int

Breakpoint describes how many panes fit at the current width.

const (
	// Compact shows one pane at a time with stack navigation.
	Compact Breakpoint = iota
	// Medium shows the thread list beside the reader.
	Medium
	// Wide adds the label sidebar.
	Wide
)

type Layout

type Layout struct {
	Width  int
	Height int

	Breakpoint Breakpoint

	// Pane widths. Zero means the pane is not drawn at this size.
	SidebarWidth int
	ListWidth    int
	ReaderWidth  int

	// ContentHeight is the rows available to panes after chrome.
	ContentHeight int

	// ShowBanner is false when the terminal is too short or narrow for the
	// full ASCII logo.
	ShowBanner bool
	// CompactBanner is true when the logo must fall back to its one-line form.
	CompactBanner bool
}

Layout is the resolved geometry for one frame.

func Resolve

func Resolve(width, height int) Layout

Resolve computes geometry for the given terminal size.

func (Layout) IsShort

func (l Layout) IsShort() bool

IsShort reports whether chrome should collapse to essentials.

Jump to

Keyboard shortcuts

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