tideui

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 23 Imported by: 5 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

tideui

A themeable, multi-pane terminal UI toolkit for Bubble Tea and Lipgloss.

tideui renders application-provided content inside themed pane shells, status bars, and overlays. It is deliberately view-oriented: your application keeps its own Bubble Tea model, key routing, persistence, and viewport state — you hand tideui strings and dimensions, and it returns a framed, themed view.

tideui three-pane layout and theme picker

Lineage

The three-pane layout, theme-preview workflow, and themed modal language began in Tide, a terminal RSS reader, and were refined in TideMail, a keyboard-first email client, and grew its workspace and plugin layer in TideDeck, a terminal dashboard. tideui packages those reusable primitives for any Bubble Tea application.

Install

go get github.com/allisonhere/tideui

Features

  • Five layout modes — StackedRight, ThreeColumn, SidebarOnly, Tabbed, and Floating, each with tunable ratios.
  • Nineteen built-in palettes (Catppuccin, Nord, Dracula, Gruvbox, and more) with per-field background/foreground/accent overrides.
  • Themed chrome — pane headers, status bars, centered modal overlays, and a ready-made theme picker.
  • Soft modal panels — Tide-family modal chrome with embedded border titles, quiet hint footers, and rail-focused rows.
  • Full-border pane focus — every pane renders a 4-sided border colored by focus state, contrast-boosted to a 7:1 floor (square or round corners) so the focused pane is never hard to spot.
  • List primitives — single-line Row and multi-line Block with selected/muted states.
  • Per-pane scrolling via Pane.ScrollOffset and the PaneScroller helper.
  • Resizable panes via the PaneRatio helper, for shift+arrow-style ratio adjustment.
  • Density + accessibility — compact/comfortable spacing and a VT52 ASCII mode.
  • Bounded output — never exceeds the requested terminal dimensions, down to tiny windows.
  • Terminal background control — exposes the escape sequences so the app, not the library, writes to the terminal.
  • A workspace layer — panes, focus traversal, zoom, peek, tab stacks, presets, undo/redo, mouse routing and versioned persistence, for an application that wants the whole shell rather than one framed view.
  • Chrome primitives — headers, footers, tabs, badges, key capsules, metrics, gauges, sparklines and list rows, in three densities.
  • Semantic colour — tones (good, warning, danger, muted, accent) resolved from the host's theme, plus contrast correction and hue helpers for themes an application builds itself.
  • Pictures in a pane — half-block rendering everywhere, with a kitty/Ghostty placeholder transport behind a capability gate.
  • Layout themes and per-pane styling — density, gauges, sparklines and full themes per pane, with the workspace-wide chrome intact.

Quick start

import "github.com/allisonhere/tideui"

theme, _ := tideui.ThemeByName("catppuccin-mocha")
renderer := tideui.NewRenderer(theme, tideui.StyleOptions{Density: tideui.Compact})

view := renderer.Render(tideui.Layout{
    Width: 80, Height: 24, Mode: tideui.StackedRight,
    Panes: [3]tideui.Pane{
        {Title: "Sidebar", Content: "Item one\nItem two", Focused: true},
        {Title: "List",    Content: "Welcome to tideui"},
        {Title: "Preview", Content: "Application-owned content."},
    },
    Status: &tideui.StatusBar{Left: "ready", Right: "? help"},
})

Bubble Tea integration

tideui owns no model state. Track dimensions and theme in your own model and build a renderer in View:

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    if size, ok := msg.(tea.WindowSizeMsg); ok {
        m.width, m.height = size.Width, size.Height
    }
    return m, nil
}

func (m model) View() string {
    r := tideui.NewRenderer(m.theme, tideui.StyleOptions{Density: m.density})
    return r.Render(tideui.Layout{
        Width: m.width, Height: m.height, Mode: tideui.ThreeColumn,
        Panes: m.panes(),
    })
}

Layout modes

Mode Description Ratio fields
StackedRight Pane 0 sidebar; panes 1 & 2 stacked on the right SidebarRatio, UpperRightRatio
ThreeColumn All three panes side by side ColumnRatios
SidebarOnly Pane 0 sidebar; pane 1 full-height main (pane 2 unused) SidebarRatio
Tabbed Tab bar on top; the focused pane fills the area below —
Floating Pane 0 as background; panes 1 & 2 as floating panels FloatWidthRatio, FloatHeightRatio
layout.Mode = tideui.StackedRight
layout.SidebarRatio, layout.UpperRightRatio = 0.30, 0.45

layout.Mode, layout.ColumnRatios = tideui.ThreeColumn, [3]float64{2, 3, 5}

In Tabbed mode the first Focused pane selects the active tab (falling back to pane 0). All ratio fields default to sensible values when left zero.

Theming

theme, ok := tideui.ThemeByName("nord")   // false if unknown
for _, t := range tideui.BuiltinThemes { /* ... */ }

BuiltinThemes holds 52 themes in 24 families (Catppuccin, Tokyo Night, Rosé Pine, Gruvbox, Solarized, Nightfox, Kanagawa, Ayu, GitHub, Nord, Dracula, One Dark Pro and more), grouped so that variants of a family are adjacent. The palettes are copied from each upstream project's source, with their licenses, and are defined in themes_collection.go. Theme.Family and Theme.Variant label them for pickers, and Theme.Label() joins the two.

Besides the twelve core colors, a theme can carry optional Success, Warning, Link, Quote, Match, Tag and Cursor roles. The SuccessColor(), WarningColor(), LinkColor(), QuoteColor(), TagColor(), MatchColor() and CursorColor() accessors return the role (or a color the theme already has when it is unset), lightness-adjusted by Legible to 4.5:1 on the background (3:1 for match and cursor). Palette values are never edited; only the accessors adjust.

Override individual colors without forking a palette:

theme = tideui.ThemeOverrides{
    Accent: "#f5c2e7",
}.Apply(tideui.CatppuccinMocha)

Theme.UsesASCII() reports VT52 mode (ASCII-only glyphs) so callers can adapt. StyleOptions{Density: tideui.Comfortable} adds spacing; Compact removes it.

Pane borders

Every pane renders a full 4-sided border, colored by theme Border when idle and BorderFocus (or Pane.Accent, if set) when focused. The focused color is nudged to clear a 7:1 contrast floor against the theme background, and the selected-row background (Styles.ItemSelected) is nudged to a 3:1 floor — both walk up in lightness steps rather than relying on a fixed delta, so neither goes unnoticeable on unusually light or dark themes.

Corners default to square; opt into rounded corners per-renderer:

tideui.NewRenderer(theme, tideui.StyleOptions{PaneCorners: tideui.RoundCorners})

Rows and blocks

RenderRow draws a single-line list item; RenderBlock adds an optional multi-line body (a Block with no Body is byte-identical to the matching Row). Both support Selected and Muted:

renderer.RenderRow(tideui.Row{Prefix: "* ", Text: "Item", Suffix: "12", Selected: true}, width)

renderer.RenderBlock(tideui.Block{
    Prefix: "● ", Header: "alice", Meta: "10:02",
    Body:   "Multi-line body, indented to the header.",
}, width)

For fully custom pane content, use the exported renderer.Styles (e.g. DetailTitle, DetailMeta, DetailBody).

Scrollable panes

Set Pane.ScrollOffset, or let PaneScroller manage it:

m.scroll.ScrollDown(1)            // ScrollUp / ScrollToTop also available
m.scroll.ClampTo(total, visible)  // optional; renderer clamps out-of-range anyway

pane.ScrollOffset = m.scroll.Offset()

CanScrollDown(total, visible) reports whether more content lies below.

Resizable panes

tideui still leaves key routing to the application, but PaneRatio owns the bounds and step math for an adjustable split — wire it to your own shift+arrow (or any other) key handling:

m.sidebarRatio = tideui.NewPaneRatio(tideui.PaneRatioOptions{
    Initial: 0.30, Min: 0.15, Max: 0.5, Step: 0.02,
})

// in Update, on your app's own resize keys:
m.sidebarRatio.Shrink() // e.g. shift+left
m.sidebarRatio.Grow()   // e.g. shift+right

// in View:
layout.SidebarRatio = m.sidebarRatio.Value()

Hold one PaneRatio per adjustable split — SidebarRatio, UpperRightRatio, a ColumnRatios entry, or a Floating ratio all work the same way.

Theme picker

A drop-in modal for previewing and confirming themes:

picker := tideui.NewThemePicker(tideui.ThemePickerOptions{InitialTheme: "nord"})
picker.Open("nord")

switch picker.Update(keyMsg) {
case tideui.ThemePickerConfirm:
    m.theme = picker.ConfirmedTheme()
case tideui.ThemePickerCancel:
    // preview reverted to the confirmed theme
}

overlay := picker.Modal(renderer, m.width, m.height) // assign to Layout.Modal

The picker previews live as you navigate and restores the confirmed theme on cancel.

Use the soft-panel variant for the newer Tide-family modal style:

overlay := picker.SoftModal(renderer, 42, m.height, "tidedock")

Soft panels

Soft panels render the newer Tide-family modal chrome with the app prefix and title embedded in the top border:

content := renderer.Styles.OverlayBody.Width(36).Render("Ready")
overlay := renderer.SoftPanelOverlay(tideui.SoftPanel{
    Prefix: "tidedock",
    Title: "status",
    Content: content,
    Width: 40,
})
layout.Modal = &overlay

Use RenderSoftRow for command palettes and picker rows, and RenderSoftHints for quiet lowercase footer hints.

Terminal background

tideui never writes to the terminal itself. To paint the terminal background to match the theme, fetch the sequences and emit them from your program:

set, reset := tideui.TerminalBackgroundSequences(theme)

Design

Applications retain ownership of their model, commands, key routing, persistence, and viewport state. tideui is purely presentational — it turns content + dimensions + a theme into a bounded, framed string. The one exception is the optional ThemePicker, which manages its own navigation once opened.

License

MIT.

Documentation

Overview

Package tideui renders themeable pane shells, status bars, overlays, theme pickers, and reusable row styles for Bubble Tea applications.

Applications own their domain state, persistence, and viewports, then pass rendered content into a Layout. For applications that want a managed, rearrangeable multi-panel surface, Workspace layers a declarative panel registry, a layout tree, semantic adaptive layout, focus, arrange/resize modes, tab stacks, zoom, peek, presets, history, mouse support, and versioned persistence on top of the same renderer and themes.

Index

Constants

View Source
const (
	// ThemeNameVT52 identifies the ASCII-style amber terminal theme.
	ThemeNameVT52 = "vt52"
	// ThemeNameVT100 identifies the green phosphor terminal theme.
	ThemeNameVT100 = "vt100"
)
View Source
const HeatGlyphs = "·∘○◉●"

HeatGlyphs is the default ramp for SparkHeat, smallest to largest.

View Source
const HeatGlyphsASCII = ".oO0@"

HeatGlyphsASCII replaces HeatGlyphs where the theme asks for ASCII.

View Source
const LayoutFormatVersion = 1

LayoutFormatVersion is the persisted layout schema version. It is bumped when the serialized shape changes so older or newer files can be migrated or rejected cleanly.

View Source
const StrokeGlyphs = "╴─━█"

StrokeGlyphs is the default ramp for SparkStroke, lightest to heaviest.

View Source
const StrokeGlyphsASCII = ".-=#"

StrokeGlyphsASCII replaces StrokeGlyphs where the theme asks for ASCII.

View Source
const WeightGlyphs = "╵╷│┃█"

WeightGlyphs is the default ramp for SparkWeighted, lightest to heaviest.

View Source
const WeightGlyphsASCII = ".:|#@"

WeightGlyphsASCII replaces WeightGlyphs where the theme asks for ASCII, keeping the sense of increasing weight.

Variables

View Source
var (
	// CatppuccinMocha is the Catppuccin Mocha palette.
	CatppuccinMocha = collectionTheme("catppuccin-mocha", "Catppuccin", "Mocha", palette{bg: "1e1e2e", fg: "cdd6f4", border: "6c7086", accent: "89b4fa", surface: "313244", muted: "7f849c", red: "f38ba8", green: "a6e3a1", yellow: "f9e2af", link: "74c7ec", quote: "94e2d5", tag: "cba6f7", match: "fab387", cursor: "f5e0dc"})
	// CatppuccinMacchiato is the Catppuccin Macchiato palette.
	CatppuccinMacchiato = collectionTheme("catppuccin-macchiato", "Catppuccin", "Macchiato", palette{bg: "24273a", fg: "cad3f5", border: "6e738d", accent: "8aadf4", surface: "363a4f", muted: "8087a2", red: "ed8796", green: "a6da95", yellow: "eed49f", link: "7dc4e4", quote: "8bd5ca", tag: "c6a0f6", match: "f5a97f", cursor: "f4dbd6"})
	// CatppuccinFrappe is the Catppuccin Frappé palette.
	CatppuccinFrappe = collectionTheme("catppuccin-frappe", "Catppuccin", "Frappé", palette{bg: "303446", fg: "c6d0f5", border: "737994", accent: "8caaee", surface: "414559", muted: "838ba7", red: "e78284", green: "a6d189", yellow: "e5c890", link: "85c1dc", quote: "81c8be", tag: "ca9ee6", match: "ef9f76", cursor: "f2d5cf"})
	// CatppuccinLatte is the Catppuccin Latte palette.
	CatppuccinLatte = collectionTheme("catppuccin-latte", "Catppuccin", "Latte", palette{bg: "eff1f5", fg: "4c4f69", border: "9ca0b0", accent: "1e66f5", surface: "ccd0da", muted: "8c8fa1", red: "d20f39", green: "40a02b", yellow: "df8e1d", link: "209fb5", quote: "179299", tag: "8839ef", match: "fe640b", cursor: "dc8a78"})
)

Catppuccin — https://github.com/catppuccin/palette (MIT).

View Source
var (
	// OneDark is the One Dark Pro palette.
	OneDark = collectionTheme("one-dark", "One Dark", "Pro", palette{bg: "282c34", fg: "abb2bf", border: "3e4452", accent: "61afef", surface: "21252b", muted: "5c6370", red: "e05561", green: "8cc265", yellow: "d19a66", link: "42b3c2", quote: "4aa5f0", tag: "c162de", match: "d19a66", cursor: "528bff"})
	// OneDarkDarker is the One Dark Pro Darker palette.
	OneDarkDarker = collectionTheme("one-dark-darker", "One Dark", "Pro Darker", palette{bg: "23272e", fg: "abb2bf", border: "3e4452", accent: "61afef", surface: "1e2227", muted: "5c6370", red: "e05561", green: "8cc265", yellow: "d19a66", link: "42b3c2", quote: "4aa5f0", tag: "c162de", match: "d19a66", cursor: "528bff"})
)

One Dark — https://github.com/Binaryify/OneDark-Pro (MIT).

View Source
var (
	// TokyoNight is the Tokyo Night Night palette.
	TokyoNight = collectionTheme("tokyo-night", "Tokyo Night", "Night", palette{bg: "1a1b26", fg: "c0caf5", border: "414868", accent: "7aa2f7", surface: "16161e", muted: "565f89", red: "f7768e", green: "9ece6a", yellow: "e0af68", link: "7dcfff", quote: "73daca", tag: "bb9af7", match: "ff9e64", cursor: "c0caf5"})
	// TokyoNightStorm is the Tokyo Night Storm palette.
	TokyoNightStorm = collectionTheme("tokyo-night-storm", "Tokyo Night", "Storm", palette{bg: "24283b", fg: "c0caf5", border: "414868", accent: "7aa2f7", surface: "1f2335", muted: "565f89", red: "f7768e", green: "9ece6a", yellow: "e0af68", link: "7dcfff", quote: "73daca", tag: "bb9af7", match: "ff9e64", cursor: "c0caf5"})
	// TokyoNightMoon is the Tokyo Night Moon palette.
	TokyoNightMoon = collectionTheme("tokyo-night-moon", "Tokyo Night", "Moon", palette{bg: "222436", fg: "c8d3f5", border: "444a73", accent: "82aaff", surface: "1e2030", muted: "636da6", red: "ff757f", green: "c3e88d", yellow: "ffc777", link: "86e1fc", quote: "4fd6be", tag: "c099ff", match: "ff966c", cursor: "c8d3f5"})
	// TokyoNightDay is the Tokyo Night Day palette.
	TokyoNightDay = collectionTheme("tokyo-night-day", "Tokyo Night", "Day", palette{bg: "e1e2e7", fg: "3760bf", border: "a1a6c5", accent: "2e7de9", surface: "d0d5e3", muted: "848cb5", red: "f52a65", green: "587539", yellow: "8c6c3e", link: "007197", quote: "118c74", tag: "9854f1", match: "b15c00", cursor: "3760bf"})
)

Tokyo Night — https://github.com/folke/tokyonight.nvim (Apache-2.0).

View Source
var (
	// Dracula is the Dracula Dracula palette.
	Dracula = collectionTheme("dracula", "Dracula", "Dracula", palette{bg: "282a36", fg: "f8f8f2", border: "6272a4", accent: "bd93f9", surface: "44475a", muted: "6272a4", red: "ff5555", green: "50fa7b", yellow: "f1fa8c", link: "8be9fd", quote: "6272a4", tag: "ff79c6", match: "ffb86c", cursor: "f8f8f2"})
	// DraculaAlucard is the Dracula Alucard palette.
	DraculaAlucard = collectionTheme("dracula-alucard", "Dracula", "Alucard", palette{bg: "fffbeb", fg: "1f1f1f", border: "cfcfde", accent: "644ac9", surface: "cfcfde", muted: "6c664b", red: "cb3a2a", green: "14710a", yellow: "846e15", link: "036a96", quote: "6c664b", tag: "a3144d", match: "a34d14", cursor: "1f1f1f"})
)

Dracula — https://github.com/dracula/dracula-theme (MIT).

View Source
var (
	// GithubDark is the GitHub Dark palette.
	GithubDark = collectionTheme("github-dark", "GitHub", "Dark", palette{bg: "0d1117", fg: "c9d1d9", border: "30363d", accent: "58a6ff", surface: "161b22", muted: "8b949e", red: "f85149", green: "3fb950", yellow: "d29922", link: "58a6ff", quote: "8b949e", tag: "a371f7", match: "d29922", cursor: "c9d1d9"})
	// GithubDarkDimmed is the GitHub Dark Dimmed palette.
	GithubDarkDimmed = collectionTheme("github-dark-dimmed", "GitHub", "Dark Dimmed", palette{bg: "22272e", fg: "adbac7", border: "444c56", accent: "539bf5", surface: "2d333b", muted: "768390", red: "e5534b", green: "57ab5a", yellow: "c69026", link: "539bf5", quote: "768390", tag: "986ee2", match: "c69026", cursor: "adbac7"})
	// GithubLight is the GitHub Light palette.
	GithubLight = collectionTheme("github-light", "GitHub", "Light", palette{bg: "ffffff", fg: "24292f", border: "d0d7de", accent: "0969da", surface: "f6f8fa", muted: "57606a", red: "cf222e", green: "1a7f37", yellow: "9a6700", link: "0969da", quote: "57606a", tag: "8250df", match: "9a6700", cursor: "24292f"})
)

GitHub — https://github.com/primer/github-vscode-theme (MIT).

View Source
var (
	// GruvboxDark is the Gruvbox Dark palette.
	GruvboxDark = collectionTheme("gruvbox-dark", "Gruvbox", "Dark", palette{bg: "282828", fg: "ebdbb2", border: "665c54", accent: "83a598", surface: "3c3836", muted: "928374", red: "fb4934", green: "b8bb26", yellow: "fabd2f", link: "83a598", quote: "8ec07c", tag: "d3869b", match: "fe8019", cursor: "ebdbb2"})
	// GruvboxLight is the Gruvbox Light palette.
	GruvboxLight = collectionTheme("gruvbox-light", "Gruvbox", "Light", palette{bg: "fbf1c7", fg: "3c3836", border: "bdae93", accent: "076678", surface: "ebdbb2", muted: "7c6f64", red: "9d0006", green: "79740e", yellow: "b57614", link: "076678", quote: "427b58", tag: "8f3f71", match: "af3a03", cursor: "3c3836"})
)

Gruvbox — https://github.com/morhetz/gruvbox (MIT).

