@@ -14,13 +14,16 @@ import (
14 uv "github.com/charmbracelet/ultraviolet"
14 uv "github.com/charmbracelet/ultraviolet"
17+// uiState represents the current focus state of the UI.
17type uiState uint8
18type uiState uint8
20+// Possible uiState values.
20 uiChat uiState = iota
22 uiChat uiState = iota
26+// UI represents the main user interface model.
24type UI struct {
27type UI struct {
25 app *app.App
28 app *app.App
26 com *common.Common
29 com *common.Common
@@ -37,6 +40,7 @@ type UI struct {
37 layout layout
40 layout layout
43+// New creates a new instance of the [UI] model.
40func New(com *common.Common, app *app.App) *UI {
44func New(com *common.Common, app *app.App) *UI {
41 return &UI{
45 return &UI{
@@ -48,10 +52,12 @@ func New(com *common.Common, app *app.App) *UI {
55+// Init initializes the UI model.
51func (m *UI) Init() tea.Cmd {
56func (m *UI) Init() tea.Cmd {
52 return nil
57 return nil
60+// Update handles updates to the UI model.
55func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
61func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
56 var cmds []tea.Cmd
62 var cmds []tea.Cmd
57 switch msg := msg.(type) {
63 switch msg := msg.(type) {
@@ -89,6 +95,7 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
89 return m, tea.Batch(cmds...)
95 return m, tea.Batch(cmds...)
98+// View renders the UI model's view.
92func (m *UI) View() tea.View {
99func (m *UI) View() tea.View {
93 var v tea.View
100 var v tea.View
94 v.AltScreen = true
101 v.AltScreen = true