From c2f3018eb7601997278805bf9eeecc5d45b43bb9 Mon Sep 17 00:00:00 2001 From: Wu Yue Date: Wed, 13 Aug 2025 16:57:51 +0800 Subject: [PATCH] fix(core): missing lit component props (#13482) Close [AI-413](https://linear.app/affine-design/issue/AI-413) ## Summary by CodeRabbit * **Bug Fixes** * Chat messages now scroll vertically, preventing content from being cut off. * Chat actions are no longer displayed or fetched, reducing unnecessary loading. * Peek view chat composer behavior is aligned with the main chat, ensuring consistent feature availability across views. --- .../core/src/blocksuite/ai/components/playground/chat.ts | 9 +++++++-- .../src/blocksuite/ai/peek-view/chat-block-peek-view.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/frontend/core/src/blocksuite/ai/components/playground/chat.ts b/packages/frontend/core/src/blocksuite/ai/components/playground/chat.ts index a996ad031..b229cc957 100644 --- a/packages/frontend/core/src/blocksuite/ai/components/playground/chat.ts +++ b/packages/frontend/core/src/blocksuite/ai/components/playground/chat.ts @@ -90,7 +90,7 @@ export class PlaygroundChat extends SignalWatcher( ai-chat-messages { flex: 1; - overflow-y: hidden; + overflow-y: auto; } .chat-panel-hints { @@ -211,6 +211,10 @@ export class PlaygroundChat extends SignalWatcher( }); } + get showActions() { + return false; + } + private readonly _initPanel = async () => { const userId = (await AIProvider.userInfo)?.id; if (!userId) return; @@ -240,7 +244,7 @@ export class PlaygroundChat extends SignalWatcher( this.doc.id ) : Promise.resolve([]), - this.doc.id + this.doc.id && this.showActions ? AIProvider.histories.actions(this.doc.workspace.id, this.doc.id) : Promise.resolve([]), ]); @@ -369,6 +373,7 @@ export class PlaygroundChat extends SignalWatcher( .notificationService=${this.notificationService} .aiToolsConfigService=${this.aiToolsConfigService} .affineWorkspaceDialogService=${this.affineWorkspaceDialogService} + .affineFeatureFlagService=${this.affineFeatureFlagService} > `; } diff --git a/packages/frontend/core/src/blocksuite/ai/peek-view/chat-block-peek-view.ts b/packages/frontend/core/src/blocksuite/ai/peek-view/chat-block-peek-view.ts index 22acb30ae..a089fc467 100644 --- a/packages/frontend/core/src/blocksuite/ai/peek-view/chat-block-peek-view.ts +++ b/packages/frontend/core/src/blocksuite/ai/peek-view/chat-block-peek-view.ts @@ -614,6 +614,7 @@ export class AIChatBlockPeekView extends LitElement { .affineWorkspaceDialogService=${this.affineWorkspaceDialogService} .notificationService=${notificationService} .aiToolsConfigService=${this.aiToolsConfigService} + .affineFeatureFlagService=${this.affineFeatureFlagService} .onChatSuccess=${this._onChatSuccess} .trackOptions=${{ where: 'ai-chat-block',