Documentation
¶
Overview ¶
Package ui — components.go provides reusable rendering helpers for panels.
Package ui — dashboard.go renders the K9s-inspired dashboard view.
Package ui — detail_views.go renders K9s-style full-screen detail views.
Package ui provides styling constants and helpers using Lipgloss. Uses a K9s-inspired dark theme with cyan/blue accents.
Index ¶
- Variables
- func DetailBodySize(width, height int) (bodyWidth int, bodyHeight int)
- func RenderBenchDetail(ds *state.Dashboard, width, height int) string
- func RenderCommandBar(bindings []KeyBinding, width int) string
- func RenderCrumbs(items ...string) string
- func RenderDashboard(ds *state.Dashboard, width, height int) string
- func RenderDepsDetail(ds *state.Dashboard, width, height int) string
- func RenderDetailFrame(title string, crumb string, summary string, body string, version string, ...) string
- func RenderField(label, value string) string
- func RenderGitDetail(ds *state.Dashboard, width, height int) string
- func RenderHelp(bindings []KeyBinding) string
- func RenderLintDetail(ds *state.Dashboard, width, height int) string
- func RenderLogo() string
- func RenderPanel(title, body string, width int) string
- func RenderProfileDetail(ds *state.Dashboard, width, height int) string
- func RenderSection(title, body string, width int, height ...int) string
- func RenderStatusField(label, value string, style lipgloss.Style) string
- func RenderTableHeader(cols []TableColumn) string
- func RenderTableRow(values []string, cols []TableColumn, alt bool) string
- func RenderTestsDetail(ds *state.Dashboard, width, height int) string
- func StatChip(label, value string) string
- func StatusDot(label string, style lipgloss.Style) string
- type DetailContent
- func BuildBenchDetail(ds *state.Dashboard, width int) DetailContent
- func BuildDepsDetail(ds *state.Dashboard, width int) DetailContent
- func BuildGitDetail(ds *state.Dashboard, width int) DetailContent
- func BuildLintDetail(ds *state.Dashboard, width int) DetailContent
- func BuildProfileDetail(ds *state.Dashboard, width int) DetailContent
- func BuildTestsDetail(ds *state.Dashboard, width int) DetailContent
- type KeyBinding
- type TableColumn
Constants ¶
This section is empty.
Variables ¶
var ( // Core accent — K9s signature cyan/teal ColorAccent = lipgloss.Color("#00d7d7") ColorAccentDim = lipgloss.Color("#008b8b") // Logo gradient ColorLogo1 = lipgloss.Color("#5fafff") ColorLogo2 = lipgloss.Color("#00d7d7") // Semantic ColorSuccess = lipgloss.Color("#00d787") ColorWarning = lipgloss.Color("#d7af00") ColorDanger = lipgloss.Color("#ff5f5f") // Neutrals ColorWhite = lipgloss.Color("#e4e4e4") ColorFg = lipgloss.Color("#bcbcbc") ColorDim = lipgloss.Color("#6c6c6c") ColorSubtle = lipgloss.Color("#444444") ColorBorder = lipgloss.Color("#3a3a3a") ColorBg = lipgloss.Color("#1c1c1c") ColorHeaderBg = lipgloss.Color("#262626") ColorSelected = lipgloss.Color("#303030") ColorCrumbBg = lipgloss.Color("#303030") ColorStatusBar = lipgloss.Color("#1c1c1c") // Backward compat aliases ColorPrimary = ColorAccent ColorSecondary = ColorDim ColorMuted = ColorSubtle )
var CrumbSepStyle = lipgloss.NewStyle(). Foreground(ColorDim)
CrumbSepStyle for the separator between crumbs.
var CrumbStyle = lipgloss.NewStyle(). Background(ColorCrumbBg). Foreground(ColorAccent). Bold(true). Padding(0, 1)
CrumbStyle renders breadcrumb segments.
var HeaderBarStyle = lipgloss.NewStyle(). Background(ColorHeaderBg). Foreground(ColorFg). Padding(0, 1)
HeaderBarStyle is the full-width top bar background.
var HelpStyle = lipgloss.NewStyle(). Foreground(ColorDim)
HelpStyle for the command bar at the bottom.
var HotkeyBoxStyle = lipgloss.NewStyle(). Foreground(ColorBg). Background(ColorAccentDim). Bold(true). Padding(0, 1). MarginRight(1)
HotkeyBoxStyle wraps the shortcut key in a subtle box.
var HotkeyDescStyle = lipgloss.NewStyle(). Foreground(ColorFg)
HotkeyDescStyle styles the action description next to the hotkey box.
var InfoStyle = lipgloss.NewStyle(). Foreground(ColorDim)
InfoStyle for inline key:value stats on the header line.
var InfoValueStyle = lipgloss.NewStyle(). Foreground(ColorFg)
InfoValueStyle for stat values in the header.
var KeyStyle = lipgloss.NewStyle(). Foreground(ColorAccent). Bold(true)
KeyStyle for a keyboard shortcut key.
var LabelStyle = lipgloss.NewStyle(). Foreground(ColorDim). Bold(true)
LabelStyle for field labels inside panels.
var LogoStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorLogo2)
LogoStyle renders the "devdash" logo text.
var PanelBackground = lipgloss.NewStyle().Background(ColorBg)
PanelBackground sets the inner background color of the full-screen panels.
var PanelStyle = SectionBorder
PanelStyle = SectionBorder (alias for backward compat)
var SectionBorder = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1)
SectionBorder uses a rounded line box and a subtle background inner color.
var SectionTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorAccent)
SectionTitleStyle renders a panel header label.
var SepStyle = lipgloss.NewStyle(). Foreground(ColorBorder)
SepStyle for horizontal rule lines.
var StatusFail = lipgloss.NewStyle(). Foreground(ColorDanger). Bold(true)
StatusFail styles fail/error values.
var StatusIdle = lipgloss.NewStyle(). Foreground(ColorSubtle). Italic(true)
StatusIdle styles idle/placeholder values.
var StatusPass = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true)
StatusPass styles pass/ok values.
var StatusWarn = lipgloss.NewStyle(). Foreground(ColorWarning). Bold(true)
StatusWarn styles warning values.
var SubtitleStyle = lipgloss.NewStyle(). Foreground(ColorDim). MarginBottom(0)
SubtitleStyle for secondary information.
var TableHeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorAccentDim). BorderBottom(true). BorderStyle(lipgloss.NormalBorder()). BorderForeground(ColorBorder)
TableHeaderStyle for column headers inside panels.
var TableRowAltStyle = lipgloss.NewStyle(). Foreground(ColorFg). Background(ColorSelected)
TableRowAltStyle for alternating rows (subtle highlight).
var TableRowStyle = lipgloss.NewStyle(). Foreground(ColorFg)
TableRowStyle for regular data rows.
var TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorBg). Background(ColorAccent). Padding(0, 2)
TitleStyle (alias — used by detail_views)
var ValueStyle = lipgloss.NewStyle(). Foreground(ColorWhite)
ValueStyle for field values.
Functions ¶
func DetailBodySize ¶ added in v0.1.3
DetailBodySize returns viewport dimensions for detail content.
func RenderBenchDetail ¶
RenderBenchDetail renders a full-screen view of benchmark results.
func RenderCommandBar ¶
func RenderCommandBar(bindings []KeyBinding, width int) string
RenderCommandBar renders a full-width bottom bar with key hints.
func RenderCrumbs ¶
RenderCrumbs renders K9s-style breadcrumb navigation.
func RenderDashboard ¶
RenderDashboard composes the K9s-style terminal dashboard.
func RenderDepsDetail ¶
RenderDepsDetail renders a full-screen view of module dependencies.
func RenderDetailFrame ¶ added in v0.1.3
func RenderField ¶
RenderField formats a label: value line.
func RenderGitDetail ¶
RenderGitDetail renders a full-screen view of git status.
func RenderHelp ¶
func RenderHelp(bindings []KeyBinding) string
RenderHelp builds the K9s-style command bar.
func RenderLintDetail ¶
RenderLintDetail renders a full-screen view of lint results.
func RenderPanel ¶
RenderPanel is kept for backward compat. Delegates to RenderSection.
func RenderProfileDetail ¶ added in v0.1.4
RenderProfileDetail renders a full-screen inline flamegraph view.
func RenderSection ¶
RenderSection renders a K9s-style bordered section with a title label.
func RenderStatusField ¶
RenderStatusField renders a label with a colored status value.
func RenderTableHeader ¶
func RenderTableHeader(cols []TableColumn) string
RenderTableHeader renders column headers with a separator line below.
func RenderTableRow ¶
func RenderTableRow(values []string, cols []TableColumn, alt bool) string
RenderTableRow renders a single data row, optionally with alt-row bg.
func RenderTestsDetail ¶
RenderTestsDetail renders a full-screen view of test results.
Types ¶
type DetailContent ¶ added in v0.1.3
DetailContent represents the text payload for a detail screen.
func BuildBenchDetail ¶ added in v0.1.3
func BuildBenchDetail(ds *state.Dashboard, width int) DetailContent
BuildBenchDetail builds summary and body content for benchmark detail view.
func BuildDepsDetail ¶ added in v0.1.3
func BuildDepsDetail(ds *state.Dashboard, width int) DetailContent
BuildDepsDetail builds summary and body content for dependencies detail view.
func BuildGitDetail ¶ added in v0.1.3
func BuildGitDetail(ds *state.Dashboard, width int) DetailContent
BuildGitDetail builds summary and body content for git detail view.
func BuildLintDetail ¶ added in v0.1.3
func BuildLintDetail(ds *state.Dashboard, width int) DetailContent
BuildLintDetail builds summary and body content for lint detail view.
func BuildProfileDetail ¶ added in v0.1.4
func BuildProfileDetail(ds *state.Dashboard, width int) DetailContent
BuildProfileDetail builds summary and body content for profiling detail view.
func BuildTestsDetail ¶ added in v0.1.3
func BuildTestsDetail(ds *state.Dashboard, width int) DetailContent
BuildTestsDetail builds summary and body content for tests detail view.
type KeyBinding ¶
KeyBinding maps a key to its description.
type TableColumn ¶
TableColumn describes a column in a simple text table.