Documentation
¶
Overview ¶
Package components provides UI components for the profiler example.
Index ¶
- func CreateControlsPanel(props ControlsPanelProps) (bubbly.Component, error)
- func CreateMetricsPanel(props MetricsPanelProps) (bubbly.Component, error)
- func CreateStatusBar(props StatusBarProps) (bubbly.Component, error)
- func FormatDuration(d time.Duration) string
- type ControlsPanelProps
- type FocusPane
- type MetricsPanelProps
- type StatusBarProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateControlsPanel ¶
func CreateControlsPanel(props ControlsPanelProps) (bubbly.Component, error)
CreateControlsPanel creates a component with profiler controls. This demonstrates: - Callback props for parent communication - Using BubblyUI Text components - Dynamic styling based on focus and state
func CreateMetricsPanel ¶
func CreateMetricsPanel(props MetricsPanelProps) (bubbly.Component, error)
CreateMetricsPanel creates a component that displays profiler metrics. This demonstrates: - Component factory pattern - Props-based composition - Using BubblyUI Card and Text components - Dynamic styling based on focus state
func CreateStatusBar ¶
func CreateStatusBar(props StatusBarProps) (bubbly.Component, error)
CreateStatusBar creates a status bar component. This demonstrates: - Using HStack for horizontal layout - Badge component for status indicators - Computed values for derived state
func FormatDuration ¶
FormatDuration formats a duration for display.
Types ¶
type ControlsPanelProps ¶
type ControlsPanelProps struct {
// IsRunning indicates if the profiler is running
IsRunning *bubbly.Ref[bool]
// Focused indicates if this panel has focus
Focused *bubbly.Ref[bool]
// OnToggle is called when the profiler should be toggled
OnToggle func()
// OnReset is called when metrics should be reset
OnReset func()
// OnExport is called when report should be exported
OnExport func()
}
ControlsPanelProps defines the props for the ControlsPanel component.
type MetricsPanelProps ¶
type MetricsPanelProps struct {
// Metrics holds the current profiler metrics
Metrics *bubbly.Ref[*composables.ProfilerMetrics]
// Focused indicates if this panel has focus
Focused *bubbly.Ref[bool]
// IsRunning indicates if the profiler is running
IsRunning *bubbly.Ref[bool]
}
MetricsPanelProps defines the props for the MetricsPanel component.
type StatusBarProps ¶
type StatusBarProps struct {
// IsRunning indicates if the profiler is running
IsRunning *bubbly.Ref[bool]
// StartTime is when profiling started (used to calculate duration)
StartTime *bubbly.Ref[time.Time]
// FocusedPane indicates which panel is focused
FocusedPane *bubbly.Ref[FocusPane]
// LastExport holds the last export filename
LastExport *bubbly.Ref[string]
}
StatusBarProps defines the props for the StatusBar component.