Documentation
¶
Index ¶
- func GlobalHelpEntries() map[string][]HelpEntry
- func RenderHelp(styles ui.Styles, title string, sections map[string][]HelpEntry, ...) string
- func RenderScrollbar(styles ui.Styles, height, totalLines, visibleH int, scrollPct float64) string
- func RenderSideBySideDiff(styles ui.Styles, diff string, totalWidth int) string
- func RenderStatusBar(styles ui.Styles, data StatusBarData, width int) string
- func RenderTabs(styles ui.Styles, tabs []TabInfo, width int) string
- func TabBarRows(tabs []TabInfo, width int) int
- type Dialog
- type DialogKind
- type DialogResult
- type HelpEntry
- type StatusBarData
- type TabInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalHelpEntries ¶
GlobalHelpEntries returns the help entries for global keybindings.
func RenderHelp ¶
func RenderHelp(styles ui.Styles, title string, sections map[string][]HelpEntry, width, height int) string
RenderHelp renders a full-screen help overlay.
func RenderScrollbar ¶
RenderScrollbar returns a vertical scrollbar track of the given height. It shows a thumb (filled block) proportional to the visible portion, positioned according to the scroll percentage.
Returns an empty string if all content fits (no scrolling needed).
Parameters: styles – application styles (for theming) height – total height of the scrollbar track (rows) totalLines – total number of content lines visibleH – number of lines visible at once scrollPct – current scroll position as 0.0–1.0
func RenderSideBySideDiff ¶
RenderSideBySideDiff renders a unified diff in side-by-side format with line numbers, gutter indicators, and clean styling.
func RenderStatusBar ¶
func RenderStatusBar(styles ui.Styles, data StatusBarData, width int) string
RenderStatusBar renders the bottom status bar with clear visual sections separated by dim vertical bars.
Wide (>= 60): main │ ↑2 ↓1 │ ● modified zed-git-view Medium (40-59): main │ ↑2 ↓1 │ ● modified Narrow (< 40): main │ ● modified
func RenderTabs ¶
RenderTabs renders a responsive tab bar that adapts to any width:
- Wide: icon + full name, single row
- Medium: icon + full name, wrapped to 2-3 rows
- Narrow: icon + abbreviated name (3 chars)
- Very narrow: icon only
Active tab has a bold accent underline beneath its row.
func TabBarRows ¶
TabBarRows returns the number of screen rows the tab bar will occupy (tab rows + 1 underline row).
Types ¶
type Dialog ¶
type Dialog struct {
Kind DialogKind
Title string
Message string
Tag string
// contains filtered or unexported fields
}
Dialog is a modal confirmation or input dialog.
func NewConfirmDialog ¶
NewConfirmDialog creates a Yes/No confirmation dialog.
func NewInputDialog ¶
NewInputDialog creates a text input dialog.
type DialogKind ¶
type DialogKind int
DialogKind specifies the type of dialog.
const ( DialogConfirm DialogKind = iota DialogInput )
type DialogResult ¶
type DialogResult struct {
Confirmed bool
Value string
Tag string // arbitrary tag to identify which dialog this was
}
DialogResult is sent when the dialog is dismissed.