fix: 修复html文件高度没自适应。发送框文本状态错误

This commit is contained in:
肖应宇 2026-04-02 11:51:17 +08:00
parent d0c9255c20
commit e192d75a1c
2 changed files with 27 additions and 23 deletions

View File

@ -468,13 +468,13 @@ export function ArtifactFileDetail({
{previewable &&
viewMode === "preview" &&
(language === "markdown" || language === "html") && (
<div className="min-h-full mb-[180px] rounded-b-[10px] bg-white p-0 mb-0">
<ArtifactFilePreview
content={displayContent}
language={language ?? "text"}
zoom={zoom}
/>
</div>
<ArtifactFilePreview
content={displayContent}
language={language ?? "text"}
zoom={zoom}
/>
)}
{isCodeFile && viewMode === "code" && (
<div className="min-h-full mb-[180px] rounded-b-[10px] bg-white p-0 mb-0">
@ -487,14 +487,14 @@ export function ArtifactFileDetail({
</div>
)}
{!isCodeFile && (
<div className="h-full mb-[180px] ">
<iframe
className="size-full border-0"
srcDoc={artifactViewerSrcDoc}
sandbox="allow-same-origin allow-scripts allow-downloads"
title={`Artifact preview: ${fileName}`}
/>
</div>
<div className="h-full mb-[180px]">
<iframe
className="size-full border-0"
srcDoc={artifactViewerSrcDoc}
sandbox="allow-same-origin allow-scripts allow-downloads"
title={`Artifact preview: ${fileName}`}
/>
</div>
)}
</ArtifactContent>
</Artifact>
@ -526,17 +526,21 @@ export function ArtifactFilePreview({
{content ?? ""}
</Streamdown>
</div>
);
}
if (language === "html") {
return (
<iframe
className="size-full"
title="Artifact preview"
srcDoc={content}
sandbox="allow-scripts allow-forms"
style={{ zoom: zoomScale }}
/>
<div className="h-full mb-[180px]">
<iframe
className="size-full"
title="Artifact preview"
srcDoc={content}
sandbox="allow-scripts allow-forms"
style={{ zoom: zoomScale }}
/>
</div>
);
}
return null;

View File

@ -88,7 +88,7 @@ export function InputBox({
threadId: threadIdFromProps,
disabled,
autoFocus,
status = "ready",
status,
context,
extraHeader,
showWelcomeStyle,