feat(core): open artifacts tools automatically (#13668)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Cats Juice
2025-09-30 09:40:59 +08:00
committed by GitHub
parent 2d1caff45c
commit 123d50a484

View File

@@ -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) {