View Source
var (
	// RosePine is the Rosé Pine Main palette.
	RosePine = collectionTheme("rose-pine", "Rosé Pine", "Main", palette{bg: "191724", fg: "e0def4", border: "403d52", accent: "c4a7e7", surface: "1f1d2e", muted: "6e6a86", red: "eb6f92", green: "9ccfd8", yellow: "f6c177", link: "9ccfd8", quote: "908caa", tag: "ebbcba", match: "f6c177", cursor: "e0def4"})
	// RosePineMoon is the Rosé Pine Moon palette.
	RosePineMoon = collectionTheme("rose-pine-moon", "Rosé Pine", "Moon", palette{bg: "232136", fg: "e0def4", border: "44415a", accent: "c4a7e7", surface: "2a273f", muted: "6e6a86", red: "eb6f92", green: "9ccfd8", yellow: "f6c177", link: "9ccfd8", quote: "908caa", tag: "ea9a97", match: "f6c177", cursor: "e0def4"})
	// RosePineDawn is the Rosé Pine Dawn palette.
	RosePineDawn = collectionTheme("rose-pine-dawn", "Rosé Pine", "Dawn", palette{bg: "faf4ed", fg: "464261", border: "cecacd", accent: "907aa9", surface: "fffaf3", muted: "9893a5", red: "b4637a", green: "56949f", yellow: "ea9d34", link: "56949f", quote: "797593", tag: "d7827e", match: "ea9d34", cursor: "464261"})
)

Rosé Pine — https://github.com/rose-pine/neovim (MIT).

View Source
var (
	// KanagawaWave is the Kanagawa Wave palette.
	KanagawaWave = collectionTheme("kanagawa-wave", "Kanagawa", "Wave", palette{bg: "1f1f28", fg: "dcd7ba", border: "54546d", accent: "7e9cd8", surface: "2a2a37", muted: "727169", red: "e46876", green: "98bb6c", yellow: "e6c384", link: "7fb4ca", quote: "7aa89f", tag: "957fb8", match: "ffa066", cursor: "c8c093"})
	// KanagawaDragon is the Kanagawa Dragon palette.
	KanagawaDragon = collectionTheme("kanagawa-dragon", "Kanagawa", "Dragon", palette{bg: "181616", fg: "c5c9c5", border: "625e5a", accent: "8ba4b0", surface: "282727", muted: "737c73", red: "c4746e", green: "87a987", yellow: "c4b28a", link: "949fb5", quote: "8ea4a2", tag: "a292a3", match: "b6927b", cursor: "c8c093"})
	// KanagawaLotus is the Kanagawa Lotus palette.
	KanagawaLotus = collectionTheme("kanagawa-lotus", "Kanagawa", "Lotus", palette{bg: "f2ecbc", fg: "545464", border: "8a8980", accent: "4d699b", surface: "e7dba0", muted: "716e61", red: "c84053", green: "6f894e", yellow: "77713f", link: "4e8ca2", quote: "597b75", tag: "766b90", match: "cc6d00", cursor: "43436c"})
)

Kanagawa — https://github.com/rebelot/kanagawa.nvim (MIT).

View Source
var (
	// SolarizedDark is the Solarized Dark palette.
	SolarizedDark = collectionTheme("solarized-dark", "Solarized", "Dark", palette{bg: "002b36", fg: "93a1a1", border: "586e75", accent: "268bd2", surface: "073642", muted: "586e75", red: "dc322f", green: "859900", yellow: "b58900", link: "268bd2", quote: "2aa198", tag: "6c71c4", match: "cb4b16", cursor: "93a1a1"})
	// SolarizedLight is the Solarized Light palette.
	SolarizedLight = collectionTheme("solarized-light", "Solarized", "Light", palette{bg: "fdf6e3", fg: "586e75", border: "93a1a1", accent: "268bd2", surface: "eee8d5", muted: "93a1a1", red: "dc322f", green: "859900", yellow: "b58900", link: "268bd2", quote: "2aa198", tag: "6c71c4", match: "cb4b16", cursor: "586e75"})
)

Solarized — https://github.com/altercation/solarized (MIT).

View Source
var (
	// EverforestDark is the Everforest Dark palette.
	EverforestDark = collectionTheme("everforest-dark", "Everforest", "Dark", palette{bg: "2d353b", fg: "d3c6aa", border: "7a8478", accent: "7fbbb3", surface: "343f44", muted: "859289", red: "e67e80", green: "a7c080", yellow: "dbbc7f", link: "7fbbb3", quote: "83c092", tag: "d699b6", match: "e69875", cursor: "d3c6aa"})
	// EverforestLight is the Everforest Light palette.
	EverforestLight = collectionTheme("everforest-light", "Everforest", "Light", palette{bg: "fdf6e3", fg: "5c6a72", border: "a6b0a0", accent: "3a94c5", surface: "f4f0d9", muted: "939f91", red: "f85552", green: "8da101", yellow: "dfa000", link: "3a94c5", quote: "35a77c", tag: "df69ba", match: "f57d26", cursor: "5c6a72"})
)

Everforest — https://github.com/sainnhe/everforest (MIT).

View Source
var (
	// Nightfox is the Nightfox Nightfox palette.
	Nightfox = collectionTheme("nightfox", "Nightfox", "Nightfox", palette{bg: "192330", fg: "cdcecf", border: "39506d", accent: "719cd6", surface: "131a24", muted: "738091", red: "c94f6d", green: "81b29a", yellow: "dbc074", link: "63cdcf", quote: "81b29a", tag: "9d79d6", match: "f4a261", cursor: "cdcecf"})
	// Dayfox is the Nightfox Dayfox palette.
	Dayfox = collectionTheme("dayfox", "Nightfox", "Dayfox", palette{bg: "f6f2ee", fg: "3d2b5a", border: "aab0ad", accent: "2848a9", surface: "e4dcd4", muted: "837a72", red: "a5222f", green: "396847", yellow: "ac5402", link: "287980", quote: "396847", tag: "6e33ce", match: "955f61", cursor: "3d2b5a"})
	// Dawnfox is the Nightfox Dawnfox palette.
	Dawnfox = collectionTheme("dawnfox", "Nightfox", "Dawnfox", palette{bg: "faf4ed", fg: "575279", border: "bdbfc9", accent: "286983", surface: "ebe5df", muted: "9893a5", red: "b4637a", green: "618774", yellow: "ea9d34", link: "56949f", quote: "618774", tag: "907aa9", match: "d7827e", cursor: "575279"})
	// Duskfox is the Nightfox Duskfox palette.
	Duskfox = collectionTheme("duskfox", "Nightfox", "Duskfox", palette{bg: "232136", fg: "e0def4", border: "4b4673", accent: "569fba", surface: "191726", muted: "817c9c", red: "eb6f92", green: "a3be8c", yellow: "f6c177", link: "9ccfd8", quote: "a3be8c", tag: "c4a7e7", match: "ea9a97", cursor: "e0def4"})
	// Nordfox is the Nightfox Nordfox palette.
	Nordfox = collectionTheme("nordfox", "Nightfox", "Nordfox", palette{bg: "2e3440", fg: "cdcecf", border: "5a657d", accent: "81a1c1", surface: "232831", muted: "60728a", red: "bf616a", green: "a3be8c", yellow: "ebcb8b", link: "88c0d0", quote: "a3be8c", tag: "b48ead", match: "c9826b", cursor: "cdcecf"})
	// Terafox is the Nightfox Terafox palette.
	Terafox = collectionTheme("terafox", "Nightfox", "Terafox", palette{bg: "152528", fg: "e6eaea", border: "2d4f56", accent: "5a93aa", surface: "0f1c1e", muted: "6d7f8b", red: "e85c51", green: "7aa4a1", yellow: "fda47f", link: "a1cdd8", quote: "7aa4a1", tag: "ad5c7c", match: "ff8349", cursor: "e6eaea"})
	// Carbonfox is the Nightfox Carbonfox palette.
	Carbonfox = collectionTheme("carbonfox", "Nightfox", "Carbonfox", palette{bg: "161616", fg: "f2f4f8", border: "525253", accent: "78a9ff", surface: "2a2a2a", muted: "6e6f70", red: "ee5396", green: "25be6a", yellow: "08bdba", link: "33b1ff", quote: "3ddbd9", tag: "be95ff", match: "ff7eb6", cursor: "f2f4f8"})
)

Nightfox — https://github.com/EdenEast/nightfox.nvim (MIT).

View Source
var (
	// AyuDark is the Ayu Dark palette.
	AyuDark = collectionTheme("ayu-dark", "Ayu", "Dark", palette{bg: "10141c", fg: "bfbdb6", border: "5a6378", accent: "e6b450", surface: "0d1017", muted: "5a6378", red: "f06b73", green: "70bf56", yellow: "e6b450", link: "4fbfff", quote: "93e2c8", tag: "d0a1ff", match: "fdb04c", cursor: "bfbdb6"})
	// AyuMirage is the Ayu Mirage palette.
	AyuMirage = collectionTheme("ayu-mirage", "Ayu", "Mirage", palette{bg: "242936", fg: "cccac2", border: "707a8c", accent: "ffcc66", surface: "1f2430", muted: "707a8c", red: "f28273", green: "87d96c", yellow: "ffcc66", link: "6acdff", quote: "93e2c8", tag: "ddbbff", match: "fcca60", cursor: "cccac2"})
	// AyuLight is the Ayu Light palette.
	AyuLight = collectionTheme("ayu-light", "Ayu", "Light", palette{bg: "fcfcfc", fg: "5c6166", border: "828e9f", accent: "f29718", surface: "ebeef0", muted: "828e9f", red: "f06b6c", green: "6cbf43", yellow: "e7a100", link: "21a1e2", quote: "4abc96", tag: "a176cb", match: "f29718", cursor: "5c6166"})
)

Ayu — https://github.com/ayu-theme/vscode-ayu (MIT).

View Source
var (
	// NightOwl is the Night Owl Night Owl palette.
	NightOwl = collectionTheme("night-owl", "Night Owl", "Night Owl", palette{bg: "011627", fg: "d6deeb", border: "5f7e97", accent: "82aaff", surface: "0b2942", muted: "637777", red: "ef5350", green: "22da6e", yellow: "ecc48d", link: "82aaff", quote: "21c7a8", tag: "c792ea", match: "f78c6c", cursor: "80a4c2"})
	// NightOwlLight is the Night Owl Light palette.
	NightOwlLight = collectionTheme("night-owl-light", "Night Owl", "Light", palette{bg: "fbfbfb", fg: "403f53", border: "93a1a1", accent: "288ed7", surface: "f0f0f0", muted: "989fb1", red: "de3d3b", green: "08916a", yellow: "e0af02", link: "288ed7", quote: "2aa298", tag: "d6438a", match: "daaa01", cursor: "403f53"})
)

Night Owl — https://github.com/sdras/night-owl-vscode-theme (MIT).

View Source
var (
	// OxocarbonDark is the Oxocarbon Dark palette.
	OxocarbonDark = collectionTheme("oxocarbon-dark", "Oxocarbon", "Dark", palette{bg: "161616", fg: "f2f2f2", border: "525252", accent: "78a9ff", surface: "262626", muted: "878d96", red: "ee5396", green: "42be65", yellow: "ff7eb6", link: "33b1ff", quote: "08bdba", tag: "be95ff", match: "3ddbd9", cursor: "f2f2f2"})
	// OxocarbonLight is the Oxocarbon Light palette.
	OxocarbonLight = collectionTheme("oxocarbon-light", "Oxocarbon", "Light", palette{bg: "ffffff", fg: "525252", border: "90a4ae", accent: "0f62fe", surface: "f2f2f2", muted: "90a4ae", red: "ee5396", green: "42be65", yellow: "ff6f00", link: "0f62fe", quote: "08bdba", tag: "673ab7", match: "ffab91", cursor: "525252"})
)

Oxocarbon — https://github.com/nyoom-engineering/oxocarbon.nvim (MIT).

View Source
var (
	// Cyberdream is the Cyberdream Dark palette.
	Cyberdream = collectionTheme("cyberdream", "Cyberdream", "Dark", palette{bg: "16181a", fg: "ffffff", border: "3c4048", accent: "5ea1ff", surface: "1e2124", muted: "7b8496", red: "ff6e5e", green: "5eff6c", yellow: "f1ff5e", link: "5ef1ff", quote: "7b8496", tag: "ff5ef1", match: "ffbd5e", cursor: "ffffff"})
	// CyberdreamLight is the Cyberdream Light palette.
	CyberdreamLight = collectionTheme("cyberdream-light", "Cyberdream", "Light", palette{bg: "ffffff", fg: "16181a", border: "acacac", accent: "0057d1", surface: "eaeaea", muted: "7b8496", red: "d11500", green: "008b0c", yellow: "997b00", link: "008c99", quote: "7b8496", tag: "d100bf", match: "d17c00", cursor: "16181a"})
)

Cyberdream — https://github.com/scottmckendry/cyberdream.nvim (MIT).

View Source
var (
	// MagentaGeode is an original dark mineral palette: deep plum with polished
	// magenta, fuchsia and violet highlights.
	MagentaGeode = Theme{
		Name: "magenta-geode", Family: "Magenta Geode", Bg: "#47003c", Fg: "#f3b0dc", Border: "#aa4d84", BorderFocus: "#c83fa9",
		Selected: "#c83fa9", Unread: "#f3b0dc", Dimmed: "#77176e", StatusBar: "#77176e",
		StatusFg: "#f3b0dc", Error: "#ff7062", Overlay: "#77176e", OverlayBorder: "#c83fa9",
		Success: "#6ee7b7", Warning: "#f9c74f", Link: "#c9a0ff", Quote: "#d98cc2",
		Match: "#ffb86b", Tag: "#e07bff", Cursor: "#f3b0dc",
	}
	// CoralSunset is an original dark coastal-sunset palette: coral, salmon,
	// peach and rose-gold over a muted dusk purple.
	CoralSunset = Theme{
		Name: "coral-sunset", Family: "Coral Sunset", Bg: "#444154", Fg: "#fec9c1", Border: "#fc8b79", BorderFocus: "#ff7062",
		Selected: "#ff7062", Unread: "#fec9c1", Dimmed: "#7a637f", StatusBar: "#7a637f",
		StatusFg: Legible("#fec9c1", "#7a637f", 4.5), Error: "#ff7062", Overlay: "#7a637f", OverlayBorder: "#ff7062",
		Success: "#8fd9a8", Warning: "#ffd08a", Link: "#8fd3ff", Quote: "#e8a8a0",
		Match: "#ffd08a", Tag: "#ff9eb5", Cursor: "#fec9c1",
	}
	// LavenderFieldsForever is an original gentle lilac palette with heather
	// purple and soft violet accents over readable neutral text.
	LavenderFieldsForever = Theme{
		Name: "lavender-fields-forever", Family: "Lavender Fields Forever", Bg: "#382d72", Fg: "#e5ccf4", Border: "#b7c2c6",
		BorderFocus: "#a080e1", Selected: "#a080e1", Unread: "#e5ccf4", Dimmed: "#5c509c",
		StatusBar: "#5c509c", StatusFg: "#e5ccf4", Error: "#ff7062", Overlay: "#5c509c",
		OverlayBorder: "#a080e1",
		Success:       "#9be8c0", Warning: "#f5d98a", Link: "#c5b3ff", Quote: "#b7a8e6",
		Match: "#f5d98a", Tag: "#d9a8f5", Cursor: "#e5ccf4",
	}
	// VT100 is a classic green phosphor palette on black, with dim and bright
	// green levels. It is an aesthetic preset, not a CRT effect.
	VT100 = Theme{
		Name: ThemeNameVT100, Family: "VT100", Bg: "#000000", Fg: "#33ff33", Border: "#145214", BorderFocus: "#00ff00",
		Selected: "#00ff00", Unread: "#66ff66", Dimmed: "#3dcc3d", StatusBar: "#001a00",
		StatusFg: "#33ff33", Error: "#ff6b6b", Overlay: "#001200", OverlayBorder: "#00ff00",
		Success: "#66ff66", Warning: "#d6ff5c", Link: "#66ff66", Quote: "#2fb82f",
		Match: "#00ff00", Tag: "#99ff99", Cursor: "#33ff33",
	}
	// VT52 is an amber-monitor-inspired palette: warm golden text on charcoal
	// black with muted bronze accents and ASCII presentation. It is an aesthetic
	// preset, not a claim about the colors of any historical VT52 display.
	VT52 = Theme{
		Name: ThemeNameVT52, Family: "VT52", Bg: "#14110d", Fg: "#ffcc66", Border: "#6b4e14", BorderFocus: "#ffb020",
		Selected: "#ffb020", Unread: "#ffe6a8", Dimmed: "#a67c2e", StatusBar: "#1f1810",
		StatusFg: "#ffcc66", Error: "#ff6666", Overlay: "#1a140d", OverlayBorder: "#ffb020",
		Success: "#ffe6a8", Warning: "#ffb020", Link: "#ffe6a8", Quote: "#a67c2e",
		Match: "#ffb020", Tag: "#cc9a3c", Cursor: "#ffcc66",
	}
)

Retro and original palettes.

BuiltinThemes contains the palettes supplied by the library, grouped by family. The first entry is the default for unknown names.

View Source
var ErrNoStore = errors.New("tideui: workspace persistence is not configured")

ErrNoStore is returned by Persist when persistence has no backing store.

View Source
var (
	// Nord is the Nord Nord palette.
	Nord = collectionTheme("nord", "Nord", "Nord", palette{bg: "2e3440", fg: "d8dee9", border: "4c566a", accent: "88c0d0", surface: "3b4252", muted: "4c566a", red: "bf616a", green: "a3be8c", yellow: "ebcb8b", link: "81a1c1", quote: "8fbcbb", tag: "b48ead", match: "d08770", cursor: "d8dee9"})
)

Nord — https://github.com/nordtheme/nord (MIT).

View Source
var (
	// Palenight is the Palenight Palenight palette.
	Palenight = collectionTheme("palenight", "Palenight", "Palenight", palette{bg: "292d3e", fg: "bfc7d5", border: "676e95", accent: "82aaff", surface: "282c3d", muted: "676e95", red: "ff5572", green: "a9c77d", yellow: "ffcb6b", link: "89ddff", quote: "89ddff", tag: "c792ea", match: "f78c6c", cursor: "bfc7d5"})
)

Palenight — https://github.com/whizkydee/vscode-palenight-theme (MIT).

View Source
var (
	// ShadesOfPurple is the Shades of Purple Shades of Purple palette.
	ShadesOfPurple = collectionTheme("shades-of-purple", "Shades of Purple", "Shades of Purple", palette{bg: "2d2b55", fg: "ffffff", border: "1e1e3f", accent: "b362ff", surface: "222244", muted: "a599e9", red: "ec3a37", green: "3ad900", yellow: "fad000", link: "b362ff", quote: "80fcff", tag: "ff2c70", match: "ff7300", cursor: "fad000"})
)

Shades of Purple — https://github.com/ahmadawais/shades-of-purple-vscode (MIT).

View Source
var (
	// Synthwave84 is the SynthWave '84 SynthWave '84 palette.
	Synthwave84 = collectionTheme("synthwave-84", "SynthWave '84", "SynthWave '84", palette{bg: "262335", fg: "ffffff", border: "495495", accent: "ff7edb", surface: "241b2f", muted: "848bbd", red: "fe4450", green: "72f1b8", yellow: "fede5d", link: "36f9f6", quote: "03edf9", tag: "b893ce", match: "f97e72", cursor: "ffffff"})
)

SynthWave '84 — https://github.com/robb0wen/synthwave-vscode (MIT).

Functions

func AccentReadableOn added in v0.2.3

func AccentReadableOn(accent, bg lipgloss.Color, minRatio float64) lipgloss.Color

AccentReadableOn keeps an accent's hue while moving its lightness until it clears minRatio against bg. Unlike ReadableText it never falls back to black or white: an accent that loses its hue stops being an accent. A colour that cannot reach the ratio is returned as close as it got.

func AdjustLightness added in v0.2.3

func AdjustLightness(c lipgloss.Color, delta float64) lipgloss.Color

AdjustLightness moves a colour's HSL lightness by delta, clamped to [0,1].

func CellAspectOf added in v0.2.3

func CellAspectOf(file *os.File) float64

CellAspectOf is CellSizeOf as the ratio an image is sized by: how many times taller a cell is than it is wide. Most fonts land near 2 (a 7x15 cell, an 8x17 cell), which is what a zero here means: a pty with no emulator behind it, a window whose pixel size is not known yet, or a terminal that does not report pixels at all.

