feat: session manager

This commit is contained in:
adamdottv 2025-05-08 07:43:31 -05:00
commit bab17d7520
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
4 changed files with 101 additions and 4 deletions

View file

@ -91,8 +91,11 @@ func (s *sessionDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return s, nil
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: s.sessions[s.selectedIdx],
Session: selectedSession,
})
}
case key.Matches(msg, sessionKeys.Escape):