MCPcopy
hub / github.com/docker/docker-agent / handleOpenSessionBrowser

Method handleOpenSessionBrowser

pkg/tui/tui.go:1280–1296  ·  view source on GitHub ↗

handleOpenSessionBrowser opens the session browser dialog.

()

Source from the content-addressed store, hash-verified

1278
1279// handleOpenSessionBrowser opens the session browser dialog.
1280func (m *appModel) handleOpenSessionBrowser() (tea.Model, tea.Cmd) {
1281 store := m.application.SessionStore()
1282 if store == nil {
1283 return m, notification.InfoCmd("No session store configured")
1284 }
1285 sessions, err := store.GetSessionSummaries(m.ctx())
1286 if err != nil {
1287 return m, notification.ErrorCmd(fmt.Sprintf("Failed to load sessions: %v", err))
1288 }
1289 if len(sessions) == 0 {
1290 return m, notification.InfoCmd("No previous sessions found")
1291 }
1292
1293 return m, core.CmdHandler(dialog.OpenDialogMsg{
1294 Model: dialog.NewSessionBrowserDialog(sessions),
1295 })
1296}
1297
1298// handleLoadSession loads a saved session into the current tab (if empty) or a new tab.
1299func (m *appModel) handleLoadSession(sessionID string) (tea.Model, tea.Cmd) {

Callers 1

updateMethod · 0.95

Calls 6

InfoCmdFunction · 0.92
ErrorCmdFunction · 0.92
CmdHandlerFunction · 0.92
NewSessionBrowserDialogFunction · 0.92
SessionStoreMethod · 0.65
GetSessionSummariesMethod · 0.65

Tested by

no test coverage detected