func CellSizeOf added in v0.2.3

func CellSizeOf(file *os.File) (width, height float64)

CellSizeOf measures a terminal's cell in pixels, and reports 0, 0 when the terminal will not say: the ioctl reports the window in pixels in the same call that reports its size in cells, and a pty with no emulator behind it reports zeros.

func Composite added in v0.2.3

func Composite(base, over image.Image) image.Image

Composite lays one picture over another, source over: where the top picture is transparent the bottom one shows through, and where it is solid the top one wins. It is how a radar frame - which is nothing at all except where it rains - is drawn over a map, and it is the whole reason fetching a basemap is worth anything.

The result is the base's size. A nil base is the picture on top, which is the everyday case when there is no backdrop. A top picture that is not the base's size is a caller's bug, and the *top* picture is returned: it is the one carrying the data, and a panel that briefly draws yesterday's backdrop on its own is worse than one that briefly draws its data without one.

func Continuous added in v0.2.3

func Continuous(style lipgloss.Style, text string) string

Continuous re-applies style's colour attributes after every reset in text, adding no layout of its own. Use it when the padding, width or placement is already handled and only the background continuity is missing; otherwise prefer StyleOver.

Text with no styling is returned unchanged, as is any text rendered under a colour profile that strips styling.

func ContinuousBackground added in v0.2.3

func ContinuousBackground(text string, background lipgloss.Color) string

ContinuousBackground is Continuous for a bare background colour, for fills that have no style value to borrow from.

func ContrastRatio added in v0.2.3

func ContrastRatio(a, b lipgloss.Color) float64

ContrastRatio returns the WCAG contrast ratio between two colours, from 1 (identical) to 21 (black on white). Unparseable colours return 1.

func DefaultHeatBands added in v0.2.3

func DefaultHeatBands() []float64

DefaultHeatBands are the upper bounds of each heat band, as fractions of full scale: 0-20%, 21-40%, 41-60%, 61-80%, 81-100%.

func DefaultStrokeBands added in v0.2.3

func DefaultStrokeBands() []float64

DefaultStrokeBands are the upper bounds of each stroke band: 0-25%, 26-50%, 51-75%, 76-100%.

func Duotone added in v0.2.3

func Duotone(source image.Image, paper, ink color.RGBA) image.Image

Duotone re-inks a picture in two colours by luminance, which is how a paper map is drawn on dark glass: the paper becomes the background, the ink becomes the light, and the map ends up in the theme's own colours rather than in a sheet of white.

It is for maps made of ink on paper - a topographic sheet, a street map - and not for imagery, which is already its own colours.

func HeadlineRows added in v0.2.3

func HeadlineRows(items []Headline, width int, detail bool) []int

HeadlineRows reports, for the headline list at a width, the story index on each content row (-1 for the blank row between stories). It shares the renderer's wrapping so a panel can map a click back to a story without rendering.

func Hue added in v0.2.3

func Hue(c lipgloss.Color) (degrees, saturation float64, ok bool)

Hue returns a colour's hue in degrees (0-360) and its saturation (0-1). ok is false for a colour that is not a parseable hex value. A greyscale colour reports a hue of 0 with a saturation of 0, which is what callers need to recognise a palette that has no colour to vary.

func IsDark added in v0.2.3

func IsDark(c lipgloss.Color) bool

IsDark reports whether a colour is dark enough to want light text on it.

func LayoutContainsPanel added in v0.2.3

func LayoutContainsPanel(root LayoutNode, id string) bool

LayoutContainsPanel reports whether the tree references id.

func LayoutPanelIDs added in v0.2.3

func LayoutPanelIDs(root LayoutNode) []string

LayoutPanelIDs returns every panel referenced by a tree, in traversal order, including duplicates exactly once each.

func LayoutString added in v0.2.3

func LayoutString(root LayoutNode) string

LayoutString renders a tree as an indented debug view, used in tests.

func Legible added in v0.3.0

func Legible(c, bg lipgloss.Color, minimum float64) lipgloss.Color

Legible returns c unchanged when it already reaches minimum contrast against bg, and otherwise moves its lightness (keeping hue and saturation) away from bg just far enough to reach it. Palettes copied from editor themes often use accent colors that are fine for syntax but under 4.5:1 as text; this keeps their identity while making text roles readable.

func MetricPlotWidth added in v0.2.3

func MetricPlotWidth(total, labelWidth, valueWidth int) int

MetricPlotWidth returns the room left for a gauge given the row's fixed columns.

func Mix added in v0.2.3

func Mix(a, b color.RGBA, t float64) color.RGBA

Mix blends one colour into another: t of 0 is all of a, t of 1 is all of b. It is how a colour is derived from the theme rather than written into the code - a map's line colour is the theme's background lifted towards its text, not a grey somebody picked.

func MixColors added in v0.2.3

func MixColors(base, tint lipgloss.Color, amount float64) lipgloss.Color

MixColors blends tint into base by amount, where 0 is base and 1 is tint.

func MutedText added in v0.2.3

func MutedText(text, bg lipgloss.Color) lipgloss.Color

MutedText returns a de-emphasised version of text that still clears the toolkit's floor for secondary content against bg.

func RGBAOf added in v0.2.3

func RGBAOf(c lipgloss.Color) color.RGBA

RGBAOf reads a theme colour back as RGBA, so a panel background can be composited onto. hexToRGB is the helper the contrast code already uses (color.go:45) and it returns 0..1 channels, or ok false for a named colour.

func ReadableText added in v0.2.3

func ReadableText(preferred, bg lipgloss.Color, minimum float64) lipgloss.Color

ReadableText returns preferred when it clears minimum against bg, and otherwise the nearest of black or white that does.

func Resample added in v0.2.3

func Resample(source image.Image, width, height int) image.Image

Resample scales a picture to a new size, bilinear. Something has to interpolate when imagery of a fixed resolution meets a pane of whatever size, and a photograph of terrain is exactly the case where nearest neighbour shows.

func ResampleInto added in v0.2.3

func ResampleInto(source image.Image, from image.Rectangle, width, height int) image.Image

ResampleInto scales one rectangle of a picture into a new width by height one: a map crop is a resample of the middle of a block of tiles, not of the whole block.

The arithmetic is done on premultiplied channels, which is what every image in Go hands out, so a partly transparent pixel stays partly transparent and a composite over it comes out right.

func ResponsiveWidth added in v0.2.3

func ResponsiveWidth(panel *Panel) int

ResponsiveWidth returns the width at which a panel's most severe explicit rule triggers, or 0 when it has none. Used by tests and diagnostics.

func ShiftHue added in v0.2.3

func ShiftHue(c lipgloss.Color, degrees float64) lipgloss.Color

ShiftHue rotates a colour around the colour wheel by degrees, keeping its saturation and lightness. It is the companion to AdjustLightness for building a set of related colours — a graph's lanes, a chart's series — that belong to the same palette instead of being picked arbitrarily.

A greyscale colour has no hue to rotate and is returned unchanged, so a monochrome theme cannot be turned into a colourful one by accident.

func StyleOver added in v0.2.3

func StyleOver(style lipgloss.Style, text string) string

StyleOver renders text with style, keeping style's own attributes continuous across any styling text already carries.

Use it anywhere caller-supplied or multi-segment content is rendered through a style with a background. For plain text it is identical to style.Render.

func SurfaceForRatio added in v0.2.3

func SurfaceForRatio(bg lipgloss.Color, minRatio float64) lipgloss.Color

SurfaceForRatio returns a colour derived from bg that clears minRatio against it, for a status bar or overlay that would otherwise be invisible against the page behind it.

func TerminalBackgroundSequences

func TerminalBackgroundSequences(theme Theme) (set string, reset string)

TerminalBackgroundSequences returns OSC strings; the consumer decides where to write them.

func VisibleRange added in v0.2.3

func VisibleRange(total, cursor, limit int) (int, int)

VisibleRange returns the half-open window of rows to draw so that cursor stays visible: centred on the cursor, clamped to the ends, and the whole range when it fits. It is exported because every scrolling list wants the same answer, and the alternative is each one growing its own copy that drifts - which is exactly what had already happened.

Types

type ActionHandler added in v0.2.3

type ActionHandler func(*Workspace)

ActionHandler runs a panel or workspace action. Running an action never mutates layout directly unless it calls back into the workspace; this keeps application data changes out of layout undo history.

type AgendaItem added in v0.2.3

type AgendaItem struct {
	Title    string
	Start    time.Time
	End      time.Time
	Location string
	Category string
	Tone     Tone
	Done     bool
	// AllDay marks an event with no time of day. Its Start is midnight local,
	// so rendering it as "00:00" would be misleading.
	AllDay bool
}

AgendaItem is one calendar event.

type AnimationOptions added in v0.2.3

type AnimationOptions struct {
	// Enabled turns interpolation on. Off by default: the workspace never
	// installs timers of its own, so applications opt in.
	Enabled bool
	// ReducedMotion disables transitions while leaving the animator addressable,
	// mirroring the accessibility preference of the same name.
	ReducedMotion bool
	// TickRate is the suggested interval between application ticks.
	TickRate time.Duration
}

AnimationOptions configures the lightweight workspace animator.

type Animator added in v0.2.3

type Animator struct {
	// contains filtered or unexported fields
}

Animator interpolates a small set of named scalars toward targets. It is deliberately tiny and timer-free: the application drives it with Tick on whatever schedule it already uses, so animation never blocks input and can be switched off without touching widgets.

func NewAnimator added in v0.2.3

func NewAnimator(options AnimationOptions) *Animator

NewAnimator creates an animator. Zero options disable it.

func (*Animator) Ease added in v0.2.3

func (a *Animator) Ease(key string) float64

Ease returns an eased 0..1 progress for a value, for callers that want a smoother curve than the raw interpolation.

func (*Animator) Enabled added in v0.2.3

func (a *Animator) Enabled() bool

Enabled reports whether interpolation is on.

func (*Animator) ReducedMotion added in v0.2.3

func (a *Animator) ReducedMotion() bool

ReducedMotion reports whether reduced motion was requested.

func (*Animator) Set added in v0.2.3

func (a *Animator) Set(key string, target float64)

Set moves a named value toward target over subsequent ticks.

func (*Animator) Tick added in v0.2.3

func (a *Animator) Tick() bool

Tick advances every animated value one step. It returns true while any value is still moving.

func (*Animator) TickRate added in v0.2.3

func (a *Animator) TickRate() time.Duration

TickRate returns the suggested tick interval.

func (*Animator) Value added in v0.2.3

func (a *Animator) Value(key string) float64

Value returns the current animated value, defaulting to target when motion is disabled.

type Badge added in v0.2.3

type Badge struct {
	Text string
	Tone Tone
}

Badge is a short inline status label such as "saved", "3", or "warning".

func NewBadge added in v0.2.3

func NewBadge(text string) Badge

NewBadge creates a neutral badge.

func StatusBadge added in v0.2.3

func StatusBadge(kind StatusKind, label string) Badge

StatusBadge turns a status into a header badge (label + tone, no glyph so it stays quiet next to a title).

func (Badge) WithTone added in v0.2.3

func (b Badge) WithTone(tone Tone) Badge

WithTone returns the badge with a semantic tone.

type BandedRamp added in v0.2.3

type BandedRamp struct {
	Glyphs []rune
	Bands  []float64
}

BandedRamp is one absolute-banded sparkline style's resolved glyphs and the thresholds between them. The two are always the same length.

type BarGauge added in v0.2.3

type BarGauge struct {
	Fraction float64
	Width    int
	Tone     Tone
	Label    string
}

BarGauge is a labelled progress bar.

type Block added in v0.2.0

type Block struct {
	Prefix   string // left margin applied to the header; body is indented to the same column
	Header   string // primary header text
	Meta     string // right-aligned annotation on the header line
	Body     string // optional multi-line body below the header
	Selected bool
	Muted    bool
}

Block is a multi-line themed item with an optional body below the header line. A Block with no Body is byte-identical to the equivalent RenderRow output.

type ClockData added in v0.2.3

type ClockData struct {
	Local    time.Time
	Location string
	Hour24   bool
	Zones    []WorldClock
}

ClockData backs the clock widget. Hour24 selects 24-hour ("15:04") instead of 12-hour ("3:04 PM") formatting.

type ClockFont added in v0.2.3

type ClockFont string

ClockFont selects the glyph set used for the large digital clock.

const (
	ClockFontDash  ClockFont = "dash"  // light segments (─ │)
	ClockFontBlock ClockFont = "block" // solid blocks (█)
)

func ClockFonts added in v0.2.3

func ClockFonts() []ClockFont

ClockFonts lists the available clock fonts in display order.

type Command added in v0.2.3

type Command struct {
	ID       string
	Label    string
	Category string
	Key      string
	Panel    string
	Run      func()
}

Command is one runnable entry in the command palette. Workspace and panel actions are projected into Commands automatically, so an action declared on a panel is searchable without being registered twice.

func (Command) Display added in v0.2.3

func (c Command) Display() string

Display renders the command for palette rows and diagnostics.

type CommandPalette added in v0.2.3

type CommandPalette struct {
	// contains filtered or unexported fields
}

CommandPalette is a searchable list over Commands. It is framework-provided so workspace and panel actions always have a home.

func NewCommandPalette added in v0.2.3

func NewCommandPalette() *CommandPalette

NewCommandPalette creates an empty palette.

func (*CommandPalette) Open added in v0.2.3

func (p *CommandPalette) Open(commands []Command)

Open shows the palette over a command set.

func (CommandPalette) Opened added in v0.2.3

func (p CommandPalette) Opened() bool

Opened reports whether the palette is displayed.

func (CommandPalette) Render added in v0.2.3

func (p CommandPalette) Render(r Renderer, width, height int) Overlay

Render draws the palette as a soft-panel overlay.

func (*CommandPalette) Update added in v0.2.3

func (p *CommandPalette) Update(msg tea.KeyMsg) PaletteAction

Update handles query editing, navigation, and execution.

type Density

type Density string

Density controls spacing across rows, chrome, and overlays. It is a first-class look-and-feel choice: dashboards prefer Dense, while reading oriented apps prefer Comfortable.

const (
	// Comfortable adds breathing room between rows and in modals.
	Comfortable Density = "comfortable"
	// Compact is the default: no optional spacer rows.
	Compact Density = "compact"
	// Dense removes secondary metadata and tightens chrome for dashboards.
	Dense Density = "dense"
)

func (Density) IsComfortable added in v0.2.3

func (d Density) IsComfortable() bool

IsComfortable reports whether the density adds extra spacing.

func (Density) IsDense added in v0.2.3

func (d Density) IsDense() bool

IsDense reports whether the density strips secondary metadata.

func (Density) RowStride added in v0.2.3

func (d Density) RowStride() int

RowStride returns the terminal lines a list row occupies.

func (Density) ShowsSecondary added in v0.2.3

func (d Density) ShowsSecondary() bool

ShowsSecondary reports whether secondary/right-aligned metadata is rendered.

func (Density) ShowsSubtitles added in v0.2.3

func (d Density) ShowsSubtitles() bool

ShowsSubtitles reports whether panel subtitles and secondary metadata are rendered at this density.

type Direction added in v0.2.3

type Direction int

Direction names one of the four spatial directions used by focus traversal and keyboard resizing.

const (
	// DirUp moves toward smaller row coordinates.
	DirUp Direction = iota
	// DirDown moves toward larger row coordinates.
	DirDown
	// DirLeft moves toward smaller column coordinates.
	DirLeft
	// DirRight moves toward larger column coordinates.
	DirRight
)

func (Direction) Forward added in v0.2.3

func (d Direction) Forward() bool

Forward reports whether the direction increases along its axis.

func (Direction) Horizontal added in v0.2.3

func (d Direction) Horizontal() bool

Horizontal reports whether the direction runs along the width axis.

func (Direction) String added in v0.2.3

func (d Direction) String() string

String returns a stable direction name for hints and debugging.

type DockSide added in v0.2.3

type DockSide int

DockSide describes where a moved panel lands relative to a target panel.

const (
	// DockCenter merges the moving panel into the target's tab stack.
	DockCenter DockSide = iota
	// DockLeft places the moving panel to the left of the target.
	DockLeft
	// DockRight places the moving panel to the right of the target.
	DockRight
	// DockAbove places the moving panel above the target, stacking them.
	DockAbove
	// DockBelow places the moving panel below the target, stacking them.
	DockBelow
	// DockRowAbove joins the target's row as another column, placed before it.
	DockRowAbove
	// DockRowBelow joins the target's row as another column, placed after it.
	DockRowBelow
)

func MovedDock added in v0.2.3

func MovedDock(d Direction) DockSide

MovedDock returns the side a panel docks to when the cursor moves in a direction. Left/right dock beside the target; up/down join the target's row as another column, so a move between rows shares that row instead of stacking a new one.

func (DockSide) String added in v0.2.3

func (d DockSide) String() string

DockSide names are used in the preview label.

type Fallback added in v0.2.3

type Fallback struct {
	Below  int
	Mode   FallbackMode
	With   string // FallbackStack: the panel to merge into
	Target string // FallbackMoveBelow / FallbackMoveRight: the anchor
}

Fallback is one responsive rule: "below this width, do this". Rules are evaluated from the narrowest threshold outward, so a panel can express a graceful degradation ladder rather than a single special case.

type FallbackMode added in v0.2.3

type FallbackMode int

FallbackMode is the generalized responsive behaviour a panel adopts when the workspace falls below a width threshold.

const (
	// FallbackHide removes the panel entirely.
	FallbackHide FallbackMode = iota
	// FallbackCollapse keeps a compact header-only strip.
	FallbackCollapse
	// FallbackStack merges the panel into another panel's tab stack.
	FallbackStack
	// FallbackMoveBelow relocates the panel beneath a target panel.
	FallbackMoveBelow
	// FallbackMoveRight relocates the panel to the right of a target panel.
	FallbackMoveRight
)

type FocusChrome added in v0.2.3

type FocusChrome struct {
	Presentation FocusPresentation
	Density      Density
}

FocusChrome centralises the decisions a themed panel makes about its focus state, so renderers and widgets agree on what "focused" means.

func (FocusChrome) FrameColor added in v0.2.3

func (fc FocusChrome) FrameColor(styles Styles, focused, dimmed bool, accent lipgloss.Color) lipgloss.Color

FrameColor returns the border colour for a panel's state.

func (FocusChrome) ShowRail added in v0.2.3

func (fc FocusChrome) ShowRail(focused bool) bool

ShowRail reports whether a focused panel should draw an inner accent rail.

func (FocusChrome) SurfaceBg added in v0.2.3

func (fc FocusChrome) SurfaceBg(styles Styles) lipgloss.Color

SurfaceBg returns the body background for a panel's state. Content rendered by applications uses Styles.Theme.Bg, so this stays aligned with it.

type FocusManager added in v0.2.3

type FocusManager struct {
	// contains filtered or unexported fields
}

FocusManager owns the current focus id and the traversal algorithms. It is independent of rendering so focus can be tested against solved rectangles.

func (FocusManager) Current added in v0.2.3

func (f FocusManager) Current() string

Current returns the focused panel id.

func (FocusManager) Directional added in v0.2.3

func (f FocusManager) Directional(solved SolvedLayout, dir Direction, focusable func(string) bool) string

Directional returns the nearest focusable panel in a direction from the current one, or "" when there is none.

func (FocusManager) Next added in v0.2.3

func (f FocusManager) Next(order []string) string

Next returns the next id in order, wrapping around.

func (FocusManager) Prev added in v0.2.3

func (f FocusManager) Prev(order []string) string

Prev returns the previous id in order, wrapping around.

func (*FocusManager) Set added in v0.2.3

func (f *FocusManager) Set(id string)

Set focuses a specific panel id, without validation.

type FocusPresentation added in v0.2.3

type FocusPresentation struct {
	// ActiveBorder highlights the focused panel frame.
	ActiveBorder bool
	// ActiveTitle highlights the focused panel's title and tabs.
	ActiveTitle bool
	// TitleCapsule paints the focused title as an accent capsule rather than
	// bright text; capsule is the stronger, more branded treatment.
	TitleCapsule bool
	// FocusRail draws a thin accent rail down the focused panel's body, an
	// unmistakable but quiet "you are here" marker.
	FocusRail bool
	// DimInactive lowers the contrast of low-priority unfocused panels.
	DimInactive bool
	// MutedSecondary de-emphasises secondary unfocused panels further.
	MutedSecondary bool
	// AccentMarker draws a leading accent marker on the focused title.
	AccentMarker bool
	// InactiveSelection keeps a list selection visible (muted) when its panel
	// is not focused, so context is preserved without competing for attention.
	InactiveSelection bool
	// StatusStrip renders the workspace status strip with active-panel info.
	StatusStrip bool
	// KeyHints renders contextual action hints in the focused panel footer.
	KeyHints bool
}

