feat: session specific logs

This commit is contained in:
adamdottv
2025-05-14 13:06:09 -05:00
parent 4c998d4f4f
commit 3982be4310
15 changed files with 178 additions and 195 deletions

View File

@@ -11,13 +11,10 @@ import (
"github.com/sst/opencode/internal/tui/util"
)
// SessionSelectedMsg is sent when a session is selected
type SessionSelectedMsg struct {
Session session.Session
}
// CloseSessionDialogMsg is sent when the session dialog is closed
type CloseSessionDialogMsg struct{}
type CloseSessionDialogMsg struct {
Session *session.Session
}
// SessionDialog interface for the session switching dialog
type SessionDialog interface {
@@ -92,10 +89,10 @@ func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case key.Matches(msg, sessionKeys.Enter):
if len(s.sessions) > 0 {
selectedSession := s.sessions[s.selectedIdx]
// Update the session manager with the selected session
// session.SetCurrentSession(selectedSession.ID)
return s, util.CmdHandler(SessionSelectedMsg{
Session: selectedSession,
s.selectedSessionID = selectedSession.ID
return s, util.CmdHandler(CloseSessionDialogMsg{
Session: &selectedSession,
})
}
case key.Matches(msg, sessionKeys.Escape):