@@ -162,7 +162,7 @@ func New(com *common.Common) *UI {
162162}
163163
164164// Init initializes the UI model.
165−func (m *UI) Init() tea.Cmd {
165+func (m UI) Init() tea.Cmd {
166166 if m.QueryVersion {
167167 return tea.RequestTerminalVersion
168168 }
@@ -170,7 +170,7 @@ func (m *UI) Init() tea.Cmd {
170170}
171171
172172// Update handles updates to the UI model.
173−func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
173+func (m UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
174174 var cmds []tea.Cmd
175175 switch msg := msg.(type) {
176176 case tea.EnvMsg:
@@ -297,73 +297,65 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) (cmds []tea.Cmd) {
297297
298298// Draw implements [tea.Layer] and draws the UI model.
299299func (m *UI) Draw(scr uv.Screen, area uv.Rectangle) {
300− layout := generateLayout(m, area.Dx(), area.Dy())
301−
302− // Update cached layout and component sizes if needed.
303− if m.layout != layout {
304− m.layout = layout
305− m.updateSize()
306− }
307−
308300 // Clear the screen first
309301 screen.Clear(scr)
310302
311303 switch m.state {
312304 case uiConfigure:
313305 header := uv.NewStyledString(m.header)
314− header.Draw(scr, layout.header)
306+ header.Draw(scr, m.layout.header)
315307
316− mainView := lipgloss.NewStyle().Width(layout.main.Dx()).
317− Height(layout.main.Dy()).
308+ mainView := lipgloss.NewStyle().Width(m.layout.main.Dx()).
309+ Height(m.layout.main.Dy()).
318310 Background(lipgloss.ANSIColor(rand.Intn(256))).
319311 Render(" Configure ")
320312 main := uv.NewStyledString(mainView)
321− main.Draw(scr, layout.main)
313+ main.Draw(scr, m.layout.main)
322314
323315 case uiInitialize:
324316 header := uv.NewStyledString(m.header)
325− header.Draw(scr, layout.header)
317+ header.Draw(scr, m.layout.header)
326318
327319 main := uv.NewStyledString(m.initializeView())
328− main.Draw(scr, layout.main)
320+ main.Draw(scr, m.layout.main)
329321
330322 case uiLanding:
331323 header := uv.NewStyledString(m.header)
332− header.Draw(scr, layout.header)
324+ header.Draw(scr, m.layout.header)
333325 main := uv.NewStyledString(m.landingView())
334− main.Draw(scr, layout.main)
326+ main.Draw(scr, m.layout.main)
335327
336328 editor := uv.NewStyledString(m.textarea.View())
337− editor.Draw(scr, layout.editor)
329+ editor.Draw(scr, m.layout.editor)
338330
339331 case uiChat:
340332 header := uv.NewStyledString(m.header)
341− header.Draw(scr, layout.header)
342− m.drawSidebar(scr, layout.sidebar)
333+ header.Draw(scr, m.layout.header)
334+ m.drawSidebar(scr, m.layout.sidebar)
343335
344− m.chat.Draw(scr, layout.main)
336+ m.chat.Draw(scr, m.layout.main)
345337
346338 editor := uv.NewStyledString(m.textarea.View())
347− editor.Draw(scr, layout.editor)
339+ editor.Draw(scr, m.layout.editor)
348340
349341 case uiChatCompact:
350342 header := uv.NewStyledString(m.header)
351− header.Draw(scr, layout.header)
343+ header.Draw(scr, m.layout.header)
352344
353− mainView := lipgloss.NewStyle().Width(layout.main.Dx()).
354− Height(layout.main.Dy()).
345+ mainView := lipgloss.NewStyle().Width(m.layout.main.Dx()).
346+ Height(m.layout.main.Dy()).
355347 Background(lipgloss.ANSIColor(rand.Intn(256))).
356348 Render(" Compact Chat Messages ")
357349 main := uv.NewStyledString(mainView)
358− main.Draw(scr, layout.main)
350+ main.Draw(scr, m.layout.main)
359351
360352 editor := uv.NewStyledString(m.textarea.View())
361− editor.Draw(scr, layout.editor)
353+ editor.Draw(scr, m.layout.editor)
362354 }
363355
364356 // Add help layer
365357 help := uv.NewStyledString(m.help.View(m))
366− help.Draw(scr, layout.help)
358+ help.Draw(scr, m.layout.help)
367359
368360 // Debugging rendering (visually see when the tui rerenders)
369361 if os.Getenv("CRUSH_UI_DEBUG") == "true" {
@@ -403,7 +395,7 @@ func (m *UI) Cursor() *tea.Cursor {
403395}
404396
405397// View renders the UI model's view.
406−func (m *UI) View() tea.View {
398+func (m UI) View() tea.View {
407399 var v tea.View
408400 v.AltScreen = true
409401 v.BackgroundColor = m.com.Styles.Background
@@ -434,7 +426,7 @@ func (m *UI) View() tea.View {
434426}
435427
436428// ShortHelp implements [help.KeyMap].
437−func (m *UI) ShortHelp() []key.Binding {
429+func (m UI) ShortHelp() []key.Binding {
438430 var binds []key.Binding
439431 k := &m.keyMap
440432
@@ -481,7 +473,7 @@ func (m *UI) ShortHelp() []key.Binding {
481473}
482474
483475// FullHelp implements [help.KeyMap].
484−func (m *UI) FullHelp() [][]key.Binding {
476+func (m UI) FullHelp() [][]key.Binding {
485477 var binds [][]key.Binding
486478 k := &m.keyMap
487479 help := k.Help