package tui import ( tea "github.com/charmbracelet/bubbletea" ) // Update handles all messages for the TUI. func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmd tea.Cmd switch msg := msg.(type) { case tea.KeyMsg: switch msg.String() { case "q", "ctrl+c": return m, tea.Quit } case tea.WindowSizeMsg: m.width = msg.Width m.height = msg.Height m.list.SetSize(msg.Width/2, msg.Height) } m.list, cmd = m.list.Update(msg) return m, cmd }