Documentation
¶
Overview ¶
Package tui implements the terminal user interface for grut using Bubble Tea v2, Lip Gloss v2, and Bubbles v2.
Index ¶
- type Model
- func (m Model) Init() tea.Cmd
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() tea.View
- func (m Model) WithChat(c *chat.Model) Model
- func (m Model) WithConfig(cfg *config.Config) Model
- func (m Model) WithGitClient(gc git.GitClient) Model
- func (m Model) WithSessionManager(mgr *session.Manager) Model
- func (m Model) WithUndoManager(um *git.UndoManager) Model
- type OverlayFactory
- func (f *OverlayFactory) NewBookmarkPanel() panels.Panel
- func (f *OverlayFactory) NewFuzzyFinder(mode string, bindings []keymap.Binding) panels.Panel
- func (f *OverlayFactory) NewHelpPanel() panels.Panel
- func (f *OverlayFactory) NewSettingsPanel(currentPos layout.PreviewPosition, currentTheme string, themeNames []string, ...) panels.Panel
- func (f *OverlayFactory) NewWelcomePanel() panels.Panel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the top-level TUI model for grut. It composes panels via the layout engine, routes keyboard events, and renders the final view.
func New ¶
New creates a new TUI model with the given panel manager, theme, keymap, and bookmark manager. The panel manager is typically a *layout.Engine but can be any implementation of layout.PanelManager.
func (Model) Init ¶
Init implements tea.Model. Initializes all panels and starts the auto-fetch timer if configured.
func (Model) Update ¶
Update implements tea.Model. Routes messages to the layout engine and handles global key bindings.
func (Model) View ¶
View implements tea.Model. Composes all panels and the status bar into the final view. F27: overlay notifications on top of the panel layout.
func (Model) WithChat ¶
WithChat returns a copy of the model with the given chat model attached as a footer. When non-nil, the chat footer is rendered below the panel area and can receive keyboard focus via ctrl+space.
func (Model) WithConfig ¶
WithConfig returns a copy of the model with the given configuration. Used for auto-fetch interval and sign-commits settings.
func (Model) WithGitClient ¶
WithGitClient returns a copy of the model with the given git client configured for app-level operations (commit, push, pull, fetch).
func (Model) WithSessionManager ¶
WithSessionManager returns a copy of the model with the given session manager configured. When set, the current session state is saved to disk on quit and restored on the next launch.
func (Model) WithUndoManager ¶
func (m Model) WithUndoManager(um *git.UndoManager) Model
WithUndoManager returns a copy of the model with the given UndoManager configured. When set, ctrl+z and ctrl+y trigger undo/redo operations.
type OverlayFactory ¶ added in v0.2.0
type OverlayFactory struct {
// contains filtered or unexported fields
}
OverlayFactory constructs overlay panels (bookmarks, fuzzy finder, help, settings, welcome) behind the panels.Panel interface. The root Model uses the factory instead of importing each panel package, reducing coupling.
func NewOverlayFactory ¶ added in v0.2.0
func NewOverlayFactory(th *theme.Theme, bmMgr *bm.Manager) *OverlayFactory
NewOverlayFactory creates a factory wired with the shared dependencies that overlay panels need.
func (*OverlayFactory) NewBookmarkPanel ¶ added in v0.2.0
func (f *OverlayFactory) NewBookmarkPanel() panels.Panel
NewBookmarkPanel creates the bookmarks overlay panel.
func (*OverlayFactory) NewFuzzyFinder ¶ added in v0.2.0
NewFuzzyFinder creates a fuzzy finder overlay for the given mode. Supported modes: "files", "commands", "directories". The bindings parameter is used for the "commands" mode source.
func (*OverlayFactory) NewHelpPanel ¶ added in v0.2.0
func (f *OverlayFactory) NewHelpPanel() panels.Panel
NewHelpPanel creates the help overlay panel.
func (*OverlayFactory) NewSettingsPanel ¶ added in v0.2.0
func (f *OverlayFactory) NewSettingsPanel( currentPos layout.PreviewPosition, currentTheme string, themeNames []string, actionsCfg config.ActionsConfig, ) panels.Panel
NewSettingsPanel creates the settings overlay panel with the given configuration state.
func (*OverlayFactory) NewWelcomePanel ¶ added in v0.2.0
func (f *OverlayFactory) NewWelcomePanel() panels.Panel
NewWelcomePanel creates the welcome overlay panel.