diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-12 14:49:01 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-21 13:38:42 +0200 |
| commit | 0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345 (patch) | |
| tree | 9b45cabbb2c8f0195d8428445db4d8a710db7951 /internal/tui/components/chat/sidebar.go | |
| parent | 8d874b839db169906e18e4277cd198504018e022 (diff) | |
| download | opencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.tar.gz opencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.zip | |
implement nested tool calls and initial setup for result metadata
Diffstat (limited to 'internal/tui/components/chat/sidebar.go')
| -rw-r--r-- | internal/tui/components/chat/sidebar.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/tui/components/chat/sidebar.go b/internal/tui/components/chat/sidebar.go index 65c06f4a1..51192cf9a 100644 --- a/internal/tui/components/chat/sidebar.go +++ b/internal/tui/components/chat/sidebar.go @@ -5,6 +5,7 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" + "github.com/kujtimiihoxha/termai/internal/pubsub" "github.com/kujtimiihoxha/termai/internal/session" "github.com/kujtimiihoxha/termai/internal/tui/styles" ) @@ -19,6 +20,14 @@ func (m *sidebarCmp) Init() tea.Cmd { } func (m *sidebarCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case pubsub.Event[session.Session]: + if msg.Type == pubsub.UpdatedEvent { + if m.session.ID == msg.Payload.ID { + m.session = msg.Payload + } + } + } return m, nil } @@ -45,7 +54,7 @@ func (m *sidebarCmp) sessionSection() string { sessionValue := styles.BaseStyle. Foreground(styles.Forground). Width(m.width - lipgloss.Width(sessionKey)). - Render(": New Session") + Render(fmt.Sprintf(": %s", m.session.Title)) return lipgloss.JoinHorizontal( lipgloss.Left, sessionKey, |
