fix: chat session auto-title + delete + remove double drag indicator
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
- 首条用户消息自动设为会话标题(仅当 title 为空或为新对话时) - 对话列表新增左滑删除 - 移除 duplicate drag indicator Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
35f2cd6e59
commit
dc5948a2cd
@ -130,6 +130,16 @@ export class RagChatService {
|
|||||||
// Save user message
|
// Save user message
|
||||||
await this.prisma.chatMessage.create({ data: { sessionId, role: 'user', content } });
|
await this.prisma.chatMessage.create({ data: { sessionId, role: 'user', content } });
|
||||||
|
|
||||||
|
// Auto-title: use first user message if title is still default
|
||||||
|
if (!session.title || session.title === '新对话') {
|
||||||
|
await this.prisma.chatSession.update({
|
||||||
|
where: { id: sessionId },
|
||||||
|
data: { title: content.slice(0, 50) },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Also auto-title in sendMessage (this is the sync method)
|
||||||
|
|
||||||
// Load context
|
// Load context
|
||||||
const context = await this.loadContext(session.knowledgeBaseId);
|
const context = await this.loadContext(session.knowledgeBaseId);
|
||||||
if (!context.text) {
|
if (!context.text) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user