The open source coding agent.
TypeScript
fix(tui): async load messages on theme/session switch
adamdottv9ea0d71e8df9
diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.goindex 6130ce0909b..3c5e88c2085 100644--- a/packages/tui/internal/components/chat/messages.go+++ b/packages/tui/internal/components/chat/messages.go@@ -60,17 +60,14 @@ func (m *messagesComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) {return m, nilcase dialog.ThemeSelectedMsg:m.cache.Clear()- m.renderView()- return m, nil+ return m, m.Reload()case ToggleToolDetailsMsg:m.showToolDetails = !m.showToolDetails- m.renderView()- return m, nil+ return m, m.Reload()case app.SessionSelectedMsg:m.cache.Clear()- cmd := m.Reload()- m.viewport.GotoBottom()- return m, cmd+ m.tail = true+ return m, m.Reload()case app.SessionClearedMsg:m.cache.Clear()cmd := m.Reload()@@ -346,6 +343,7 @@ func (m *messagesComponent) home() string {logoAndVersion,lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())),)+ m.commands.SetBackgroundColor(t.Background())commands := lipgloss.PlaceHorizontal(m.width,lipgloss.Center,diff --git a/packages/tui/internal/components/commands/commands.go b/packages/tui/internal/components/commands/commands.goindex 75b27779b16..e7b1771f830 100644--- a/packages/tui/internal/components/commands/commands.go+++ b/packages/tui/internal/components/commands/commands.go@@ -18,6 +18,7 @@ type CommandsComponent interface {tea.Modeltea.ViewModellayout.Sizeable+ SetBackgroundColor(color compat.AdaptiveColor)}type commandsComponent struct {@@ -38,6 +39,10 @@ func (c *commandsComponent) GetSize() (int, int) {return c.width, c.height}+func (c *commandsComponent) SetBackgroundColor(color compat.AdaptiveColor) {+ c.background = &color+}+func (c *commandsComponent) Init() tea.Cmd {return nil}