| 889 | } |
| 890 | |
| 891 | QString ChatRootView::computeChatTitle() const |
| 892 | { |
| 893 | if (!m_chatModel) |
| 894 | return {}; |
| 895 | const auto history = m_chatModel->getChatHistory(); |
| 896 | for (const auto &msg : history) { |
| 897 | if (msg.role != ChatModel::User) |
| 898 | continue; |
| 899 | const QString content = msg.content.trimmed(); |
| 900 | if (content.isEmpty()) |
| 901 | continue; |
| 902 | const QString firstLine = content.section(QChar('\n'), 0, 0).trimmed(); |
| 903 | constexpr int maxLen = 60; |
| 904 | if (firstLine.length() > maxLen) |
| 905 | return firstLine.left(maxLen - 1) + QChar(0x2026); |
| 906 | return firstLine; |
| 907 | } |
| 908 | return {}; |
| 909 | } |
| 910 | |
| 911 | void ChatRootView::handOffSession() |
| 912 | { |
nothing calls this directly
no test coverage detected