mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(chat): support markups, attachments, and timestamps in agent 1-to-1 chat (#368)
* feat(chat): support markups, attachments, and timestamps in agent 1-to-1 chat * feat(chat): improve message card layout with inline badges and integrated assets * fix(chat): enable image attachment thumbnails in 1-to-1 chat cards * fix(chat): address code review feedback on input state, mentions, i18n, and session deletion * fix(chat): replace ring with border color on selected message card
This commit is contained in:
@@ -988,5 +988,29 @@ describe('ChatService', () => {
|
||||
const msg2 = mapEntryToMessage(emptyEntry)
|
||||
expect(msg2).toBeNull()
|
||||
})
|
||||
|
||||
it('should forward annotations and second to workflow task payload', async () => {
|
||||
const { user, team, project } = await setupBasicData()
|
||||
|
||||
const { sessionId, taskId } = await chatService.startOrContinueChat(user, team.id, {
|
||||
agentId: 'test-agent-id',
|
||||
textPrompt: 'Check out this area',
|
||||
projectId: project.id,
|
||||
annotations: [{ type: 'rectangle', x: 10, y: 20, width: 30, height: 40 }],
|
||||
second: 8.5,
|
||||
})
|
||||
|
||||
expect(sessionId).toBeDefined()
|
||||
expect(taskId).toBeDefined()
|
||||
|
||||
const task = await prisma.workflowTask.findUnique({
|
||||
where: { id: taskId },
|
||||
})
|
||||
expect(task).toBeDefined()
|
||||
expect(task?.payload?.agent?.second).toBe(8.5)
|
||||
expect(task?.payload?.agent?.annotations).toEqual([
|
||||
{ type: 'rectangle', x: 10, y: 20, width: 30, height: 40 },
|
||||
])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -199,6 +199,8 @@ export class ChatService {
|
||||
sessionId: passedSessionId,
|
||||
contextAssetId,
|
||||
projectId: passedProjectId,
|
||||
second,
|
||||
annotations,
|
||||
} = req
|
||||
|
||||
// 1. Permissions verification
|
||||
@@ -401,6 +403,8 @@ export class ChatService {
|
||||
userId: user.id,
|
||||
isNewChat: !passedSessionId,
|
||||
hasAssetChanged,
|
||||
second: second ?? undefined,
|
||||
annotations: annotations ?? undefined,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user