mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(core): remove chat-panel component's dependency on doc (#12975)
Close [AI-259](https://linear.app/affine-design/issue/AI-259) Close [AI-243](https://linear.app/affine-design/issue/AI-243) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a unified AI chat content component to manage and display chat interactions. * Added new chat block message components for improved chat message rendering. * **Refactor** * Simplified and unified session management across all AI chat components, now passing full session objects instead of session IDs. * Updated component and property names for clarity and consistency (e.g., chat message and block message components). * Consolidated chat history and actions retrieval for a more streamlined chat experience. * Removed redundant session ID getters and replaced them with direct session object usage. * Streamlined chat panel and composer components by removing internal message and context state management. * **Bug Fixes** * Improved handling of chat session state and loading, reducing redundant state properties. * Enhanced event handling to prevent errors when chat parameters are missing. * **Tests** * Removed outdated chat clearing test cases to align with new chat state management. * **Chores** * Updated import paths and reorganized module exports for better maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -343,25 +343,6 @@ test.describe('AIBasic/Chat', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test('should support clearing chat', async ({
|
||||
loggedInPage: page,
|
||||
utils,
|
||||
}) => {
|
||||
await utils.chatPanel.openChatPanel(page);
|
||||
await utils.chatPanel.makeChat(page, 'Hello. Answer in 50 words.');
|
||||
await utils.chatPanel.waitForHistory(page, [
|
||||
{
|
||||
role: 'user',
|
||||
content: 'Hello. Answer in 50 words.',
|
||||
},
|
||||
{
|
||||
role: 'assistant',
|
||||
status: 'success',
|
||||
},
|
||||
]);
|
||||
await utils.chatPanel.clearChat(page);
|
||||
await utils.chatPanel.waitForHistory(page, []);
|
||||
});
|
||||
test('should support copying answer', async ({
|
||||
loggedInPage: page,
|
||||
utils,
|
||||
|
||||
Reference in New Issue
Block a user