mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user