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:
Yiling-J
2026-08-31 20:11:27 +08:00
committed by GitHub
parent 6e9cf8dfb6
commit e06478df88
36 changed files with 1908 additions and 353 deletions
+24
View File
@@ -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 },
])
})
})
})
+4
View File
@@ -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,
},
},
},