From 123d50a48427ab05155c71dcfd5ae9cfc3567856 Mon Sep 17 00:00:00 2001 From: Cats Juice Date: Tue, 30 Sep 2025 09:40:59 +0800 Subject: [PATCH] feat(core): open artifacts tools automatically (#13668) ## Summary by CodeRabbit * **New Features** * The AI Artifact Tool now auto-opens its preview panel as soon as it loads, giving immediate visibility without extra clicks. * The preview initializes proactively and remains in sync as data updates, streamlining the workflow and reducing setup friction. * Improves first-use experience by ensuring the preview is ready and visible on connection, enhancing responsiveness and clarity. --- .../src/blocksuite/ai/components/ai-tools/artifact-tool.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/frontend/core/src/blocksuite/ai/components/ai-tools/artifact-tool.ts b/packages/frontend/core/src/blocksuite/ai/components/ai-tools/artifact-tool.ts index d9f13afed..cc4527ae5 100644 --- a/packages/frontend/core/src/blocksuite/ai/components/ai-tools/artifact-tool.ts +++ b/packages/frontend/core/src/blocksuite/ai/components/ai-tools/artifact-tool.ts @@ -160,6 +160,12 @@ export abstract class ArtifactTool< `; } + override connectedCallback() { + super.connectedCallback(); + // open the preview panel immediately + this.openOrUpdatePreviewPanel(); + } + override render() { const err = this.getErrorTemplate(); if (err) {