feat(design): integrate agent activity timeline
This commit is contained in:
1 parent
81b524a02c
commit
7bdb42f26c
12 files changed
+243
-133
No files matched your search
@@ -198,6 +198,63 @@ describe('youth AI Design Canvas page', () => {
|
||||
.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('keeps each pending reply beside the user message that started it', () => {
|
||||
prepareWorkspace({ turns: [] });
|
||||
useImageWorkspaceStore.setState({
|
||||
pendingOperations: {
|
||||
'operation-chat-1': {
|
||||
id: 'operation-chat-1',
|
||||
label: '发送创作想法',
|
||||
command: {
|
||||
kind: 'apply_input',
|
||||
workspaceId: 'workspace-1',
|
||||
sessionId: 'session-1',
|
||||
expectedDirectionRevision: 4,
|
||||
clientOperationId: 'operation-chat-1',
|
||||
input: { kind: 'chat', message: '先画一只小熊' },
|
||||
},
|
||||
status: 'unknown',
|
||||
error: '结果尚未确认',
|
||||
clearDraftPaths: [],
|
||||
clearChatDraft: true,
|
||||
baseRawTurnSequence: 1,
|
||||
},
|
||||
'operation-chat-2': {
|
||||
id: 'operation-chat-2',
|
||||
label: '发送创作想法',
|
||||
command: {
|
||||
kind: 'apply_input',
|
||||
workspaceId: 'workspace-1',
|
||||
sessionId: 'session-1',
|
||||
expectedDirectionRevision: 4,
|
||||
clientOperationId: 'operation-chat-2',
|
||||
input: { kind: 'chat', message: '再补充一只小兔子' },
|
||||
},
|
||||
status: 'submitting',
|
||||
error: null,
|
||||
clearDraftPaths: [],
|
||||
clearChatDraft: true,
|
||||
baseRawTurnSequence: 1,
|
||||
},
|
||||
},
|
||||
assistantStreams: {
|
||||
'operation-chat-1': '小熊会站在月亮旁边。',
|
||||
},
|
||||
});
|
||||
|
||||
render(<ImageCanvas />);
|
||||
|
||||
const conversation = screen.getByTestId('image-workspace-conversation');
|
||||
const firstMessage = within(conversation).getByTestId('pending-design-chat-operation-chat-1');
|
||||
const firstReply = within(conversation)
|
||||
.getByTestId('streaming-design-assistant-operation-chat-1');
|
||||
const secondMessage = within(conversation).getByTestId('pending-design-chat-operation-chat-2');
|
||||
expect(firstMessage.compareDocumentPosition(firstReply) & Node.DOCUMENT_POSITION_FOLLOWING)
|
||||
.toBeTruthy();
|
||||
expect(firstReply.compareDocumentPosition(secondMessage) & Node.DOCUMENT_POSITION_FOLLOWING)
|
||||
.toBeTruthy();
|
||||
});
|
||||
|
||||
it('shows public AI activity under the submitted message and collapses it beside the final turn', async () => {
|
||||
const message = '画一只在月球踢球的熊猫';
|
||||
const { workspace } = prepareWorkspace({ turns: [] });
|
||||
|
||||
Reference in new issue
Block a user