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
+42
View File
@@ -148,6 +148,48 @@ describe('Chat API', () => {
)
})
it('accepts chat request with annotations, second, and attachmentIds', async () => {
vi.mocked(chatService.startOrContinueChat).mockResolvedValue({
sessionId: 'session1',
taskId: 'task1',
})
vi.mocked(chatService.getNewSessionMessages).mockResolvedValue({
messages: [],
lastEntryId: null,
})
vi.mocked(chatService.getChatWorkflowStatus).mockResolvedValue({
status: 'completed',
output: {},
})
const res = await app.request('/teams/team1/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
agentId: 'agent1',
textPrompt: 'Review annotation',
attachedFiles: ['att1'],
annotations: [{ type: 'rectangle', x: 10, y: 20 }],
second: 5.5,
}),
})
expect(res.status).toBe(200)
expect(chatService.startOrContinueChat).toHaveBeenCalledWith(
expect.objectContaining({ id: 'user1' }),
'team1',
expect.objectContaining({
agentId: 'agent1',
textPrompt: 'Review annotation',
attachedFiles: ['att1'],
annotations: [{ type: 'rectangle', x: 10, y: 20 }],
second: 5.5,
}),
)
})
it('sends ping keep-alive SSE events when there are no new messages', async () => {
vi.mocked(chatService.startOrContinueChat).mockResolvedValue({
sessionId: 'session1',