FocusPresentation controls how the workspace signals which panel is active. It is deliberately a set of switches rather than free-form styling so themes keep ownership of the actual colours.

func DefaultFocusPresentation added in v0.2.3

func DefaultFocusPresentation() FocusPresentation

DefaultFocusPresentation returns the presentation used when none is given: rich, but without animation or excessive motion.

type ForecastPoint added in v0.2.3

type ForecastPoint struct {
	Label       string // "3PM", "Mon"
	Temperature int
	Condition   string
	RainChance  int
}

ForecastPoint is one entry in an hourly or daily forecast.

type GPUMetrics added in v0.2.3

type GPUMetrics struct {
	Name         string // short driver name, e.g. "amdgpu"
	BusyPercent  float64
	BusySpark    []float64
	MemoryUsed   string
	MemoryTotal  string
	MemoryLabel  string // "VRAM", or "GPU mem" on an integrated GPU
	MemoryFrac   float64
	TemperatureC int
	PowerWatts   float64
	ClockMHz     int
	// Integrated marks a GPU whose memory is carved out of system RAM. Its
	// memory is near-full by construction, so the widget shows the figure
	// without a gauge rather than painting a permanently alarming bar.
	Integrated bool
}

GPUMetrics backs the GPU widget. Percentages are 0..100 and BusySpark is 0..1, matching SystemMetrics.

type GaugeStyle added in v0.2.3

type GaugeStyle string

GaugeStyle selects the glyph set used by progress bars and metric gauges.

const (
	GaugeSolid   GaugeStyle = "solid"   // █ fill / ░ track (default)
	GaugeBlocks  GaugeStyle = "blocks"  // ▰ fill / ▱ track
	GaugeCircles GaugeStyle = "circles" // ● fill / ○ track
	GaugeFisheye GaugeStyle = "fisheye" // ◉ fill / ○ track
	GaugeMarker  GaugeStyle = "marker"  // ─ track with a ● marker
	GaugeBars    GaugeStyle = "bars"    // ▮ fill / ▯ track
)

func GaugeStyles added in v0.2.3

func GaugeStyles() []GaugeStyle

GaugeStyles lists the available gauge styles in display order.

type Headline added in v0.2.3

type Headline struct {
	Title  string
	Source string
	Age    string
	// Link is the story's URL, so a panel can copy it or open it.
	Link string
	// Selected marks the story under the panel's cursor, so the renderer can
	// highlight it.
	Selected bool
	Unread   bool
	Tone     Tone
}

Headline is one news or RSS item.

type IconStyle added in v0.2.3

type IconStyle string

IconStyle selects the glyph family used for widget icons.

const (
	// IconEmoji is the default: the weather widget already draws emoji
	// unconditionally, so icons elsewhere match it rather than looking like a
	// different toolkit. An ASCII theme still falls back to ASCII.
	IconEmoji IconStyle = "emoji" // colour emoji, two cells (default)
	IconPlain IconStyle = "plain" // line-drawing symbols, one cell
	IconNerd  IconStyle = "nerd"  // Nerd Font glyphs, one cell, patched fonts only
)

func IconStyles added in v0.2.3

func IconStyles() []IconStyle

IconStyles lists the available icon styles in display order.

type KeyHint added in v0.2.3

type KeyHint struct {
	Key   string
	Label string
}

KeyHint is one keyboard hint, rendered as a compact key capsule plus label.

func Hint added in v0.2.3

func Hint(key, label string) KeyHint

Hint builds a KeyHint.

type Layout

type Layout struct {
	Width  int
	Height int
	Mode   LayoutMode
	Panes  [3]Pane
	Status *StatusBar
	Modal  *Overlay

	// SidebarRatio controls pane 0 in StackedRight and SidebarOnly modes. Zero uses 0.28.
	SidebarRatio float64
	// UpperRightRatio controls pane 1 in StackedRight mode. Zero uses 0.40.
	UpperRightRatio float64
	// ColumnRatios controls widths in ThreeColumn mode. Zero values use equal columns.
	ColumnRatios [3]float64
	// FloatWidthRatio controls the width of floating panels in Floating mode. Zero uses 0.45.
	FloatWidthRatio float64
	// FloatHeightRatio controls the height split of the two floating panels in Floating mode. Zero uses 0.50.
	FloatHeightRatio float64
}

Layout supplies terminal dimensions, three panes, and optional shell chrome.

type LayoutHistory added in v0.2.3

type LayoutHistory struct {
	// contains filtered or unexported fields
}

LayoutHistory is a bounded undo/redo stack over layout snapshots.

func NewLayoutHistory added in v0.2.3

func NewLayoutHistory(limit int) *LayoutHistory

NewLayoutHistory creates an empty history bounded to limit entries (at least 1). Zero uses 64.

func (*LayoutHistory) CanRedo added in v0.2.3

func (h *LayoutHistory) CanRedo() bool

CanRedo reports whether a later state exists.

func (*LayoutHistory) CanUndo added in v0.2.3

func (h *LayoutHistory) CanUndo() bool

CanUndo reports whether an earlier state exists.

func (*LayoutHistory) Len added in v0.2.3

func (h *LayoutHistory) Len() int

Len returns the number of recorded states.

func (*LayoutHistory) Push added in v0.2.3

func (h *LayoutHistory) Push(state workspaceSnapshot)

Push records a new state, discarding any redo entries after the cursor. Pushing a state identical to the current one is ignored.

func (*LayoutHistory) Redo added in v0.2.3

func (h *LayoutHistory) Redo() (workspaceSnapshot, bool)

Redo moves the cursor forward and returns the restored state.

func (*LayoutHistory) Reset added in v0.2.3

func (h *LayoutHistory) Reset(state workspaceSnapshot)

Reset clears the history and records state as the initial entry.

func (*LayoutHistory) Undo added in v0.2.3

func (h *LayoutHistory) Undo() (workspaceSnapshot, bool)

Undo moves the cursor back and returns the restored state.

type LayoutMode

type LayoutMode int

LayoutMode selects how the three panes are arranged in the rendered shell.

const (
	// StackedRight places pane 0 on the left and stacks panes 1 and 2 on the right.
	StackedRight LayoutMode = iota
	// ThreeColumn places all three panes side by side.
	ThreeColumn
	// SidebarOnly places pane 0 as a full-height sidebar and pane 1 as the main area. Pane 2 is unused.
	SidebarOnly
	// Tabbed renders a tab bar across the top and shows the focused pane's content below.
	Tabbed
	// Floating renders pane 0 as a full-screen background with panes 1 and 2 as overlaid floating panels.
	Floating
)

type LayoutNode added in v0.2.3

type LayoutNode interface {
	// contains filtered or unexported methods
}

LayoutNode is one node of a workspace layout tree. Trees describe relative structure — splits, tab stacks, and panel leaves — never screen coordinates. The solver turns a tree plus terminal dimensions into rectangles.

func CloneLayout added in v0.2.3

func CloneLayout(root LayoutNode) LayoutNode

CloneLayout returns a deep copy of a layout tree.

func HStack added in v0.2.3

func HStack(children ...LayoutNode) LayoutNode

HStack arranges child nodes in columns, left to right.

func Leaf added in v0.2.3

func Leaf(id string) LayoutNode

Leaf returns a layout node for a single panel.

func MovePanel added in v0.2.3

func MovePanel(root LayoutNode, moving string, target string, side DockSide) LayoutNode

MovePanel returns a cloned tree with moving repositioned relative to target on side. The panel is first detached (closing its old gap), then docked. A missing moving panel or target leaves the tree unchanged. Moving a panel onto itself is a no-op.

func NormalizeLayout added in v0.2.3

func NormalizeLayout(root LayoutNode) LayoutNode

NormalizeLayout collapses single-child splits and empty tab stacks, and drops splits with no children. The result is structurally minimal, so a sequence of moves and hides never leaves redundant scaffolding behind.

func RemovePanel added in v0.2.3

func RemovePanel(root LayoutNode, id string) (LayoutNode, bool)

RemovePanel returns a cloned tree with id removed. Splits left empty or with a single child collapse, so removing a panel closes the gap it left. The boolean reports whether the panel was present.

func SanitizeLayout added in v0.2.3

func SanitizeLayout(root LayoutNode) LayoutNode

SanitizeLayout returns a normalized copy of root in which each panel id appears at most once (the first occurrence wins) and empty nodes are dropped. It defends against hand-authored or persisted layouts that name the same panel in two places, which would otherwise solve to overlapping rectangles.

func SetActiveTab added in v0.2.3

func SetActiveTab(root LayoutNode, id string) LayoutNode

SetActiveTab points the tab stack containing id at that panel.

func SwapPanels added in v0.2.3

func SwapPanels(root LayoutNode, a, b string) LayoutNode

SwapPanels exchanges the positions of two panels anywhere in the tree. If both live in the same tab stack their tab order is swapped instead.

func Tabs added in v0.2.3

func Tabs(ids ...string) LayoutNode

Tabs returns a layout node whose panels share one region as a tab stack.

func VStack added in v0.2.3

func VStack(children ...LayoutNode) LayoutNode

VStack arranges child nodes in rows, top to bottom.

func Weighted added in v0.2.3

func Weighted(node LayoutNode, weight float64) LayoutNode

Weighted assigns an explicit share weight to a node within its parent split. It mutates and returns the same node, so it is safe to nest inside a constructor call. A weight of zero (the default) defers to a panel's Grow weight for leaves and to 1 for groups.

type LayoutSolver added in v0.2.3

type LayoutSolver struct {
	// HGap is the blank cells left between columns of a horizontal split.
	HGap int
	// VGap is the blank cells left between rows of a vertical split.
	VGap int
	// MinWidth and MinHeight report a panel's minimum drawable size.
	MinWidth  func(id string) int
	MinHeight func(id string) int
	// Weight reports a node's share weight within its parent split.
	Weight func(node LayoutNode) float64
}

LayoutSolver turns a layout tree into rectangles. It is deliberately free of any terminal or widget state so layout can be tested on its own.

func (LayoutSolver) Solve added in v0.2.3

func (s LayoutSolver) Solve(root LayoutNode, width, height int) SolvedLayout

Solve lays root out inside width x height.

type LayoutStore added in v0.2.3

type LayoutStore interface {
	Load(key string) ([]byte, error)
	Save(key string, data []byte) error
}

LayoutStore is the pluggable backing store for workspace persistence. The library never touches the filesystem on its own; applications supply a store when they want durable layouts.

type LeafNode added in v0.2.3

type LeafNode struct {
	ID     string
	Weight float64 // zero means "use the panel's grow weight"
}

LeafNode is a single panel occupying one region.

type ListItem added in v0.2.3

type ListItem struct {
	Icon     string
	Text     string
	Meta     string
	Counter  string
	Indent   int
	Selected bool
	Active   bool // the owning panel has focus
	Muted    bool
	Hover    bool
}

ListItem is one polished list row with an optional icon, right-aligned meta, counter, indentation, and selection/hover state.

type MapFrame added in v0.2.3

type MapFrame struct {
	Time  time.Time
	Image image.Image
	// Centre is the pixel the coordinate sits at. It is the middle of the picture
	// only when the block of tiles is odd-sized, which is why it is carried.
	Centre image.Point
	// KilometresPerPixel is the ground distance one pixel covers.
	KilometresPerPixel float64
}

MapFrame is one picture of one place: the picture, the moment it describes, where in it the reader's own coordinate is, and what a pixel of it is worth on the ground. It lives here rather than in provider because it is a rendering model, the same way WeatherData does, and because a panel needs it to draw without knowing where it came from - but a panel can compute neither of the last two from the picture alone, so they travel with it.

type MarketQuote added in v0.2.3

type MarketQuote struct {
	Symbol    string
	Price     float64
	High      float64
	Low       float64
	ChangePct float64
	Currency  string
}

MarketQuote is one watchlist entry.

type MemoryStore added in v0.2.3

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore is an in-memory LayoutStore, suitable for tests and ephemeral sessions.

func NewMemoryStore added in v0.2.3

func NewMemoryStore() *MemoryStore

NewMemoryStore creates an empty in-memory store.

func (*MemoryStore) Load added in v0.2.3

func (m *MemoryStore) Load(key string) ([]byte, error)

Load returns the stored bytes for a key.

func (*MemoryStore) Save added in v0.2.3

func (m *MemoryStore) Save(key string, data []byte) error

Save stores bytes for a key.

type MetricRow added in v0.2.3

type MetricRow struct {
	Label      string
	Value      string
	Unit       string
	Fraction   float64 // 0..1
	Bar        bool    // render a gauge
	Spark      []float64
	Trend      int // -1 down, 0 flat, 1 up
	Tone       Tone
	LabelWidth int
	ValueWidth int
	TotalWidth int
}

MetricRow is one aligned metric line: label, value, optional gauge or sparkline, and a trend arrow. TotalWidth, when non-zero, is the full cell budget; the plot takes whatever remains after the label and value columns.

func (MetricRow) PlotWidth added in v0.2.3

func (m MetricRow) PlotWidth() int

PlotWidth returns the cells available to a gauge or sparkline.

type MiniCalendar added in v0.2.3

type MiniCalendar struct {
	Year      int
	Month     time.Month
	Highlight int
	Width     int
	// Marked highlights days that have events, so a sparse calendar still
	// shows where to look.
	Marked map[int]bool
}

MiniCalendar is a compact month grid.

type NetworkMetrics added in v0.2.3

type NetworkMetrics struct {
	Interface string
	Download  float64
	Upload    float64
	Unit      string
	DownSpark []float64
	UpSpark   []float64
	LAN       string
	WAN       string
}

NetworkMetrics backs the network widget.

type Note added in v0.2.3

type Note struct {
	Title  string
	Body   string
	Pinned bool
}

Note is one note.

type Orientation added in v0.2.3

type Orientation int

Orientation selects the axis a SplitNode divides along.

const (
	// SplitHorizontal places children side by side, splitting the width.
	SplitHorizontal Orientation = iota
	// SplitVertical stacks children top to bottom, splitting the height.
	SplitVertical
)

type Overlay

type Overlay struct {
	Visible bool
	Title   string
	Content string
	Footer  string
	Width   int
	Raw     bool // when true, Content is already fully rendered modal chrome
}

Overlay describes a centered modal displayed over the rendered layout.

type PaletteAction added in v0.2.3

type PaletteAction int

PaletteAction reports how a command palette update ended.

const (
	// PaletteNone indicates navigation or a query edit.
	PaletteNone PaletteAction = iota
	// PaletteRun indicates the selected command ran.
	PaletteRun
	// PaletteClose indicates the palette was dismissed.
	PaletteClose
)

type Pane

type Pane struct {
	Title        string
	Hint         string
	Content      string
	Focused      bool
	Accent       lipgloss.Color
	ScrollOffset int // lines to skip from the top of Content; renderer silently clamps to a valid range
}

Pane supplies a header and rendered body for one region of a Layout.

type PaneCorners added in v0.2.0

type PaneCorners string

PaneCorners selects the glyph set used for pane border corners.

const (
	// SquareCorners renders pane borders with sharp corners. This is the default.
	SquareCorners PaneCorners = "square"
	// RoundCorners renders pane borders with rounded corners.
	RoundCorners PaneCorners = "round"
)

type PaneRatio added in v0.2.0

type PaneRatio struct {
	// contains filtered or unexported fields
}

PaneRatio manages one adjustable split ratio — e.g. Layout.SidebarRatio, Layout.UpperRightRatio, or a Floating ratio. The application holds one PaneRatio per adjustable split, calls Grow/Shrink in response to its own key routing (typically shift+arrow keys), and reads Value() into the corresponding Layout ratio field each render.

func NewPaneRatio added in v0.2.0

func NewPaneRatio(options PaneRatioOptions) PaneRatio

NewPaneRatio creates a PaneRatio bounded to [Min, Max] and adjusted by Step on each Grow/Shrink call.

func (*PaneRatio) Grow added in v0.2.0

func (r *PaneRatio) Grow()

Grow increases the ratio by one step, stopping at Max.

func (*PaneRatio) Shrink added in v0.2.0

func (r *PaneRatio) Shrink()

Shrink decreases the ratio by one step, stopping at Min.

func (PaneRatio) Value added in v0.2.0

func (r PaneRatio) Value() float64

Value returns the current ratio, ready to assign to a Layout ratio field.

type PaneRatioOptions added in v0.2.0

type PaneRatioOptions struct {
	// Initial is the starting ratio. Zero uses the midpoint of Min and Max.
	Initial float64
	// Min is the smallest ratio Grow/Shrink will settle at. Zero uses 0.1.
	Min float64
	// Max is the largest ratio Grow/Shrink will settle at. Zero uses 0.9.
	Max float64
	// Step is the amount Grow/Shrink adjusts the ratio by. Zero uses 0.02.
	Step float64
}

PaneRatioOptions configures a PaneRatio.

type PaneScroller added in v0.2.0

type PaneScroller struct {
	// contains filtered or unexported fields
}

PaneScroller manages a scroll offset for a Pane. The application holds one scroller per pane and passes Offset() to Pane.ScrollOffset each render.

func (PaneScroller) CanScrollDown added in v0.2.0

func (s PaneScroller) CanScrollDown(totalLines, visibleLines int) bool

CanScrollDown reports whether content is hidden below the current view.

func (*PaneScroller) ClampTo added in v0.2.0

func (s *PaneScroller) ClampTo(totalLines, visibleLines int)

ClampTo limits the offset so the view never scrolls past the last line. totalLines is the number of lines in the pane content; visibleLines is the number of lines the pane can display (pane height minus the header row).

func (PaneScroller) Offset added in v0.2.0

func (s PaneScroller) Offset() int

Offset returns the current scroll offset to set on Pane.ScrollOffset.

func (*PaneScroller) ScrollDown added in v0.2.0

func (s *PaneScroller) ScrollDown(n int)

ScrollDown moves the view down by n lines.

func (*PaneScroller) ScrollToTop added in v0.2.0

func (s *PaneScroller) ScrollToTop()

ScrollToTop resets the scroll position to the beginning.

func (*PaneScroller) ScrollUp added in v0.2.0

func (s *PaneScroller) ScrollUp(n int)

ScrollUp moves the view up by n lines, stopping at the top.

type Panel added in v0.2.3

type Panel struct {
	// contains filtered or unexported fields
}

Panel describes one registered workspace region. Panels are created through Workspace.Panel and configured with the fluent methods below.

func (*Panel) Accent added in v0.2.3

func (p *Panel) Accent(accent lipgloss.Color) *Panel

Accent sets a panel-specific focus accent, overriding the theme's.

func (*Panel) ActionList added in v0.2.3

func (p *Panel) ActionList() []PanelAction

ActionList returns the panel's contextual actions.

func (*Panel) Actions added in v0.2.3

func (p *Panel) Actions(actions ...PanelAction) *Panel

Actions registers contextual actions. They automatically flow into the command palette, so they only need to be declared once.

func (*Panel) Badge added in v0.2.3

func (p *Panel) Badge(badge string) *Panel

Badge sets a short status badge rendered in the panel frame.

func (*Panel) BadgeText added in v0.2.3

func (p *Panel) BadgeText() string

BadgeText returns the panel's optional status badge.

func (*Panel) BadgeTone added in v0.2.3

func (p *Panel) BadgeTone(tone Tone) *Panel

BadgeTone tints the panel badge with a semantic tone.

func (*Panel) Body added in v0.2.3

func (p *Panel) Body(content string) *Panel

Body sets a fixed string body.

func (*Panel) CanFocus added in v0.2.3

func (p *Panel) CanFocus() bool

CanFocus reports whether focus traversal may select this panel.

func (*Panel) CanHide added in v0.2.3

func (p *Panel) CanHide() bool

CanHide reports whether the panel may be hidden.

func (*Panel) CanZoom added in v0.2.3

func (p *Panel) CanZoom() bool

CanZoom reports whether the panel may fill the workspace.

func (*Panel) ClearGauge added in v0.2.3

func (p *Panel) ClearGauge() *Panel

