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 && {previewable &&
viewMode === "preview" && viewMode === "preview" &&
(language === "markdown" || language === "html") && ( (language === "markdown" || language === "html") && (
<div className="min-h-full mb-[180px] rounded-b-[10px] bg-white p-0 mb-0">
<ArtifactFilePreview <ArtifactFilePreview
content={displayContent} content={displayContent}
language={language ?? "text"} language={language ?? "text"}
zoom={zoom} zoom={zoom}
/> />
</div>
)} )}
{isCodeFile && viewMode === "code" && ( {isCodeFile && viewMode === "code" && (
<div className="min-h-full mb-[180px] rounded-b-[10px] bg-white p-0 mb-0"> <div className="min-h-full mb-[180px] rounded-b-[10px] bg-white p-0 mb-0">
@ -487,7 +487,7 @@ export function ArtifactFileDetail({
</div> </div>
)} )}
{!isCodeFile && ( {!isCodeFile && (
<div className="h-full mb-[180px] "> <div className="h-full mb-[180px]">
<iframe <iframe
className="size-full border-0" className="size-full border-0"
srcDoc={artifactViewerSrcDoc} srcDoc={artifactViewerSrcDoc}
@ -526,10 +526,12 @@ export function ArtifactFilePreview({
{content ?? ""} {content ?? ""}
</Streamdown> </Streamdown>
</div> </div>
); );
} }
if (language === "html") { if (language === "html") {
return ( return (
<div className="h-full mb-[180px]">
<iframe <iframe
className="size-full" className="size-full"
title="Artifact preview" title="Artifact preview"
@ -537,6 +539,8 @@ export function ArtifactFilePreview({
sandbox="allow-scripts allow-forms" sandbox="allow-scripts allow-forms"
style={{ zoom: zoomScale }} style={{ zoom: zoomScale }}
/> />
</div>
); );
} }
return null; return null;

View File

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