fix(core): some artifact styles (#13020)

fix AI-299, AI-296

#### PR Dependency Tree


* **PR #13020** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

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

## Summary by CodeRabbit

* **Style**
* Improved layout alignment in the artifact preview panel for better
visual consistency.
* Enforced a minimum width for linked document banners to ensure
consistent appearance.

* **Bug Fixes**
* Updated artifact and document compose tools so that clicking an
artifact result always opens the preview panel, instead of toggling or
closing it unexpectedly.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Peng Xiao
2025-07-04 12:15:50 +08:00
committed by GitHub
parent d0d94066f7
commit fe8cb6bb44
4 changed files with 4 additions and 20 deletions

View File

@@ -86,6 +86,7 @@ export class ArtifactPreviewPanel extends WithDisposable(ShadowlessElement) {
.artifact-panel-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
flex: 1;
}

View File

@@ -12,11 +12,7 @@ import { property, state } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { bundledLanguagesInfo, type ThemedToken } from 'shiki';
import {
closePreviewPanel,
isPreviewPanelOpen,
renderPreviewPanel,
} from './artifacts-preview-panel';
import { renderPreviewPanel } from './artifacts-preview-panel';
import type { ToolError } from './type';
interface CodeArtifactToolCall {
@@ -331,11 +327,6 @@ export class CodeArtifactTool extends WithDisposable(ShadowlessElement) {
};
const onClick = () => {
if (isPreviewPanelOpen(this)) {
closePreviewPanel(this);
return;
}
const copyHTML = async () => {
if (this.std) {
await navigator.clipboard

View File

@@ -19,11 +19,7 @@ import { css, html, nothing } from 'lit';
import { property } from 'lit/decorators.js';
import { getCustomPageEditorBlockSpecs } from '../text-renderer';
import {
closePreviewPanel,
isPreviewPanelOpen,
renderPreviewPanel,
} from './artifacts-preview-panel';
import { renderPreviewPanel } from './artifacts-preview-panel';
import type { ToolError } from './type';
interface DocComposeToolCall {
@@ -132,11 +128,6 @@ export class DocComposeTool extends WithDisposable(ShadowlessElement) {
);
const onClick = () => {
if (isPreviewPanelOpen(this)) {
closePreviewPanel(this);
return;
}
const copyMarkdown = async () => {
await navigator.clipboard
.writeText(result.markdown)