ClearGauge makes the panel follow the workspace gauge style again.

func (*Panel) ClearSparkline added in v0.2.3

func (p *Panel) ClearSparkline() *Panel

ClearSparkline makes the panel follow the workspace sparkline style again.

func (*Panel) ClearTheme added in v0.2.3

func (p *Panel) ClearTheme() *Panel

ClearTheme returns the panel to the workspace theme.

func (*Panel) CollapseBelow added in v0.2.3

func (p *Panel) CollapseBelow(width int) *Panel

CollapseBelow reduces the panel to a compact header below width.

func (*Panel) Content added in v0.2.3

func (p *Panel) Content(view PanelView) *Panel

Content sets the panel's view.

func (*Panel) Desc added in v0.2.3

func (p *Panel) Desc() string

Desc returns the panel's optional description.

func (*Panel) Description added in v0.2.3

func (p *Panel) Description(description string) *Panel

Description sets a longer description used by pickers and the palette.

func (*Panel) Fallbacks added in v0.2.3

func (p *Panel) Fallbacks() []Fallback

Fallbacks returns the panel's responsive fallback rules.

func (*Panel) Focusable added in v0.2.3

func (p *Panel) Focusable(focusable bool) *Panel

Focusable controls whether focus traversal may land on the panel.

func (*Panel) Gauge added in v0.2.3

func (p *Panel) Gauge(style GaugeStyle) *Panel

Gauge overrides the workspace gauge style for this panel's progress bars.

func (*Panel) Grow added in v0.2.3

func (p *Panel) Grow(weight float64) *Panel

Grow sets the share of spare space the panel claims.

func (*Panel) GrowValue added in v0.2.3

func (p *Panel) GrowValue() float64

GrowValue returns the grow weight.

func (*Panel) HasPanelGauge added in v0.2.3

func (p *Panel) HasPanelGauge() bool

HasPanelGauge reports whether the panel overrides the workspace gauge style.

func (*Panel) HasPanelSparkline added in v0.2.3

func (p *Panel) HasPanelSparkline() bool

HasPanelSparkline reports whether the panel overrides the workspace style.

func (*Panel) HasPanelTheme added in v0.2.3

func (p *Panel) HasPanelTheme() bool

HasPanelTheme reports whether the panel has any panel-scoped theming.

func (*Panel) Hide added in v0.2.3

func (p *Panel) Hide() *Panel

Hide starts the panel hidden.

func (*Panel) HideBelow added in v0.2.3

func (p *Panel) HideBelow(width int) *Panel

HideBelow hides the panel when the workspace is narrower than width.

func (*Panel) Hideable added in v0.2.3

func (p *Panel) Hideable(hideable bool) *Panel

Hideable controls whether the panel may be hidden or collapsed.

func (*Panel) Hint added in v0.2.3

func (p *Panel) Hint(hint string) *Panel

Hint sets passive hint text shown at the end of the title bar.

func (*Panel) HintText added in v0.2.3

func (p *Panel) HintText() string

HintText returns the panel's optional passive hint text.

func (*Panel) ID added in v0.2.3

func (p *Panel) ID() string

ID returns the panel's stable identifier.

func (*Panel) MinHeight added in v0.2.3

func (p *Panel) MinHeight(height int) *Panel

MinHeight sets the minimum drawable height.

func (*Panel) MinHeightValue added in v0.2.3

func (p *Panel) MinHeightValue() int

MinHeightValue returns the resolved minimum height.

func (*Panel) MinWidth added in v0.2.3

func (p *Panel) MinWidth(width int) *Panel

MinWidth sets the minimum drawable width.

func (*Panel) MinWidthValue added in v0.2.3

func (p *Panel) MinWidthValue() int

MinWidthValue returns the resolved minimum width.

func (*Panel) MoveBelow added in v0.2.3

func (p *Panel) MoveBelow(width int, target string) *Panel

MoveBelow relocates the panel beneath target below width.

func (*Panel) MoveRightOf added in v0.2.3

func (p *Panel) MoveRightOf(width int, target string) *Panel

MoveRightOf relocates the panel to the right of target below width.

func (*Panel) Overrides added in v0.2.3

func (p *Panel) Overrides(overrides ThemeOverrides) *Panel

Overrides recolor the panel without selecting a full theme. Overrides apply on top of the panel theme when one is set, otherwise on top of the workspace theme.

func (*Panel) PanelGauge added in v0.2.3

func (p *Panel) PanelGauge() (GaugeStyle, bool)

PanelGauge returns the panel's gauge override, if it has one. The second result is false when the panel follows the workspace gauge style.

func (*Panel) PanelOverrides added in v0.2.3

func (p *Panel) PanelOverrides() ThemeOverrides

PanelOverrides returns the panel's own color overrides.

func (*Panel) PanelSparkline added in v0.2.3

func (p *Panel) PanelSparkline() (SparklineStyle, bool)

PanelSparkline returns the panel's sparkline override, if it has one. The second result is false when the panel follows the workspace sparkline style.

func (*Panel) PanelTheme added in v0.2.3

func (p *Panel) PanelTheme() (Theme, bool)

PanelTheme returns the panel's theme, if it has one. The second result is false when the panel follows the workspace theme.

func (*Panel) PreferredHeight added in v0.2.3

func (p *Panel) PreferredHeight(height int) *Panel

PreferredHeight sets the ideal height used when space is plentiful.

func (*Panel) PreferredWidth added in v0.2.3

func (p *Panel) PreferredWidth(width int) *Panel

PreferredWidth sets the ideal width used when space is plentiful.

func (*Panel) Priority added in v0.2.3

func (p *Panel) Priority(priority int) *Panel

Priority sets an explicit survival priority, overriding the role default.

func (*Panel) PriorityValue added in v0.2.3

func (p *Panel) PriorityValue() int

PriorityValue returns the resolved priority, using the role default when no explicit value was set.

func (*Panel) Render added in v0.2.3

func (p *Panel) Render(ctx PanelContext) string

Render asks the panel to render itself for ctx.

func (*Panel) Responsive added in v0.2.3

func (p *Panel) Responsive(fallbacks ...Fallback) *Panel

Responsive appends generalized responsive fallback rules.

func (*Panel) Role added in v0.2.3

func (p *Panel) Role(role PanelRole) *Panel

Role sets the panel's semantic role and, unless overridden, its priority.

func (*Panel) SemanticRole added in v0.2.3

func (p *Panel) SemanticRole() PanelRole

SemanticRole returns the panel's role.

func (*Panel) Shrink added in v0.2.3

func (p *Panel) Shrink(weight float64) *Panel

Shrink sets how readily the panel gives up space; lower values hold their size longer.

func (*Panel) Sparkline added in v0.2.3

func (p *Panel) Sparkline(style SparklineStyle) *Panel

Sparkline overrides the workspace sparkline glyph ramp for this panel.

func (*Panel) StackBelow added in v0.2.3

func (p *Panel) StackBelow(width int, with string) *Panel

StackBelow merges the panel into with's tab stack below width.

func (*Panel) StartsHidden added in v0.2.3

func (p *Panel) StartsHidden() bool

StartsHidden reports whether the panel was declared hidden, which is its default until a preset or an explicit Show changes it.

func (*Panel) Subtitle added in v0.2.3

func (p *Panel) Subtitle(subtitle string) *Panel

Subtitle sets a secondary label rendered after the title (hidden at Dense density).

func (*Panel) Theme added in v0.2.3

func (p *Panel) Theme(theme Theme) *Panel

Theme gives the panel its own full theme. Density, corners, gutters, and the rest of the workspace chrome remain workspace-wide. Pass the theme by value; it is copied.

func (*Panel) Title added in v0.2.3

func (p *Panel) Title(title string) *Panel

Title sets the display title.

func (*Panel) TitleText added in v0.2.3

func (p *Panel) TitleText() string

TitleText returns the panel's display title.

func (*Panel) Visible added in v0.2.3

func (p *Panel) Visible() *Panel

Visible marks the panel visible at construction time. Panels are visible by default; this exists for fluent symmetry with Hide.

func (*Panel) Zoomable added in v0.2.3

func (p *Panel) Zoomable(zoomable bool) *Panel

Zoomable controls whether the panel may fill the workspace.

type PanelAction added in v0.2.3

type PanelAction struct {
	// ID is the stable action identifier ("stage", "open").
	ID string
	// Label is human-readable, used by key hints and the command palette.
	Label string
	// Key is the hint key shown in the panel footer ("s", "ctrl+r").
	Key string
	// Category groups the action in the command palette.
	Category string
	// Handler runs the action.
	Handler ActionHandler
}

PanelAction is one contextual action advertised by a panel.

func Action added in v0.2.3

func Action(id, key string, handler ActionHandler) PanelAction

Action builds a panel action. The id doubles as the label when none is set.

func (PanelAction) In added in v0.2.3

func (a PanelAction) In(category string) PanelAction

In sets an action's command-palette category.

func (PanelAction) Labeled added in v0.2.3

func (a PanelAction) Labeled(label string) PanelAction

Labeled sets a human-readable label on an action.

type PanelContext added in v0.2.3

type PanelContext struct {
	ID      string
	Title   string
	Width   int
	Height  int
	Focused bool
	Zoomed  bool
	// Entered says this panel has the keyboard: space entered it, or it owns
	// the screen. A panel that draws its own cursor draws it when Entered is
	// set - Focused alone means the workspace is pointed here, which is a
	// different question from who reads the keys.
	Entered  bool
	Peeked   bool
	Arrange  bool
	Renderer Renderer
}

PanelContext is supplied to a panel's view so it can adapt its content to the space and interaction state the workspace allocated it. Renderer is resolved for this panel, so views that render through it inherit any panel-scoped theme automatically.

type PanelFooter added in v0.2.3

type PanelFooter struct {
	Hints   []KeyHint
	Mode    string
	Focused bool
	Dimmed  bool
	Accent  lipgloss.Color
	Density Density
	Border  lipgloss.Border
}

PanelFooter describes the bottom chrome of a panel.

type PanelHeader added in v0.2.3

type PanelHeader struct {
	Title        string
	Subtitle     string
	Badge        *Badge
	Right        string
	Tabs         []TabItem
	ActiveTab    int
	Focused      bool
	Dimmed       bool
	AccentMarker bool
	Capsule      bool
	Accent       lipgloss.Color
	Density      Density
	Border       lipgloss.Border
}

PanelHeader describes the top chrome of a panel.

type PanelPicker added in v0.2.3

type PanelPicker struct {
	// contains filtered or unexported fields
}

PanelPicker lists every registered panel with its visibility, allowing toggling without disturbing the rest of the layout.

func NewPanelPicker added in v0.2.3

func NewPanelPicker() *PanelPicker

NewPanelPicker creates an empty picker.

func (*PanelPicker) Open added in v0.2.3

func (p *PanelPicker) Open(panels map[string]*Panel, order []string, ws *Workspace)

Open shows the picker for a workspace.

func (PanelPicker) Opened added in v0.2.3

func (p PanelPicker) Opened() bool

Opened reports whether the picker is displayed.

func (PanelPicker) Render added in v0.2.3

func (p PanelPicker) Render(r Renderer, width, height int) Overlay

Render draws the picker as a soft-panel overlay.

func (*PanelPicker) Update added in v0.2.3

func (p *PanelPicker) Update(msg tea.KeyMsg) PanelPickerAction

Update handles navigation and toggling.

type PanelPickerAction added in v0.2.3

type PanelPickerAction int

PanelPickerAction reports how a panel picker update ended.

const (
	// PanelPickerNone indicates navigation.
	PanelPickerNone PanelPickerAction = iota
	// PanelPickerToggle indicates a panel's visibility changed.
	PanelPickerToggle
	// PanelPickerClose indicates the picker was dismissed.
	PanelPickerClose
)

type PanelRole added in v0.2.3

type PanelRole int

PanelRole is a panel's semantic purpose. Roles drive the default responsive behaviour and the order in which panels survive shrinking, so an application rarely has to spell out a breakpoint by hand.

const (
	// RolePrimary is the content the workspace exists to show. It survives the
	// longest when space runs out.
	RolePrimary PanelRole = iota
	// RoleNavigation moves between things (lists, files, repositories).
	RoleNavigation
	// RoleSecondary supports the primary content (details, previews, forms).
	RoleSecondary
	// RoleInspector shows properties of the current selection.
	RoleInspector
	// RoleTelemetry is ambient information such as logs or metrics.
	RoleTelemetry
	// RoleOptional is nice to have and disappears first.
	RoleOptional
)

func (PanelRole) String added in v0.2.3

func (r PanelRole) String() string

String returns a stable name for debugging and command categories.

type PanelView added in v0.2.3

type PanelView func(PanelContext) string

PanelView renders a panel's body for the given context.

func Text added in v0.2.3

func Text(content string) PanelView

Text returns a fixed-content view, for panels whose body does not change.

type Preset added in v0.2.3

type Preset struct {
	Name   string
	Root   LayoutNode
	Hidden []string
}

Preset is a named layout configuration applications can ship or users save.

type ProgressBar added in v0.2.3

type ProgressBar struct {
	Fraction float64
	Width    int
	Tone     Tone
}

ProgressBar describes a standalone gauge.

type RadarFrame added in v0.2.3

type RadarFrame = MapFrame

RadarFrame is a MapFrame: a radar picture is a map picture that changes every few minutes. The basemap under it is the same model with a stiller picture.

type Rect added in v0.2.3

type Rect struct {
	X      int
	Y      int
	Width  int
	Height int
}

Rect is a solved region in terminal cells.

func (Rect) Contains added in v0.2.3

func (r Rect) Contains(x, y int) bool

Contains reports whether a cell falls inside the rectangle.

func (Rect) Empty added in v0.2.3

func (r Rect) Empty() bool

Empty reports whether the rectangle has no drawable area.

type Renderer

type Renderer struct {
	Styles Styles
	// CellAspect is the cell's height divided by its width, already clamped to
	// something a terminal could plausibly have (see StyleOptions.CellAspect).
	// Only image sizing reads it.
	CellAspect float64
	// CellWidth is one cell's width in pixels, already checked (see
	// StyleOptions.CellWidth). Only things that reason in pixels read it.
	CellWidth float64
}

Renderer renders Layout and Row values using one resolved set of styles.

func NewRenderer

func NewRenderer(theme Theme, options StyleOptions) Renderer

NewRenderer creates a renderer for a theme and style options.

func (Renderer) GaugeSample added in v0.2.3

func (r Renderer) GaugeSample(style GaugeStyle, width int) string

GaugeSample returns plain sample glyphs for a style, e.g. for previews in a picker. It is unstyled so the caller can colour it to match its own surface.

func (Renderer) OverlayModal added in v0.2.3

func (r Renderer) OverlayModal(base, overlayContent string, width, height int) string

OverlayModal composites overlayContent as a centered modal on top of an already-assembled base view, blending Styles.ModalShadow's drop shadow into whatever base content the shadow actually falls across — the same step Render performs internally for Layout.Modal. It exists for callers whose overall page isn't assembled through Render's own Panes/Mode system, so they can still get the same contrast-aware shadow rather than reimplementing it as a flat overlay.

func (Renderer) Render

func (r Renderer) Render(layout Layout) string

Render produces a terminal-sized themed view for layout.

func (Renderer) RenderAgenda added in v0.2.3

func (r Renderer) RenderAgenda(items []AgendaItem, now time.Time, width int) string

RenderAgenda renders upcoming events grouped by day with the next event emphasised.

func (Renderer) RenderAgendaDetail added in v0.2.3

func (r Renderer) RenderAgendaDetail(items []AgendaItem, now time.Time, width int) string

RenderAgendaDetail renders the agenda with locations and categories.

func (Renderer) RenderBadge added in v0.2.3

func (r Renderer) RenderBadge(badge Badge) string

RenderBadge renders a badge inline at the active page background.

func (Renderer) RenderBadgeOn added in v0.2.3

func (r Renderer) RenderBadgeOn(badge Badge, bg lipgloss.Color) string

RenderBadgeOn renders a badge over a specific background, for use inside headers and status bars.

func (Renderer) RenderBarGauge added in v0.2.3

func (r Renderer) RenderBarGauge(g BarGauge, bg lipgloss.Color) string

RenderBarGauge renders an optional label followed by a themed progress bar.

func (Renderer) RenderBlock added in v0.2.0

func (r Renderer) RenderBlock(block Block, width int) string

RenderBlock formats one Block to the requested content width. The header uses Item styles (including density spacing). When Body is present, the header's bottom padding is removed so density spacing does not create a gap between the header and body. The body is indented to align with the header text.

func (Renderer) RenderCalendar added in v0.2.3

func (r Renderer) RenderCalendar(day time.Time, marked map[int]bool, items []AgendaItem, now time.Time, width int) string

RenderCalendar lays a month grid beside the day's agenda, highlighting the selected day. The grid covers the day's own month, so stepping the day across a month boundary turns the calendar page.

func (Renderer) RenderCalendarDetail added in v0.2.3

func (r Renderer) RenderCalendarDetail(day time.Time, marked map[int]bool, items []AgendaItem, now time.Time, width int) string

RenderCalendarDetail is RenderCalendar with the agenda's locations and categories shown.

func (Renderer) RenderClock added in v0.2.3

func (r Renderer) RenderClock(c ClockData, width int) string

RenderClock renders local time and world clocks. When the pane is wide enough the time is drawn as big digital rows; otherwise it falls back to text. The date carries the day-period and a sun/moon glyph, a day-progress gauge sits under it, and each world clock carries its own glyph.

func (Renderer) RenderClockDetail added in v0.2.3

func (r Renderer) RenderClockDetail(c ClockData, width int) string

RenderClockDetail renders the clock as a big digital time over a day-progress gauge, an analog face, the world clocks, and a month calendar.

func (Renderer) RenderGPU added in v0.2.3

func (r Renderer) RenderGPU(m GPUMetrics, width int) string

RenderGPU renders the GPU summary: utilisation with a short history, then memory, temperature, power and clock.

func (Renderer) RenderGPUDetail added in v0.2.3

func (r Renderer) RenderGPUDetail(m GPUMetrics, width int) string

RenderGPUDetail adds the driver and, on an integrated GPU, a note that the memory shown is shared with the system.

func (Renderer) RenderHeadlines added in v0.2.3

func (r Renderer) RenderHeadlines(items []Headline, width int) string

RenderHeadlines renders each headline as its source followed by the title wrapped as a sentence, with unread stories brightest.

func (Renderer) RenderHeadlinesDetail added in v0.2.3

func (r Renderer) RenderHeadlinesDetail(items []Headline, width int) string

RenderHeadlinesDetail renders more headlines than the compact list, in the same source-then-wrapped-sentence shape.

func (Renderer) RenderHeadlinesRows added in v0.2.3

func (r Renderer) RenderHeadlinesRows(items []Headline, width int, detail bool) (string, []int)

RenderHeadlinesRows renders the headline list and also reports the story drawn on each content row (-1 for the blank row between stories), so a panel can map a mouse click back to a story.

func (Renderer) RenderImage added in v0.2.3

func (r Renderer) RenderImage(img image.Image, width, maxHeight int) string

RenderImage draws an image inside a box of cells. Which way depends on the terminal: kitty gets the picture itself, drawn by the terminal at its own pixel resolution through placeholder cells; anything else gets coloured half-blocks ("▀" with the top sample as foreground and the bottom as background), which is one sample across and two down per cell - enough for a radar blob, a heat map or a chart; and a terminal with no colour at all gets a brightness ramp.

The picture keeps its aspect and is centred in width, sized by the cell's own shape (Renderer.CellAspect) because a stretched picture lies about distance. Samples that are transparent show the panel background through them, and a picture that cannot be drawn is never a hole.

func (Renderer) RenderKeyHints added in v0.2.3

func (r Renderer) RenderKeyHints(hints []KeyHint, maxWidth int) string

RenderKeyHints renders compact key capsules for a panel footer. Labels are included while they fit and dropped per-hint as space runs out, so a footer that shows only "c" is the fallback for a narrow panel, not the rule even in Dense mode: a key without its verb is not discoverable.

func (Renderer) RenderLines added in v0.2.3

func (r Renderer) RenderLines(lines []string, width int, bg lipgloss.Color) string

RenderLines bounds a block of lines to a width: each line is truncated with an ellipsis and padded, keeping its own styling and its background continuous. Every panel body ends here, which is what guarantees a panel never overflows its pane.

