on main help sign in
handle clear session msg
ddbc3abKujtim Hoxha
internal/tui/components/chat/sidebar/sidebar.go+2
@@ -50,6 +50,8 @@ func (m *sidebarCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
50 if msg.ID != m.session.ID {
50 if msg.ID != m.session.ID {
51 m.session = msg
51 m.session = msg
52 }
52 }
53+ case chat.SessionClearedMsg:
54+ m.session = session.Session{}
53 case pubsub.Event[session.Session]:
55 case pubsub.Event[session.Session]:
54 if msg.Type == pubsub.UpdatedEvent {
56 if msg.Type == pubsub.UpdatedEvent {
55 if m.session.ID == msg.Payload.ID {
57 if m.session.ID == msg.Payload.ID {
internal/tui/tui.go+2
@@ -100,6 +100,8 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
100 // Session
100 // Session
101 case cmpChat.SessionSelectedMsg:
101 case cmpChat.SessionSelectedMsg:
102 a.selectedSessionID = msg.ID
102 a.selectedSessionID = msg.ID
103+ case cmpChat.SessionClearedMsg:
104+ a.selectedSessionID = ""
103 // Logs
105 // Logs
104 case pubsub.Event[logging.LogMessage]:
106 case pubsub.Event[logging.LogMessage]:
105 // Send to the status component
107 // Send to the status component