* @brief Persists the current chat and loads another saved chat into the conversation. */
| 549 | * @brief Persists the current chat and loads another saved chat into the conversation. |
| 550 | */ |
| 551 | void AI::Assistant::switchChat(const QString& id) |
| 552 | { |
| 553 | if (id == m_activeChatId || !m_chats.contains(id)) |
| 554 | return; |
| 555 | |
| 556 | if (m_conversation && m_conversation->busy()) |
| 557 | m_conversation->cancel(); |
| 558 | |
| 559 | persistActiveChat(); |
| 560 | |
| 561 | m_activeChatId = id; |
| 562 | m_chats.setLastActiveId(id); |
| 563 | loadActiveSnapshot(); |
| 564 | |
| 565 | AI::FileSandbox::instance().clearDroppedPaths(); |
| 566 | Q_EMIT activeChatChanged(); |
| 567 | } |
| 568 | |
| 569 | /** |
| 570 | * @brief Deletes a chat; if it was active, falls back to the newest remaining (or a new) chat. |
nothing calls this directly
no test coverage detected