It is exported because a panel does not have to live in this package: one rendered from a document supplied by an external program needs the same guarantee, and reimplementing it elsewhere would mean two subtly different notions of "fits".

func (Renderer) RenderListItem added in v0.2.3

func (r Renderer) RenderListItem(item ListItem, width int) string

RenderListItem renders a selectable list row, using an accent rail for the selection and a subtle fill for the active panel's selection. Right-aligned meta and counters are styled separately so they support the row rather than competing with it.

func (Renderer) RenderMarkets added in v0.2.3

func (r Renderer) RenderMarkets(items []MarketQuote, width int) string

RenderMarkets renders an aligned watchlist.

func (Renderer) RenderMarketsDetail added in v0.2.3

func (r Renderer) RenderMarketsDetail(items []MarketQuote, width int) string

RenderMarketsDetail renders the watchlist with high/low facts. The compact view keeps those facts on a second line when needed; the detail view always gives them their own readable line.

func (Renderer) RenderMetricRow added in v0.2.3

func (r Renderer) RenderMetricRow(m MetricRow, bg lipgloss.Color) string

RenderMetricRow renders one aligned metric line. When TotalWidth is set the result is exactly that many cells; otherwise it is as wide as its content.

func (Renderer) RenderMiniCalendar added in v0.2.3

func (r Renderer) RenderMiniCalendar(c MiniCalendar, bg lipgloss.Color) string

RenderMiniCalendar renders a Monday-first month grid, highlighting a day.

func (Renderer) RenderNetwork added in v0.2.3

func (r Renderer) RenderNetwork(m NetworkMetrics, width int) string

RenderNetwork renders throughput and a short-term graph.

func (Renderer) RenderNetworkDetail added in v0.2.3

func (r Renderer) RenderNetworkDetail(m NetworkMetrics, width int) string

RenderNetworkDetail adds LAN/WAN summaries and an upload graph.

func (Renderer) RenderNotes added in v0.2.3

func (r Renderer) RenderNotes(items []Note, width int) string

RenderNotes renders pinned and short notes.

func (Renderer) RenderNotice added in v0.2.3

func (r Renderer) RenderNotice(text string, width int) string

RenderNotice renders a muted one-line message, for a panel that has nothing to show or whose source failed. Showing the failure beats an empty panel that looks like a quiet calendar.

func (Renderer) RenderPanelFooter added in v0.2.3

func (r Renderer) RenderPanelFooter(f PanelFooter, width int) string

RenderPanelFooter renders the inner content of a panel's bottom border line, exactly width cells wide (excluding the corner glyphs).

func (Renderer) RenderPanelHeader added in v0.2.3

func (r Renderer) RenderPanelHeader(h PanelHeader, width int) string

RenderPanelHeader renders the inner content of a panel's top border line, exactly width cells wide (excluding the corner glyphs).

func (Renderer) RenderProgressBar added in v0.2.3

func (r Renderer) RenderProgressBar(bar ProgressBar, bg lipgloss.Color) string

RenderProgressBar renders a gauge of exactly width cells using theme tokens. The glyph set follows Styles.Gauge; the marker style draws a track with a single dot at the fill position instead of filling a run of cells.

func (Renderer) RenderRepoActivity added in v0.2.3

func (r Renderer) RenderRepoActivity(items []RepoActivity, width int) string

RenderRepoActivity renders one line per repository: the name, the branch, and what is outstanding.

func (Renderer) RenderRepoActivityDetail added in v0.2.3

func (r Renderer) RenderRepoActivityDetail(items []RepoActivity, width int) string

RenderRepoActivityDetail adds the counts the compact line leaves out.

func (Renderer) RenderRow

func (r Renderer) RenderRow(row Row, width int) string

RenderRow formats one Row to the requested content width.

func (Renderer) RenderSectionDivider added in v0.2.3

func (r Renderer) RenderSectionDivider(d SectionDivider, bg lipgloss.Color) string

RenderSectionDivider renders a labelled rule of exactly width cells.

func (Renderer) RenderServices added in v0.2.3

func (r Renderer) RenderServices(items []ServiceStatus, width int) string

RenderServices renders service/container statuses.

func (Renderer) RenderServicesDetail added in v0.2.3

func (r Renderer) RenderServicesDetail(items []ServiceStatus, width int) string

RenderServicesDetail adds each service's detail and uptime.

func (Renderer) RenderSoftBody added in v0.2.1

func (r Renderer) RenderSoftBody(width int, content string) string

RenderSoftBody pads and clamps pre-rendered soft modal content line-by-line. Use it when content contains styled rows that must not be re-wrapped by Lipgloss after ANSI styling has already been applied.

func (Renderer) RenderSoftHints added in v0.2.1

func (r Renderer) RenderSoftHints(width int, hints ...SoftHint) string

RenderSoftHints renders quiet lowercase key/action hints for soft modals.

func (Renderer) RenderSoftPanel added in v0.2.1

func (r Renderer) RenderSoftPanel(panel SoftPanel) string

RenderSoftPanel renders a soft modal box. The returned string is the box only; assign it to Overlay.Content through SoftPanelOverlay or place it with application-owned overlay logic.

func (Renderer) RenderSoftRow added in v0.2.1

func (r Renderer) RenderSoftRow(row SoftRow, width int) string

RenderSoftRow renders a soft modal row with a two-cell selected rail, on the modal surface.

func (Renderer) RenderSoftRowOn added in v0.2.3

func (r Renderer) RenderSoftRowOn(row SoftRow, width int, surface lipgloss.Color) string

RenderSoftRowOn renders a soft row on a named background.

A row drawn with RenderSoftRow sits on the modal surface, which is a lifted shade of the theme background. That is right inside a modal and wrong inside a pane: the rows come out a different colour from the blank space around them, and the pane looks banded. A screen that draws soft rows directly into a pane passes the pane's own background here.

func (Renderer) RenderSparkline added in v0.2.3

func (r Renderer) RenderSparkline(spark Sparkline, bg lipgloss.Color) string

RenderSparkline renders a trend glyph run of exactly width cells. Cells are coloured green through yellow, orange, and red by their position between the run's minimum and maximum, so the shape and the colour agree.

func (Renderer) RenderStatValue added in v0.2.3

func (r Renderer) RenderStatValue(s StatValue, bg lipgloss.Color) string

RenderStatValue renders a headline figure over bg.

func (Renderer) RenderStatus added in v0.2.3

func (r Renderer) RenderStatus(kind StatusKind, label string, bg lipgloss.Color) string

RenderStatus renders a status marker with an optional word.

func (Renderer) RenderStatusDot added in v0.2.3

func (r Renderer) RenderStatusDot(d StatusDot, bg lipgloss.Color) string

RenderStatusDot renders a status dot and optional label over bg.

func (Renderer) RenderStatusKeyHints added in v0.2.3

func (r Renderer) RenderStatusKeyHints(hints []KeyHint, maxWidth int) string

RenderStatusKeyHints renders key capsules for the workspace status strip. Labels are always attempted because discoverability matters more than the density setting in the global status bar.

func (Renderer) RenderStatusRegions added in v0.2.3

func (r Renderer) RenderStatusRegions(identity, mode, commands string, width int) string

RenderStatusRegions renders the workspace status strip with three regions: an identity cluster on the left, an optional transient mode capsule, and right-aligned commands. Commands are dropped first, then the mode capsule, then the identity is truncated — so the most important information survives narrow terminals.

func (Renderer) RenderStorage added in v0.2.3

func (r Renderer) RenderStorage(mounts []StorageMount, width int) string

RenderStorage renders mounted filesystems with gauges.

func (Renderer) RenderSystem added in v0.2.3

func (r Renderer) RenderSystem(m SystemMetrics, width int) string

RenderSystem renders the system-health summary.

func (Renderer) RenderSystemDetail added in v0.2.3

func (r Renderer) RenderSystemDetail(m SystemMetrics, width int) string

RenderSystemDetail renders per-core load, memory totals, and processes.

func (Renderer) RenderTabStrip added in v0.2.3

func (r Renderer) RenderTabStrip(items []TabItem, active int, focused bool, width int) (string, int)

RenderTabStrip renders a themed tab strip of up to width cells. It returns the rendered strip and the width consumed; callers pad the remainder with panel border chrome. Mouse hit boxes can be derived from the same segments.

func (Renderer) RenderTasks added in v0.2.3

func (r Renderer) RenderTasks(tasks []Task, width int) string

RenderTasks renders a task list with checkboxes and due dates.

func (Renderer) RenderTrend added in v0.2.3

func (r Renderer) RenderTrend(change float64, unit string, bg lipgloss.Color) string

RenderTrend renders a signed change with a direction arrow and semantic tone.

func (Renderer) RenderUpdates added in v0.2.3

func (r Renderer) RenderUpdates(u UpdateStatus, width int) string

RenderUpdates renders pending system updates: the Omarchy version bump when one is waiting, then how many packages are out of date and which.

func (Renderer) RenderUpdatesDetail added in v0.2.3

func (r Renderer) RenderUpdatesDetail(u UpdateStatus, width int) string

RenderUpdatesDetail renders the same with a longer package list.

func (Renderer) RenderWeather added in v0.2.3

func (r Renderer) RenderWeather(w WeatherData, width int) string

RenderWeather renders the compact weather summary.

func (Renderer) RenderWeatherDetail added in v0.2.3

func (r Renderer) RenderWeatherDetail(w WeatherData, width int) string

RenderWeatherDetail renders the extended forecast.

func (Renderer) RenderWorkspaceStatus added in v0.2.3

func (r Renderer) RenderWorkspaceStatus(primary, secondary, mode string, hints []KeyHint, width int) string

RenderWorkspaceStatus renders the workspace status strip with a clear hierarchy: a bold primary identity, optional muted secondary metadata, a transient mode capsule, and right-aligned key hints. It degrades in priority order — hints first, then secondary metadata — and never exceeds width.

func (Renderer) SoftPanelOverlay added in v0.2.1

func (r Renderer) SoftPanelOverlay(panel SoftPanel) Overlay

SoftPanelOverlay returns an Overlay whose content is already soft-panel chrome. The Overlay title/footer are intentionally empty so the legacy modal header bar is not rendered around it.

func (Renderer) SoftRail added in v0.2.1

func (r Renderer) SoftRail(active bool, bg lipgloss.Color) string

SoftRail renders the two-cell focus marker used in soft modal rows.

func (Renderer) SparkSample added in v0.2.3

func (r Renderer) SparkSample(style SparklineStyle, width int) string

SparkSample returns a plain sample sparkline for a style, e.g. for previews in a picker. It is unstyled so the caller can colour it to match its surface.

func (Renderer) ToneColor added in v0.2.3

func (r Renderer) ToneColor(tone Tone) lipgloss.Color

ToneColor resolves a semantic tone to a colour from the active theme. It is exported so an application can colour its own chrome to match a widget's tone without naming a colour, which is the whole point of the vocabulary.

type RepoActivity added in v0.2.3

type RepoActivity struct {
	Name    string
	Branch  string
	Summary string
	Commits int // commits made today
	Changes int // uncommitted files
	// Ahead and Behind count commits relative to the tracking branch.
	// Unpushed work is the thing a dashboard is best placed to catch, so it
	// is tracked separately rather than folded into Summary.
	Ahead      int
	Behind     int
	Stashes    int
	NoUpstream bool   // no tracking branch configured, which is not "clean"
	State      string // "rebase" or "merge" when one is half-finished
	Tone       Tone
}

RepoActivity is one repository's activity summary.

func (RepoActivity) Clean added in v0.2.3

func (r RepoActivity) Clean() bool

Clean reports whether a repository has nothing outstanding at all.

type RepoIcons added in v0.2.3

type RepoIcons struct {
	Branch     string // before a branch name
	Ahead      string // commits not pushed
	Behind     string // commits not pulled
	Changed    string // uncommitted files
	Stash      string // stashed entries
	NoUpstream string // branch tracks nothing
	Clean      string // nothing outstanding
	Attention  string // something outstanding
	Conflict   string // rebase or merge in progress
	Missing    string // not a working copy
}

RepoIcons are the marks the git widget draws for each kind of repository state. Every field must be exactly one cell wide.

func ASCIIRepoIcons added in v0.2.3

func ASCIIRepoIcons() RepoIcons

ASCIIRepoIcons is the fallback for themes that ask for ASCII.

func DefaultRepoIcons added in v0.2.3

func DefaultRepoIcons() RepoIcons

DefaultRepoIcons uses symbols present in essentially every monospace font. Each one was checked against a real terminal font before being chosen: a code point that a font lacks renders as a blank cell, and a blank is worse than a plainer mark that always draws. Rejected on those grounds: ⎇ and ⑂ (branch), ✔ and ✘ (ticks), ⇡ and ⇣ (arrows), ✎ (pencil), ⚑ (flag), ⌁ and ⌀ (no upstream).

func EmojiRepoIcons added in v0.2.3

func EmojiRepoIcons() RepoIcons

EmojiRepoIcons uses colour emoji, matching the weather widget. Every glyph is two cells wide, which the width table agrees with, so rows still line up.

func NerdRepoIcons added in v0.2.3

func NerdRepoIcons() RepoIcons

NerdRepoIcons uses Nerd Font glyphs. They are private-use code points, so they only draw in a patched font; opt in with StyleOptions.NerdIcons.

type ResponsivePolicy added in v0.2.3

type ResponsivePolicy struct {
	// Enabled turns semantic reflow on. When false the tree is returned as-is.
	Enabled bool
	// Hysteresis is the extra width required to leave a collapsed state once
	// entered, in columns. Zero uses 2.
	Hysteresis int
}

ResponsivePolicy interprets panels' generalized fallback rules and role defaults to produce a layout that fits a given width. It is stateless apart from the caller-owned threshold memory, which supplies hysteresis so a workspace does not flicker between layouts around a breakpoint.

func (ResponsivePolicy) Apply added in v0.2.3

func (p ResponsivePolicy) Apply(root LayoutNode, width int, panels map[string]*Panel, order []string, state map[string]int) (LayoutNode, map[string]bool, map[string]bool)

Apply returns a reflowed copy of root for width, along with the panels it hid and the panels it reduced to a collapsed header. The state map records the threshold currently active per panel and is updated in place.

type Row

type Row struct {
	Prefix   string
	Text     string
	Suffix   string
	Selected bool
	Muted    bool
}

Row is a generic themed list row with optional left and right content.

type SectionDivider added in v0.2.3

type SectionDivider struct {
	Label string
	Width int
	// Tone colours the rule and its label. ToneNeutral, the zero value, keeps
	// the quiet separator colouring a divider has by default; a tone makes the
	// rule itself carry meaning, which is what a divider labelled with a state
	// wants - the words and the line should agree.
	Tone Tone
}

SectionDivider is a labelled rule used to group content inside a panel.

type ServiceStatus added in v0.2.3

type ServiceStatus struct {
	Name   string
	Status StatusKind
	Age    string // short age, e.g. "3d", "2m", "--"
	Detail string
	Uptime string
	State  string
	Tone   Tone
}

ServiceStatus is one container or generic service. Status carries the shared dashboard vocabulary; State/Tone are optional display overrides for providers that want a custom word or colour.

type SoftHint added in v0.2.1

type SoftHint struct {
	Key   string
	Label string
}

SoftHint is one key/action pair in a soft modal footer.

type SoftPanel added in v0.2.1

type SoftPanel struct {
	Prefix  string
	Title   string
	Content string
	Width   int
}

SoftPanel describes the Tide-family soft modal chrome: a rounded panel with its application prefix and title embedded in the top border.

type SoftRow added in v0.2.1

type SoftRow struct {
	Prefix   string
	Text     string
	Suffix   string
	Selected bool
	Muted    bool
	Accent   bool // foreground uses the modal accent, e.g. for action buttons
}

SoftRow is a single-line selectable row for soft modal lists and palettes.

type SolvedLayout added in v0.2.3

type SolvedLayout struct {
	Width    int
	Height   int
	Regions  []SolvedRegion
	Rects    map[string]Rect
	Overflow bool // true when minimum sizes could not all be honored
}

SolvedLayout is the rectangle result of solving a layout tree.

func (SolvedLayout) RegionAt added in v0.2.3

func (s SolvedLayout) RegionAt(x, y int) (SolvedRegion, bool)

RegionAt returns the region containing a cell, if any.

func (SolvedLayout) RegionFor added in v0.2.3

func (s SolvedLayout) RegionFor(id string) (SolvedRegion, bool)

RegionFor returns the region containing a panel, if any.

type SolvedRegion added in v0.2.3

type SolvedRegion struct {
	Rect        Rect
	PanelIDs    []string
	ActiveIndex int
	TabStack    bool
}

SolvedRegion is one solved layout region. Leaf regions carry a single panel id; tab stacks carry several, with ActiveIndex naming the visible one.

func (SolvedRegion) ActivePanel added in v0.2.3

func (r SolvedRegion) ActivePanel() string

ActivePanel returns the panel currently visible in the region.

type Sparkline added in v0.2.3

type Sparkline struct {
	Values []float64
	Width  int
	Tone   Tone
}

Sparkline describes a compact trend glyph run.

type SparklineStyle added in v0.2.3

type SparklineStyle string

SparklineStyle selects the glyph ramp used by sparklines.

const (
	SparkBlocks  SparklineStyle = "blocks"  // ▁▂▃▄▅▆▇█ (default)
	SparkDots    SparklineStyle = "dots"    // ·∘○◉●
	SparkBraille SparklineStyle = "braille" // ⡀⡄⡆⡇⣇⣧⣷⣿
	SparkBullets SparklineStyle = "bullets" // ·○●
	SparkTicks   SparklineStyle = "ticks"   // ˌˈ│┃
	SparkShades  SparklineStyle = "shades"  // ░▒▓█
	// SparkHeat sizes and colours each sample by its own absolute value
	// rather than by where it falls within the run, so a quiet stretch stays
	// small and green instead of being stretched to fill the ramp. It reads
	// as a small heatmap: size carries magnitude, colour carries severity.
	SparkHeat SparklineStyle = "heat" // ·∘○◉● graded green → red
	// SparkWeighted bands the same way as SparkHeat but draws weight rather
	// than area: each step is a heavier vertical stroke, so the run reads as
	// heavier and hotter as the value climbs. The weight progression carries
	// the signal on its own, so it still reads on a monochrome terminal.
	SparkWeighted SparklineStyle = "weighted" // ╵╷│┃█ graded green → red
	// SparkStroke bands like the others but grows horizontally: each step is
	// a longer, heavier stroke, so a busy stretch reads as a thicker line.
	SparkStroke SparklineStyle = "stroke" // ╴─━█ graded green → red
)

func SparklineStyles added in v0.2.3

func SparklineStyles() []SparklineStyle

SparklineStyles lists the available sparkline styles in display order.

type SplitNode added in v0.2.3

type SplitNode struct {
	Orientation Orientation
	Children    []LayoutNode
	Weight      float64
}

SplitNode divides its region among children along Orientation.

type StatValue added in v0.2.3

type StatValue struct {
	Value string
	Unit  string
	Label string
	Tone  Tone
	Trend float64 // percentage change; 0 hides the indicator
}

StatValue is a headline figure with an optional unit, label, and trend.

type StatusBar

type StatusBar struct {
	Left  string
	Right string
}

StatusBar supplies optional left- and right-aligned footer text.

type StatusDot added in v0.2.3

type StatusDot struct {
	Label string
	Tone  Tone
}

StatusDot is a coloured status marker with an always-present text label, so meaning never depends on colour alone.

type StatusKind added in v0.2.3

type StatusKind int

StatusKind is the shared dashboard status vocabulary. Health and liveness are shown with a consistent glyph, tone, and word everywhere, so the same state reads the same way in Services, System, Network, and future widgets — and never depends on colour alone.

const (
	// StatusHealthy is nominal.
	StatusHealthy StatusKind = iota
	// StatusWarning needs attention but still works.
	StatusWarning
	// StatusError has failed.
	StatusError
	// StatusStopped is intentionally not running.
	StatusStopped
	// StatusActive is running and doing work.
	StatusActive
	// StatusStale has not reported recently.
	StatusStale
	// StatusUpdating is in a transitional state.
	StatusUpdating
)

func (StatusKind) Glyph added in v0.2.3

func (s StatusKind) Glyph(plain bool) string

Glyph returns the status marker, degrading to ASCII on plain terminals.

func (StatusKind) Label added in v0.2.3

func (s StatusKind) Label() string

