(title string)
| 170 | } |
| 171 | |
| 172 | func (m *appModel) handleSetSessionTitle(title string) (tea.Model, tea.Cmd) { |
| 173 | if err := m.application.UpdateSessionTitle(m.ctx(), title); err != nil { |
| 174 | if errors.Is(err, app.ErrTitleGenerating) { |
| 175 | return m, notification.WarningCmd("Title is being generated, please wait") |
| 176 | } |
| 177 | return m, notification.ErrorCmd(fmt.Sprintf("Failed to set session title: %v", err)) |
| 178 | } |
| 179 | return m, notification.SuccessCmd("Title set to: " + title) |
| 180 | } |
| 181 | |
| 182 | func (m *appModel) handleRegenerateTitle() (tea.Model, tea.Cmd) { |
| 183 | sess := m.application.Session() |
no test coverage detected