From 272d41e32dcca3dd90f4af279ab73a89cc843d77 Mon Sep 17 00:00:00 2001 From: donteatfriedrice Date: Thu, 27 Feb 2025 08:54:15 +0000 Subject: [PATCH] chore: remove unused component imports and styles from text-renderer (#10478) --- .../src/blocksuite/ai/components/text-renderer.ts | 12 ------------ tests/affine-cloud-copilot/e2e/copilot.spec.ts | 4 +++- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/frontend/core/src/blocksuite/ai/components/text-renderer.ts b/packages/frontend/core/src/blocksuite/ai/components/text-renderer.ts index 6fbc92611..7ea103dd9 100644 --- a/packages/frontend/core/src/blocksuite/ai/components/text-renderer.ts +++ b/packages/frontend/core/src/blocksuite/ai/components/text-renderer.ts @@ -6,16 +6,12 @@ import { ShadowlessElement, } from '@blocksuite/affine/block-std'; import { - CodeBlockComponent, codeBlockWrapMiddleware, defaultBlockMarkdownAdapterMatchers, defaultImageProxyMiddleware, - DividerBlockComponent, InlineDeltaToMarkdownAdapterExtensions, - ListBlockComponent, MarkdownInlineToDeltaAdapterExtensions, PageEditorBlockSpecs, - ParagraphBlockComponent, } from '@blocksuite/affine/blocks'; import { Container, type ServiceProvider } from '@blocksuite/affine/global/di'; import { WithDisposable } from '@blocksuite/affine/global/utils'; @@ -39,13 +35,6 @@ import type { AffineAIPanelWidgetConfig, } from '../widgets/ai-panel/type'; -const textBlockStyles = css` - ${ParagraphBlockComponent.styles} - ${ListBlockComponent.styles} - ${DividerBlockComponent.styles} - ${CodeBlockComponent.styles} -`; - const customHeadingStyles = css` .custom-heading { .h1 { @@ -178,7 +167,6 @@ export class TextRenderer extends WithDisposable(ShadowlessElement) { } } - ${textBlockStyles} ${customHeadingStyles} `; diff --git a/tests/affine-cloud-copilot/e2e/copilot.spec.ts b/tests/affine-cloud-copilot/e2e/copilot.spec.ts index acbc9e042..51cfffde9 100644 --- a/tests/affine-cloud-copilot/e2e/copilot.spec.ts +++ b/tests/affine-cloud-copilot/e2e/copilot.spec.ts @@ -110,7 +110,9 @@ const collectChat = async (page: Page) => { return []; } // wait ai response - await page.waitForSelector('.chat-panel-messages .message chat-copy-more'); + await page.waitForSelector('.chat-panel-messages .message chat-copy-more', { + timeout: ONE_MINUTE, + }); await page.waitForTimeout(200); const lastMessage = await chatPanel.$$('.message').then(m => m[m.length - 1]); await lastMessage.waitForSelector('chat-copy-more');