Documentation
¶
Overview ¶
Package frame assembles the TUI 2.0 screen from panel content and a layout budget.
It exists to make one property true by construction: every rendered row is exactly the terminal width. Panels hand it whatever they draw — too short, too long, styled, full of wide runes — and the frame fits each line to its region before joining regions with one-cell rules.
That inversion is what makes the borderless design safe to adopt incrementally. The old frame relied on Lipgloss borders to absorb whatever slop a panel produced; remove the borders and every panel has to be exact-width on its own, which is a large simultaneous change. Here the frame does the fitting, so a panel that is not yet exact simply gets padded or clipped instead of shearing the screen.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Column ¶
Column is one region's content: the lines it drew, the width it was budgeted, and the surface it is drawn on. Lines shorter than Height are padded with blanks; longer ones are clipped.
Surface is the frame's second job, and the reason panels do not paint their own base colour. A panel can only fill the rows it drew; the frame also owns the rows it did NOT draw — the blank padding under a short chat list, the empty-state views that go through lipgloss's own Height, and the whole column in single-panel mode. Painting in one place is what makes "no cell falls through to the terminal's default" true of the screen rather than of most of it.
Panels still paint their exceptions, and those win: cell.Fill reopens the surface before each span's own sequences, so a selected chat row that filled itself sel stays sel underneath a column filled with panel.
type Screen ¶
type Screen struct {
Layout layout.Layout
Roles theme.Roles
// TopBar and HintBar are already-rendered full-width rows. Empty when
// the layout says they are not shown.
TopBar string
HintBar string
// Body columns, left to right. A column with Width 0 is skipped along
// with its rule.
ChatList Column
Thread Column
Rail Column
}
Screen is everything the frame needs to draw.