Label returns the lowercase word for a status.

func (StatusKind) Tone added in v0.2.3

func (s StatusKind) Tone() Tone

Tone maps a status onto the semantic tone palette.

type StorageMount added in v0.2.3

type StorageMount struct {
	Path        string
	UsedPercent float64
	Used        string
	Total       string
	Tone        Tone
}

StorageMount is one mounted filesystem.

type StyleOptions

type StyleOptions struct {
	Density     Density
	PaneCorners PaneCorners
	Gauge       GaugeStyle
	Sparkline   SparklineStyle
	ClockFont   ClockFont
	Overrides   ThemeOverrides
	// SparkRamps replaces the glyphs of a banded sparkline style (heat,
	// weighted, stroke), lightest to heaviest. A missing or unusable entry
	// falls back to the built-in ramp, or its ASCII form for an ASCII theme.
	SparkRamps map[SparklineStyle]string
	// IconStyle picks the glyph family for widget icons. Empty means plain,
	// which is safe in any font; emoji and nerd need a colour emoji font or a
	// patched font respectively. An ASCII theme overrides this with ASCII.
	IconStyle IconStyle
	// RepoIcons overrides individual git widget icons. Empty fields keep the
	// resolved default.
	RepoIcons RepoIcons
	// CellAspect is how many times taller a terminal cell is than it is wide -
	// the number an image has to be sized by to keep its shape. Most fonts land
	// near 2 (a 7x15 cell, an 8x17 cell); measure it with CellAspectOf when the
	// terminal reports its pixels, and leave it zero to assume 2.
	CellAspect float64
	// CellWidth is one cell's width in pixels, measured with CellSizeOf. Zero
	// means nobody measured it, and anything that needs a pane's size in pixels
	// assumes 8 - the width a monospace cell has at a sane font size.
	CellWidth float64
	// SparkBands sets where a banded style changes glyph and colour, as
	// ascending fractions of full scale ending at 1, one per glyph in that
	// style's ramp. A missing or malformed entry falls back to the default.
	SparkBands map[SparklineStyle][]float64
	// ModalShadow draws a small drop shadow behind every modal overlay when
	// true. Off by default so existing consumers are unaffected unless they
	// opt in.
	ModalShadow bool
}

StyleOptions controls density, pane corner style, and optional theme color replacements.

type Styles

type Styles struct {
	Theme       Theme // resolved theme after any ThemeOverrides are applied
	PlainUI     bool  // true when the theme uses ASCII borders (e.g. VT52)
	Density     Density
	PaneCorners PaneCorners    // normalized; square unless RoundCorners was requested
	Gauge       GaugeStyle     // normalized; solid unless another style was requested
	Sparkline   SparklineStyle // normalized; blocks unless another style was requested
	ClockFont   ClockFont      // normalized; dash unless another font was requested

	// IconStyle is the normalized icon family, and RepoIcons the git icon set
	// resolved from it.
	IconStyle IconStyle
	RepoIcons RepoIcons

	// Banded holds the resolved configuration of each absolute-banded
	// sparkline style. Every ramp is validated against its own thresholds, so
	// a ramp and its bands are always the same length.
	Banded map[SparklineStyle]BandedRamp

	// ModalShadow and ModalShadowColor control the modal drop shadow drawn
	// by Renderer.Render. ModalShadowColor is resolved once here (from the
	// theme background) rather than recomputed on every render.
	ModalShadow      bool
	ModalShadowColor lipgloss.Color

	// Pane chrome — used internally; available for custom pane-like surfaces.
	Pane               lipgloss.Style // pane background fill
	PaneHeaderActive   lipgloss.Style // focused pane title bar
	PaneHeaderInactive lipgloss.Style // unfocused pane title bar

	// List items — pass to RenderRow or use directly for custom rows.
	Item         lipgloss.Style // default list row
	ItemMuted    lipgloss.Style // de-emphasised row (archived, read, disabled)
	ItemSelected lipgloss.Style // currently highlighted row

	// Inline annotations.
	Badge       lipgloss.Style // unread count or short tag rendered inside a row
	SearchMatch lipgloss.Style // highlighted substring within a search result

	// Detail pane content — compose these to build multi-section detail views.
	DetailTitle     lipgloss.Style // bold accent-background heading (e.g. subject line)
	DetailMeta      lipgloss.Style // dimmed italic secondary line (e.g. author, date)
	DetailBody      lipgloss.Style // plain body text; wraps to Width when set
	DetailFocusLine lipgloss.Style // subtle highlight for the cursor row in a detail list

	// Status bar segments — render text then join with StatusBarSeparator.
	StatusBar     lipgloss.Style // main status bar background and text
	StatusError   lipgloss.Style // error message segment (bold, error colour)
	StatusSuccess lipgloss.Style // success/confirmation segment (bold, Unread colour)
	StatusHint    lipgloss.Style // low-contrast keyboard hint
	StatusNotice  lipgloss.Style // accent-background announcement segment
	// StatusBarJoiner renders the separator returned by StatusBarSeparator.
	StatusBarJoiner lipgloss.Style

	// Overlay / modal content — used by renderOverlay; available for custom modals.
	Overlay      lipgloss.Style // modal border and background
	OverlayTitle lipgloss.Style // accent-background modal heading
	OverlayBody  lipgloss.Style // modal body text
	OverlayHint  lipgloss.Style // dimmed footer hint inside the modal

	// Form inputs — for text fields rendered inside an overlay.
	InputFocused lipgloss.Style // text field with focus border
	InputIdle    lipgloss.Style // text field without focus
	InputLabel   lipgloss.Style // label above a text field

	// Workspace chrome — resolved from the theme so panels, tabs, docking
	// previews, and key hints all stay within one palette.
	Workspace WorkspaceStyles
}

Styles exposes resolved Lipgloss styles for composing application content. All styles carry the correct theme background so rendering any piece of content inside a pane produces a cohesive, uniformly coloured surface.

func BuildStyles

func BuildStyles(base Theme, options StyleOptions) Styles

BuildStyles resolves a theme and options into reusable Lipgloss styles.

func (Styles) ListItemLineStride

func (s Styles) ListItemLineStride() int

ListItemLineStride returns the terminal-line height expected per rendered row.

func (Styles) PaneFrame added in v0.2.0

func (s Styles) PaneFrame(focused bool, accent lipgloss.Color) lipgloss.Style

PaneFrame returns a full 4-sided border box for a pane, colored to signal whether that pane currently has focus. accent overrides the theme's BorderFocus color when the pane supplies its own (see Pane.Accent).

func (Styles) StatusBarSeparator

func (s Styles) StatusBarSeparator() string

StatusBarSeparator returns theme-appropriate separator text for footer segments.

type SystemMetrics added in v0.2.3

type SystemMetrics struct {
	CPUPercent    float64
	CPUSpark      []float64
	Cores         []float64
	MemoryPercent float64
	MemoryUsed    string
	MemoryTotal   string
	TemperatureC  int
	Load          [3]float64
	Uptime        time.Duration
	Processes     int
}

SystemMetrics backs the system-health widget.

type TabItem added in v0.2.3

type TabItem struct {
	Title string
	Badge string
	Muted bool
}

TabItem is one tab in a tab strip.

type TabStackNode added in v0.2.3

type TabStackNode struct {
	Panels []string
	Active int // index into Panels; clamped by the solver
	Weight float64
}

TabStackNode is a set of panels sharing one region, shown one at a time.

type Task added in v0.2.3

type Task struct {
	Title string
	Done  bool
	Due   string
	Tags  []string
	Tone  Tone
}

Task is one task-list item.

type Theme

type Theme struct {
	Name          string         // identifier used by ThemeByName and ThemePicker
	Bg            lipgloss.Color // pane background
	Fg            lipgloss.Color // primary text
	Border        lipgloss.Color // unfocused pane border and inactive tab header background
	BorderFocus   lipgloss.Color // focused pane border, active tab header background, and accent highlight
	Selected      lipgloss.Color // selected list item background (falls back to BorderFocus)
	Unread        lipgloss.Color // badge / unread-count foreground
	Dimmed        lipgloss.Color // muted text; the renderer raises contrast if the raw value fails WCAG 3:1
	StatusBar     lipgloss.Color // status bar background
	StatusFg      lipgloss.Color // status bar text
	Error         lipgloss.Color // error text in the status bar
	Overlay       lipgloss.Color // modal background; defaults to a lightness-adjusted Bg when empty
	OverlayBorder lipgloss.Color // modal border; falls back to Border when empty

	// Family and Variant group related palettes in pickers, e.g. "Catppuccin"
	// and "Mocha". Both may be empty for a theme that stands alone.
	Family  string
	Variant string

	// Optional semantic roles. An empty role falls back to a color the theme
	// already has (see the *Color accessors), so a Theme literal that sets only
	// the fields above keeps working.
	Success lipgloss.Color // confirmations and "ok" states
	Warning lipgloss.Color // cautions
	Link    lipgloss.Color // hyperlinks
	Quote   lipgloss.Color // quoted text
	Match   lipgloss.Color // search matches
	Tag     lipgloss.Color // tags and pills
	Cursor  lipgloss.Color // text cursor and focus-line marker
}

Theme contains the semantic colors used by the shell and its components.

func CorrectThemeContrast added in v0.2.3

func CorrectThemeContrast(t Theme) Theme

CorrectThemeContrast nudges each colour of t until it is readable against the theme's own background, and returns the corrected theme. It is safe to call on a theme that already passes: colours that clear their floor are returned untouched, so a hand-tuned palette is not repainted.

Name and Bg are never changed: the background is the reference everything else is corrected against.

func ThemeByName

func ThemeByName(name string) (Theme, bool)

ThemeByName returns a built-in theme by name, falling back to Catppuccin Mocha.

func (Theme) CursorColor added in v0.3.0

func (t Theme) CursorColor() lipgloss.Color

CursorColor is Cursor (Fg when unset), visible on Bg at 3:1.

func (Theme) ErrorColor added in v0.3.0

func (t Theme) ErrorColor() lipgloss.Color

ErrorColor is Error readable on Bg at 4.5:1.

func (Theme) IsLight added in v0.3.0

func (t Theme) IsLight() bool

IsLight reports whether the theme has a light background.

func (Theme) Label added in v0.3.0

func (t Theme) Label() string

Label is the human-readable name pickers show: the family and variant, or the Name when the theme has no family.

func (Theme) LinkColor added in v0.3.0

func (t Theme) LinkColor() lipgloss.Color

LinkColor is Link (BorderFocus when unset), readable on Bg at 4.5:1.

func (Theme) MatchColor added in v0.3.0

func (t Theme) MatchColor() lipgloss.Color

MatchColor is Match (BorderFocus when unset), visible on Bg at 3:1.

func (Theme) QuoteColor added in v0.3.0

func (t Theme) QuoteColor() lipgloss.Color

QuoteColor is Quote (Dimmed when unset), readable on Bg at 4.5:1.

func (Theme) SuccessColor added in v0.3.0

func (t Theme) SuccessColor() lipgloss.Color

SuccessColor is Success (Unread when unset), readable on Bg at 4.5:1.

func (Theme) TagColor added in v0.3.0

func (t Theme) TagColor() lipgloss.Color

TagColor is Tag (BorderFocus when unset), readable on Bg at 4.5:1.

func (Theme) UnreadColor added in v0.3.0

func (t Theme) UnreadColor() lipgloss.Color

UnreadColor is Unread readable on Bg at 4.5:1.

func (Theme) UsesASCII

func (t Theme) UsesASCII() bool

UsesASCII reports whether this theme uses plain terminal presentation.

func (Theme) WarningColor added in v0.3.0

func (t Theme) WarningColor() lipgloss.Color

WarningColor is Warning (Error when unset), readable on Bg at 4.5:1.

type ThemeOverrides

type ThemeOverrides struct {
	Background lipgloss.Color
	Foreground lipgloss.Color
	Accent     lipgloss.Color
}

ThemeOverrides replaces presentation colors without requiring a new theme.

func (ThemeOverrides) Apply

func (o ThemeOverrides) Apply(base Theme) Theme

Apply returns base with each non-empty override applied.

type ThemePicker

type ThemePicker struct {
	// contains filtered or unexported fields
}

ThemePicker manages theme navigation, preview, confirmation, and modal output.

Applications remain responsible for persistence and terminal background control sequences after inspecting the picker result and active theme.

func NewThemePicker

func NewThemePicker(options ThemePickerOptions) ThemePicker

NewThemePicker creates a picker with an initially confirmed selection.

func (ThemePicker) ConfirmedTheme

func (p ThemePicker) ConfirmedTheme() Theme

ConfirmedTheme returns the most recently confirmed theme.

func (ThemePicker) Modal

func (p ThemePicker) Modal(renderer Renderer, width, height int) Overlay

Modal renders the picker as an Overlay for assignment to Layout.Modal. Height limits the number of rendered themes while keeping the cursor visible.

func (*ThemePicker) Open

func (p *ThemePicker) Open(confirmedName string)

Open displays the picker and begins a preview session from confirmedName. An unknown name selects the first configured theme.

func (ThemePicker) Opened

func (p ThemePicker) Opened() bool

Opened reports whether the picker should currently be displayed.

func (ThemePicker) PreviewTheme

func (p ThemePicker) PreviewTheme() Theme

PreviewTheme returns the currently highlighted theme.

func (*ThemePicker) SetTitle added in v0.2.3

func (p *ThemePicker) SetTitle(title string)

SetTitle changes the modal title. Empty restores the default "THEME". Use it to label what the picker is editing, e.g. a specific panel's theme.

func (ThemePicker) SoftModal added in v0.2.1

func (p ThemePicker) SoftModal(renderer Renderer, width, height int, prefix string) Overlay

SoftModal renders the picker as a soft-panel Overlay for assignment to Layout.Modal. Prefix labels the app family member in the top border; empty uses "tide".

func (*ThemePicker) Update

func (p *ThemePicker) Update(msg tea.KeyMsg) ThemePickerAction

Update applies the picker's standard navigation and completion keys. After navigation, applications can rebuild their renderer from PreviewTheme.

type ThemePickerAction

type ThemePickerAction int

ThemePickerAction reports terminal picker actions after an input update.

const (
	// ThemePickerNone indicates navigation or ignored input.
	ThemePickerNone ThemePickerAction = iota
	// ThemePickerConfirm indicates that the previewed theme was confirmed.
	ThemePickerConfirm
	// ThemePickerCancel indicates that the preview was reverted.
	ThemePickerCancel
)

type ThemePickerOptions

type ThemePickerOptions struct {
	// Themes supplies selectable palettes. Empty uses BuiltinThemes.
	Themes []Theme
	// InitialTheme is the initially confirmed theme name.
	InitialTheme string
	// Title labels the modal. Empty uses "THEME".
	Title string
}

ThemePickerOptions configures a reusable theme selection modal.

type Tone added in v0.2.3

type Tone int

Tone is a semantic intent used by badges, metrics, and gauges. Every tone resolves to a theme token, so meaning never depends on a literal colour and survives low-colour themes.

const (
	// ToneNeutral is ordinary, non-emphasised content.
	ToneNeutral Tone = iota
	// ToneAccent marks the current/active thing.
	ToneAccent
	// ToneGood is success, healthy, or in-range.
	ToneGood
	// ToneWarning is degraded or approaching a limit.
	ToneWarning
	// ToneDanger is an error or out-of-range value.
	ToneDanger
	// ToneMuted is deliberately de-emphasised.
	ToneMuted
)

type UpdatePackage added in v0.2.3

type UpdatePackage struct {
	Name string
	From string
	To   string
}

UpdatePackage is one pending package update.

type UpdateStatus added in v0.2.3

type UpdateStatus struct {
	Omarchy        string // installed version
	OmarchyPending string // version waiting, empty when current
	Repo           []UpdatePackage
	AUR            []UpdatePackage
	Checked        time.Time
	// Unavailable explains why a count is missing rather than zero, e.g.
	// "checkupdates not installed".
	Unavailable string
}

UpdateStatus backs the updates widget.

func (UpdateStatus) Pending added in v0.2.3

func (u UpdateStatus) Pending() int

Pending reports how many package updates are waiting.

type WeatherData added in v0.2.3

type WeatherData struct {
	Location     string
	Temperature  int
	Unit         string // "F" or "C"
	Condition    string
	Kind         WeatherKind // optional; derived from Condition when unknown
	FeelsLike    int
	HasFeelsLike bool
	High         int
	Low          int
	RainChance   int
	WindSpeed    int
	WindUnit     string
	Hourly       []ForecastPoint
	Daily        []ForecastPoint
	Updated      time.Time
}

WeatherData backs the weather widget.

func (WeatherData) EffectiveKind added in v0.2.3

func (w WeatherData) EffectiveKind() WeatherKind

EffectiveKind returns the explicit Kind when set, otherwise the kind implied by the Condition text.

type WeatherKind added in v0.2.3

type WeatherKind int

WeatherKind is a coarse condition class used to pick a glyph and colour.

const (
	WeatherUnknown WeatherKind = iota
	WeatherClear
	WeatherPartly
	WeatherCloudy
	WeatherFog
	WeatherRain
	WeatherSnow
	WeatherStorm
)

func WeatherKindFromCondition added in v0.2.3

func WeatherKindFromCondition(condition string) WeatherKind

WeatherKindFromCondition maps a free-form condition string to a coarse kind. It matches common words, so provider text and hand-written demo strings both resolve to the same small vocabulary.

func (WeatherKind) Glyph added in v0.2.3

func (k WeatherKind) Glyph(plain bool) string

Glyph returns a two-cell colour weather emoji for the kind. The glyphs are astral emoji with U+FE0F so the width table and the terminal agree on two cells; astral emoji are also rendered by the colour emoji font without the fallback the BMP symbols hit. Plain UI falls back to ASCII.

type Workspace added in v0.2.3

type Workspace struct {
	// contains filtered or unexported fields
}

Workspace owns a set of registered panels, a layout tree, and all the interaction state around them: focus, visibility, zoom, peek, arrange mode, pane resizing, presets, and undo/redo. It never talks to the terminal and never renders; applications drive it and hand the resolved view to a WorkspaceRenderer.

func NewWorkspace added in v0.2.3

func NewWorkspace(options ...WorkspaceOption) *Workspace

NewWorkspace creates an empty workspace. Register panels with Panel, then declare a layout with Layout; without an explicit layout an adaptive default is derived from panel roles.

func (*Workspace) ActivePreset added in v0.2.3

func (ws *Workspace) ActivePreset() string

ActivePreset returns the most recently applied preset name, or "".

func (*Workspace) AddPreset added in v0.2.3

func (ws *Workspace) AddPreset(name string, root LayoutNode, hidden ...string)

AddPreset registers a preset.

func (*Workspace) Animation added in v0.2.3

func (ws *Workspace) Animation() *Animator

Animation exposes the workspace animator.

func (*Workspace) ApplyPreset added in v0.2.3

func (ws *Workspace) ApplyPreset(name string) bool

ApplyPreset switches to a named preset.

func (*Workspace) ArrangeCursor added in v0.2.3

func (ws *Workspace) ArrangeCursor() string

ArrangeCursor returns the neighbour the last move docked against.

func (*Workspace) ArrangeDrop added in v0.2.3

func (ws *Workspace) ArrangeDrop() bool

ArrangeDrop finishes arrange mode. Moves are applied as they happen, so dropping only leaves the mode.

func (*Workspace) ArrangeMerge added in v0.2.3

func (ws *Workspace) ArrangeMerge() bool

ArrangeMerge folds the focused panel into the cursor's tab stack.

func (*Workspace) ArrangeMove added in v0.2.3

func (ws *Workspace) ArrangeMove(dir Direction) bool

ArrangeMove moves the focused panel one region in a direction. The layout updates immediately and the move is recorded, so the moving panel is visible in its new position rather than behind a preview overlay.

func (*Workspace) Arranging added in v0.2.3

func (ws *Workspace) Arranging() bool

Arranging reports whether arrange mode is active.

func (*Workspace) CanFocus added in v0.2.3

func (ws *Workspace) CanFocus(id string) bool

CanFocus reports whether a panel may currently receive focus.

func (*Workspace) CanRedo added in v0.2.3

func (ws *Workspace) CanRedo() bool

func (*Workspace) CanUndo added in v0.2.3

func (ws *Workspace) CanUndo() bool

CanUndo / CanRedo report history availability.

func (*Workspace) CommandPalette added in v0.2.3

