Documentation
¶
Index ¶
- Constants
- type LayoutConfig
- type LayoutManager
- func (lm *LayoutManager) AddSubPanel(parentPanelName, subPanelName string, component types.Component)
- func (lm *LayoutManager) DisableAllKeybindings()
- func (lm *LayoutManager) EnableAllKeybindings() error
- func (lm *LayoutManager) FocusNextPanel() string
- func (lm *LayoutManager) FocusPanel(panelName string) error
- func (lm *LayoutManager) GetAvailablePanels() []string
- func (lm *LayoutManager) GetComponent(panelName string) types.Component
- func (lm *LayoutManager) GetConfig() *LayoutConfig
- func (lm *LayoutManager) GetLastSize() (int, int)
- func (lm *LayoutManager) GetPanel(panelName string) *Panel
- func (lm *LayoutManager) GetRightPanelMode() string
- func (lm *LayoutManager) HideRightPanel()
- func (lm *LayoutManager) IsRightPanelVisible() bool
- func (lm *LayoutManager) IsRightPanelZoomed() bool
- func (lm *LayoutManager) Layout(g *gocui.Gui) error
- func (lm *LayoutManager) ResetKeybindings() error
- func (lm *LayoutManager) SetComponent(panelName string, component types.Component)
- func (lm *LayoutManager) SetConfig(config *LayoutConfig)
- func (lm *LayoutManager) SetFocus(panelName string)
- func (lm *LayoutManager) ShowRightPanel(mode string)
- func (lm *LayoutManager) SwapComponent(panelName string, newComponent types.Component) error
- func (lm *LayoutManager) SwitchRightPanelMode(mode string)
- func (lm *LayoutManager) ToggleRightPanel()
- func (lm *LayoutManager) ToggleRightPanelZoom()
- func (lm *LayoutManager) UnzoomRightPanel()
- func (lm *LayoutManager) ZoomRightPanel()
- type Panel
- func (p *Panel) AddSubPanel(name string, component types.Component)
- func (p *Panel) CreateOrUpdateView() error
- func (p *Panel) GetSubPanel(name string) *Panel
- func (p *Panel) IsVisible() bool
- func (p *Panel) Render() error
- func (p *Panel) SetVisible(visible bool)
- func (p *Panel) SwapComponent(newComponent types.Component) error
- func (p *Panel) UpdateDimensions(dims boxlayout.Dimensions) error
Constants ¶
const ( PanelStatus = "status" // top panel PanelLeft = "left" // left panel (unused currently) PanelMessages = "messages" // center panel PanelDebug = "debug" // right panel (debug component) PanelTextViewer = "text-viewer" // right panel (text viewer component) PanelDiffViewer = "diff-viewer" // right panel (diff viewer component) PanelInput = "input" // bottom panel )
Panel name constants - using semantic names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LayoutConfig ¶
type LayoutConfig struct {
MessagesWeight int // Weight for messages panel
InputHeight int // Fixed height for input panel
DebugWeight int // Weight for debug panel when visible
StatusHeight int // Fixed height for status panel
ShowSidebar bool // Legacy field - kept for compatibility
CompactMode bool // Compact mode toggle
MinPanelWidth int // Minimum panel width
MinPanelHeight int // Minimum panel height
}
func NewDefaultLayoutConfig ¶
func NewDefaultLayoutConfig(config *types.Config) *LayoutConfig
type LayoutManager ¶
type LayoutManager struct {
// contains filtered or unexported fields
}
func NewLayoutManager ¶
func NewLayoutManager(gui *gocui.Gui, config *LayoutConfig) *LayoutManager
func (*LayoutManager) AddSubPanel ¶
func (lm *LayoutManager) AddSubPanel(parentPanelName, subPanelName string, component types.Component)
AddSubPanel adds a sub-panel to a composite component (like status bar)
func (*LayoutManager) DisableAllKeybindings ¶
func (lm *LayoutManager) DisableAllKeybindings()
DisableAllKeybindings removes all keybindings from all panels
func (*LayoutManager) EnableAllKeybindings ¶
func (lm *LayoutManager) EnableAllKeybindings() error
EnableAllKeybindings restores keybindings for all panels
func (*LayoutManager) FocusNextPanel ¶
func (lm *LayoutManager) FocusNextPanel() string
FocusNextPanel focuses the next panel in navigation order and returns the focused panel name
func (*LayoutManager) FocusPanel ¶
func (lm *LayoutManager) FocusPanel(panelName string) error
FocusPanel focuses the specified panel by name, handling focus transitions
func (*LayoutManager) GetAvailablePanels ¶
func (lm *LayoutManager) GetAvailablePanels() []string
GetAvailablePanels returns panel names that have components assigned
func (*LayoutManager) GetComponent ¶
func (lm *LayoutManager) GetComponent(panelName string) types.Component
func (*LayoutManager) GetConfig ¶
func (lm *LayoutManager) GetConfig() *LayoutConfig
func (*LayoutManager) GetLastSize ¶
func (lm *LayoutManager) GetLastSize() (int, int)
GetLastSize returns the last known terminal size
func (*LayoutManager) GetPanel ¶
func (lm *LayoutManager) GetPanel(panelName string) *Panel
func (*LayoutManager) GetRightPanelMode ¶
func (lm *LayoutManager) GetRightPanelMode() string
GetRightPanelMode returns the current right panel mode
func (*LayoutManager) HideRightPanel ¶
func (lm *LayoutManager) HideRightPanel()
HideRightPanel hides all right panel components
func (*LayoutManager) IsRightPanelVisible ¶
func (lm *LayoutManager) IsRightPanelVisible() bool
IsRightPanelVisible returns whether the right panel is visible
func (*LayoutManager) IsRightPanelZoomed ¶ added in v0.1.4
func (lm *LayoutManager) IsRightPanelZoomed() bool
IsRightPanelZoomed returns whether the right panel is currently zoomed
func (*LayoutManager) ResetKeybindings ¶
func (lm *LayoutManager) ResetKeybindings() error
ResetKeybindings resets keybindings for all panels This ensures that component keybindings are properly registered after swaps
func (*LayoutManager) SetComponent ¶
func (lm *LayoutManager) SetComponent(panelName string, component types.Component)
func (*LayoutManager) SetConfig ¶
func (lm *LayoutManager) SetConfig(config *LayoutConfig)
func (*LayoutManager) SetFocus ¶
func (lm *LayoutManager) SetFocus(panelName string)
func (*LayoutManager) ShowRightPanel ¶
func (lm *LayoutManager) ShowRightPanel(mode string)
ShowRightPanel shows the specified right panel mode
func (*LayoutManager) SwapComponent ¶
func (lm *LayoutManager) SwapComponent(panelName string, newComponent types.Component) error
SwapComponent replaces a panel's component with a new one (for confirmations)
func (*LayoutManager) SwitchRightPanelMode ¶
func (lm *LayoutManager) SwitchRightPanelMode(mode string)
SwitchRightPanelMode switches the right panel mode
func (*LayoutManager) ToggleRightPanel ¶
func (lm *LayoutManager) ToggleRightPanel()
ToggleRightPanel toggles the right panel visibility
func (*LayoutManager) ToggleRightPanelZoom ¶ added in v0.1.4
func (lm *LayoutManager) ToggleRightPanelZoom()
ToggleRightPanelZoom toggles the right panel zoom state
func (*LayoutManager) UnzoomRightPanel ¶ added in v0.1.4
func (lm *LayoutManager) UnzoomRightPanel()
UnzoomRightPanel returns the right panel to normal size
func (*LayoutManager) ZoomRightPanel ¶ added in v0.1.4
func (lm *LayoutManager) ZoomRightPanel()
ZoomRightPanel zooms the right panel to take most of the layout space
type Panel ¶
type Panel struct {
Name string
Component types.Component
Dimensions boxlayout.Dimensions
View *gocui.View
Visible bool
// For composite components like status bar
SubPanels map[string]*Panel
// contains filtered or unexported fields
}
Panel represents a single layout area that contains a component and its view
func (*Panel) AddSubPanel ¶
AddSubPanel adds a sub-panel for composite components
func (*Panel) CreateOrUpdateView ¶
CreateOrUpdateView creates or updates the gocui view for this panel
func (*Panel) GetSubPanel ¶
GetSubPanel returns a sub-panel by name
func (*Panel) SetVisible ¶
SetVisible sets the panel's visibility
func (*Panel) SwapComponent ¶
SwapComponent replaces the panel's component with a new one
func (*Panel) UpdateDimensions ¶
func (p *Panel) UpdateDimensions(dims boxlayout.Dimensions) error
UpdateDimensions updates the panel's dimensions and propagates to the view