func (ws *Workspace) CommandPalette() *CommandPalette

CommandPalette returns the framework command palette.

func (*Workspace) Commands added in v0.2.3

func (ws *Workspace) Commands() []Command

Actions returns every workspace-level and panel-level command.

func (*Workspace) EnterArrange added in v0.2.3

func (ws *Workspace) EnterArrange() bool

EnterArrange starts live panel rearrangement on the focused panel. Direction keys move the panel between neighbouring regions immediately, so the real layout is its own preview: the panel is shown where it will land, gaps close behind it, and every move is recorded in history. t folds the panel into a neighbouring tab stack; Escape leaves the mode.

func (*Workspace) EnterPane added in v0.2.3

func (ws *Workspace) EnterPane() bool

EnterPane gives the focused pane the keyboard: its own keys work - a list's cursor, a form's fields - while the tiled layout stays on screen, so a panel can be walked without zooming it. Any pane can be entered; one with nothing of its own to walk simply takes the keys it has, which keeps the gesture the same everywhere. LeavePane hands them back, and so does moving focus.

Entering is not zooming. Zoom decides how much room a panel gets; entering decides who reads the keys, which is why a zoomed panel has the keyboard too.

func (*Workspace) EnteredPane added in v0.2.3

func (ws *Workspace) EnteredPane() string

EnteredPane is the pane holding the keyboard, or "" when the workspace has it.

func (*Workspace) ExitArrange added in v0.2.3

func (ws *Workspace) ExitArrange()

ExitArrange leaves arrange mode.

func (*Workspace) Focus added in v0.2.3

func (ws *Workspace) Focus(id string) bool

Focus sets focus if the panel exists, is focusable, and is visible.

func (*Workspace) FocusDirection added in v0.2.3

func (ws *Workspace) FocusDirection(dir Direction) bool

FocusDirection moves focus to the nearest panel in a direction.

func (*Workspace) FocusNext added in v0.2.3

func (ws *Workspace) FocusNext() bool

FocusNext moves focus to the next visible focusable panel.

func (*Workspace) FocusPresentation added in v0.2.3

func (ws *Workspace) FocusPresentation() FocusPresentation

FocusPresentation returns the active focus presentation settings.

func (*Workspace) FocusPrev added in v0.2.3

func (ws *Workspace) FocusPrev() bool

FocusPrev moves focus to the previous visible focusable panel.

func (*Workspace) Focused added in v0.2.3

func (ws *Workspace) Focused() string

Focused returns the focused panel id, or "".

func (*Workspace) HandleKey added in v0.2.3

func (ws *Workspace) HandleKey(msg tea.KeyMsg) bool

HandleKey routes a key to whichever workspace interaction is active. It reports whether the key was consumed. Applications handle their own domain keys first and fall back to HandleKey.

func (*Workspace) HandleMouse added in v0.2.3

func (ws *Workspace) HandleMouse(msg tea.MouseMsg) bool

HandleMouse routes a mouse event to focus, tab switching, and separator dragging. Mouse support is additive: every action has a keyboard equivalent.

func (*Workspace) Height added in v0.2.3

func (ws *Workspace) Height() int

func (*Workspace) Hidden added in v0.2.3

func (ws *Workspace) Hidden(id string) bool

Hidden reports whether a panel is manually hidden.

func (*Workspace) Hide added in v0.2.3

func (ws *Workspace) Hide(id string) bool

Hide hides a hideable panel and records it in history.

func (*Workspace) IsVisible added in v0.2.3

func (ws *Workspace) IsVisible(id string) bool

IsVisible reports whether a panel is currently laid out, taking responsive hiding into account. Call after Solve.

func (*Workspace) Layout added in v0.2.3

func (ws *Workspace) Layout(root LayoutNode) *Workspace

Layout replaces the layout tree. A missing or empty tree falls back to the role-derived default.

func (*Workspace) LeavePane added in v0.2.3

func (ws *Workspace) LeavePane() bool

LeavePane returns the keyboard to the workspace.

func (*Workspace) Lookup added in v0.2.3

func (ws *Workspace) Lookup(id string) (*Panel, bool)

Lookup returns a registered panel by id.

func (*Workspace) OpenCommandPalette added in v0.2.3

func (ws *Workspace) OpenCommandPalette()

OpenCommandPalette shows the command palette fed by Commands.

func (*Workspace) OpenPanelPicker added in v0.2.3

func (ws *Workspace) OpenPanelPicker()

OpenPanelPicker shows the panel picker.

func (*Workspace) Overlay added in v0.2.3

func (ws *Workspace) Overlay(r Renderer) *Overlay

Overlay returns the modal overlay for whichever picker is open, or nil.

func (*Workspace) PaneHasKeyboard added in v0.2.3

func (ws *Workspace) PaneHasKeyboard(id string) bool

PaneHasKeyboard reports whether a pane reads the keys itself, because it was entered or because it owns the screen. One question with one answer: a panel that draws a cursor asks this rather than inferring it from the zoom.

func (*Workspace) Panel added in v0.2.3

func (ws *Workspace) Panel(id string, view PanelView) *Panel

Panel registers a panel, or returns the existing one (updating its view) if the id is already registered. The returned panel is configured fluently.

func (*Workspace) PanelAt added in v0.2.3

func (ws *Workspace) PanelAt(x, y int) (id string, contentX, contentY int, ok bool)

PanelAt returns the panel under a screen coordinate along with the point relative to that panel's content area (inside its frame), so a panel that maps clicks to its own rows can resolve one. ok is false outside any panel.

func (*Workspace) PanelIDs added in v0.2.3

func (ws *Workspace) PanelIDs() []string

PanelIDs returns registered panel ids in registration order.

func (*Workspace) PanelPicker added in v0.2.3

func (ws *Workspace) PanelPicker() *PanelPicker

PanelPicker returns the framework panel picker.

func (*Workspace) PanelRect added in v0.2.3

func (ws *Workspace) PanelRect(id string) (Rect, bool)

PanelRect returns the screen rectangle a visible panel occupies. It is the inverse of PanelAt, so a caller can place a click or a test can find the panel to aim one at.

func (*Workspace) Panels added in v0.2.3

func (ws *Workspace) Panels() []*Panel

Panels returns registered panels in registration order.

func (*Workspace) Peek added in v0.2.3

func (ws *Workspace) Peek(id string) bool

Peek temporarily shows a panel without changing the saved layout.

func (*Workspace) Peeked added in v0.2.3

func (ws *Workspace) Peeked() string

Peeked returns the peeked panel id, or "".

func (*Workspace) Persist added in v0.2.3

func (ws *Workspace) Persist() error

Persist writes the current layout to the configured store. Zoom, peek, and other transient modes are deliberately omitted.

func (*Workspace) PersistedJSON added in v0.2.3

func (ws *Workspace) PersistedJSON() ([]byte, error)

PersistedJSON returns the serialized layout without writing it, for callers that manage their own storage.

func (*Workspace) PresetNames added in v0.2.3

func (ws *Workspace) PresetNames() []string

PresetNames returns preset names in registration order.

func (*Workspace) Presets added in v0.2.3

func (ws *Workspace) Presets() []Preset

Presets returns registered presets.

func (*Workspace) Redo added in v0.2.3

func (ws *Workspace) Redo() bool

Redo restores the next layout state.

func (*Workspace) Reflow added in v0.2.3

func (ws *Workspace) Reflow(width, height int)

Reflow recomputes the cached responsive choice for a new width, applying hysteresis so layouts do not oscillate around a breakpoint.

func (*Workspace) RemovePanel added in v0.2.3

func (ws *Workspace) RemovePanel(id string) bool

RemovePanel unregisters a panel entirely: it leaves the panel list, the layout tree and the view state. Unlike Hide, it cannot be shown again, so it is for a panel that no longer exists - an uninstalled plugin.

func (*Workspace) ResetLayout added in v0.2.3

func (ws *Workspace) ResetLayout()

ResetLayout returns to the declared default arrangement, or the role-derived default when none was declared.

func (*Workspace) ResizeEdge added in v0.2.3

func (ws *Workspace) ResizeEdge(dir Direction) bool

ResizeEdge moves the focused pane's shared edge in a direction, Tide-style. The edge on the arrow's side moves that way: when a neighbour sits there the pane grows into it, and when it does not the opposite edge moves inward and the pane shrinks. The step is a share of the split's extent, clamped so neither side crosses its minimum size.

func (*Workspace) ResizeEdgePixels added in v0.2.3

func (ws *Workspace) ResizeEdgePixels(dir Direction, pixels int, record bool) bool

ResizeEdgePixels moves the focused pane's shared edge by a pixel amount in a direction; a negative amount moves it the other way. It is used by mouse separator dragging, which batches history until the drag ends.

func (*Workspace) ResizeGrow added in v0.2.3

func (ws *Workspace) ResizeGrow(delta float64) bool

ResizeGrow increases the focused pane along whichever axis it can resize. The delta argument is retained for API compatibility; the step is a share of the split extent.

func (*Workspace) ResizeHeight added in v0.2.3

func (ws *Workspace) ResizeHeight(grow bool) bool

ResizeHeight grows (grow=true) or shrinks the focused pane's height.

func (*Workspace) ResizeShrink added in v0.2.3

func (ws *Workspace) ResizeShrink(delta float64) bool

ResizeShrink decreases the focused pane along whichever axis it can resize.

func (*Workspace) ResizeStatus added in v0.2.3

func (ws *Workspace) ResizeStatus() string

ResizeStatus returns the transient size feedback ("width 37%") while it is fresh, or "".

func (*Workspace) ResizeWidth added in v0.2.3

func (ws *Workspace) ResizeWidth(grow bool) bool

ResizeWidth grows (grow=true) or shrinks the focused pane's width, trading with the nearest neighbour along the width axis.

func (*Workspace) Restore added in v0.2.3

func (ws *Workspace) Restore() error

Restore loads a persisted layout. Invalid or empty layouts leave the current state untouched and return an error. Unknown panels (for example after an app upgrade) are dropped, and the remaining layout is used when it is still valid.

func (*Workspace) RestoreJSON added in v0.2.3

func (ws *Workspace) RestoreJSON(data []byte) error

RestoreJSON replaces the layout from serialized bytes.

func (*Workspace) RootLayout added in v0.2.3

func (ws *Workspace) RootLayout() LayoutNode

RootLayout returns the current explicit tree, or nil when the default is in use.

func (*Workspace) RunFocusedAction added in v0.2.3

func (ws *Workspace) RunFocusedAction(key string) bool

RunFocusedAction runs the focused panel's action bound to key, if any. It returns whether an action fired. Applications that handle their own keys first can still call this explicitly.

func (*Workspace) SavePreset added in v0.2.3

func (ws *Workspace) SavePreset(name string)

SavePreset captures the current layout as a user preset.

func (*Workspace) SetFocusPresentation added in v0.2.3

func (ws *Workspace) SetFocusPresentation(p FocusPresentation)

SetFocusPresentation replaces the focus presentation.

func (*Workspace) Show added in v0.2.3

func (ws *Workspace) Show(id string) bool

Show reveals a hidden panel and records it in history.

func (*Workspace) Solve added in v0.2.3

func (ws *Workspace) Solve(width, height int) SolvedLayout

Solve recomputes rectangles for a terminal size and caches the result for hit-testing. It is safe to call on every render and never panics, even at extremely small sizes.

func (*Workspace) Solved added in v0.2.3

func (ws *Workspace) Solved() SolvedLayout

Solved returns the most recent solved layout.

func (*Workspace) SolvedTree added in v0.2.3

func (ws *Workspace) SolvedTree() LayoutNode

SolvedTree returns the tree used for the most recent solve, after hidden panels were removed and responsive rules applied.

func (*Workspace) ToggleArrange added in v0.2.3

func (ws *Workspace) ToggleArrange() bool

ToggleArrange enters or leaves arrange mode.

func (*Workspace) TogglePanel added in v0.2.3

func (ws *Workspace) TogglePanel(id string) bool

TogglePanel flips a panel's manual visibility.

func (*Workspace) ToggleZoom added in v0.2.3

func (ws *Workspace) ToggleZoom() bool

ToggleZoom maximizes the focused panel, or restores the layout.

func (*Workspace) Undo added in v0.2.3

func (ws *Workspace) Undo() bool

Undo restores the previous layout state.

func (*Workspace) Unpeek added in v0.2.3

func (ws *Workspace) Unpeek() bool

Unpeek dismisses the peeked panel.

func (*Workspace) Unzoom added in v0.2.3

func (ws *Workspace) Unzoom() bool

Unzoom restores the pre-zoom layout.

func (*Workspace) VisiblePanels added in v0.2.3

func (ws *Workspace) VisiblePanels() []string

VisiblePanels returns the panels present in the last solved tree.

func (*Workspace) Width added in v0.2.3

func (ws *Workspace) Width() int

Width and Height return the last solved terminal size.

func (*Workspace) Zoom added in v0.2.3

func (ws *Workspace) Zoom(id string) bool

Zoom maximizes a panel without altering the saved layout.

func (*Workspace) Zoomed added in v0.2.3

func (ws *Workspace) Zoomed() string

Zoomed returns the temporarily maximized panel id, or "".

type WorkspaceOption added in v0.2.3

type WorkspaceOption func(*Workspace)

WorkspaceOption configures a Workspace at construction time.

func WithAdaptiveLayout added in v0.2.3

func WithAdaptiveLayout() WorkspaceOption

WithAdaptiveLayout enables semantic responsive reflow.

func WithAnimation added in v0.2.3

func WithAnimation(options AnimationOptions) WorkspaceOption

WithAnimation overrides animation behaviour.

func WithFocusPresentation added in v0.2.3

func WithFocusPresentation(p FocusPresentation) WorkspaceOption

WithFocusPresentation overrides how focus is signalled.

func WithGap added in v0.2.3

func WithGap(gap int) WorkspaceOption

WithGap sets the blank cells left between regions on both axes.

func WithGaps added in v0.2.3

func WithGaps(horizontal, vertical int) WorkspaceOption

WithGaps sets the horizontal (column) and vertical (row) gaps separately. A vertical gap of zero stacks panels flush, so vertically adjacent borders touch instead of leaving a blank row between them.

func WithHistoryLimit added in v0.2.3

func WithHistoryLimit(limit int) WorkspaceOption

WithHistoryLimit bounds the layout undo stack.

func WithPersistence added in v0.2.3

func WithPersistence(id string) WorkspaceOption

WithPersistence enables layout persistence under an application-scoped key. The default store is in-memory; pair with WithStore for durable storage.

func WithPresets added in v0.2.3

func WithPresets(presets ...Preset) WorkspaceOption

WithPresets installs application-provided workspace presets.

func WithStore added in v0.2.3

func WithStore(store LayoutStore) WorkspaceOption

WithStore installs a layout store for persistence.

type WorkspaceRenderOptions added in v0.2.3

type WorkspaceRenderOptions struct {
	// ShowStatus reserves a bottom status strip.
	ShowStatus bool
	// StatusLeft, StatusSecondary, and StatusRight override the status strip's
	// identity, secondary metadata, and right-hand commands.
	StatusLeft      string
	StatusSecondary string
	StatusRight     string
	// ShowKeyHints renders focused-panel action hints in the panel footer.
	ShowKeyHints bool
	// ShowArrangeCard shows the compact arrange-mode cheat sheet.
	ShowArrangeCard bool
	// StatusHints are appended to the default status-bar key hints for
	// application-level shortcuts (for example a settings panel).
	StatusHints []KeyHint
	// StatusNotice, when set, is shown as the status strip's mode capsule
	// while no transient mode (arrange/resize/zoom) is active. Use it for
	// short-lived application feedback such as "settings applied".
	StatusNotice string
}

WorkspaceRenderOptions tunes the optional chrome the workspace draws.

type WorkspaceRenderer added in v0.2.3

type WorkspaceRenderer struct {
	Renderer Renderer
	Options  WorkspaceRenderOptions
}

WorkspaceRenderer turns a solved workspace into a themed, bounded string. It owns no state beyond the Renderer whose styles and theme it shares.

func NewWorkspaceRenderer added in v0.2.3

func NewWorkspaceRenderer(renderer Renderer) WorkspaceRenderer

NewWorkspaceRenderer creates a workspace renderer over an existing Renderer.

func (WorkspaceRenderer) Render added in v0.2.3

func (wr WorkspaceRenderer) Render(ws *Workspace, width, height int) string

Render lays out and draws the workspace for a terminal size. It recomputes the layout every call, so terminal resizes are reflected immediately and never produce an out-of-bounds rectangle.

type WorkspaceStyles added in v0.2.3

type WorkspaceStyles struct {
	// Surfaces.
	Bg             lipgloss.Color // workspace page background, fills gutters
	SurfaceBg      lipgloss.Color // idle panel body
	FocusSurfaceBg lipgloss.Color // focused panel body (subtle lift)
	RaisedBg       lipgloss.Color // capsules, rails, hovered rows

	// Panel frames.
	FrameActive lipgloss.Color
	FrameIdle   lipgloss.Color
	FrameDimmed lipgloss.Color

	// Titles.
	TitleActiveBg lipgloss.Color
	TitleActiveFg lipgloss.Color
	TitleIdleFg   lipgloss.Color
	TitleDimmedFg lipgloss.Color
	SubtitleFg    lipgloss.Color

	// Bodies.
	BodyFg       lipgloss.Color
	BodyDimmedFg lipgloss.Color
	BodyMutedFg  lipgloss.Color

	// Tabs.
	TabActiveBg lipgloss.Color
	TabActiveFg lipgloss.Color
	TabIdleBg   lipgloss.Color
	TabIdleFg   lipgloss.Color
	TabBadgeBg  lipgloss.Color
	TabBadgeFg  lipgloss.Color

	// Badges.
	BadgeFg        lipgloss.Color
	BadgeBg        lipgloss.Color
	BadgeGoodBg    lipgloss.Color
	BadgeGoodFg    lipgloss.Color
	BadgeWarningBg lipgloss.Color
	BadgeWarningFg lipgloss.Color
	BadgeDangerBg  lipgloss.Color
	BadgeDangerFg  lipgloss.Color

	// Selection.
	SelectionBg         lipgloss.Color
	SelectionFg         lipgloss.Color
	SelectionInactiveBg lipgloss.Color
	SelectionInactiveFg lipgloss.Color
	SelectionBar        lipgloss.Color
	FocusRail           lipgloss.Color
	HoverBg             lipgloss.Color

	// Separators and chrome.
	Separator lipgloss.Color

	// Keyboard hints.
	KeyBg       lipgloss.Color
	KeyFg       lipgloss.Color
	KeyMutedBg  lipgloss.Color
	FooterKeyFg lipgloss.Color
	HintFg      lipgloss.Color

	// Metrics.
	MetricGood    lipgloss.Color
	MetricWarning lipgloss.Color
	MetricBad     lipgloss.Color
	MetricTrack   lipgloss.Color
	MetricYellow  lipgloss.Color
	MetricOrange  lipgloss.Color

	// Weather.
	WeatherSun   lipgloss.Color
	WeatherCloud lipgloss.Color
	WeatherRain  lipgloss.Color
	WeatherSnow  lipgloss.Color
	WeatherStorm lipgloss.Color
	WeatherFog   lipgloss.Color

	// Arrange / docking.
	DockColor lipgloss.Color
	DockFill  lipgloss.Color
}

WorkspaceStyles is TideUI's semantic visual-token set. Every token is resolved from the active Theme with safe fallbacks, so any theme — including a hand-written or low-colour one — yields a coherent, readable result without the widgets naming a single raw colour.

func (WorkspaceStyles) MetricGradient added in v0.2.3

func (ws WorkspaceStyles) MetricGradient(fraction float64) lipgloss.Color

MetricGradient maps a 0..1 fraction onto the conventional metric scale: green at the low end, then yellow, orange, and red at the high end. It is used to colour sparkline cells by their place in the value range.

func (WorkspaceStyles) WeatherColor added in v0.2.3

func (ws WorkspaceStyles) WeatherColor(kind WeatherKind) lipgloss.Color

WeatherColor maps a coarse weather kind to its themed colour, falling back to the muted body colour for unknown conditions.

type WorldClock added in v0.2.3

type WorldClock struct {
	City   string
	Time   time.Time
	Offset string // "+9", "-5"
}

WorldClock is one city in the clock widget.

Directories

Path Synopsis
cmd
demo command

Jump to

Keyboard shortcuts

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