fix: view vars artifacts md not support scroll and loading not in the center
Some checks failed
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Has been cancelled
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Has been cancelled
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Has been cancelled
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Has been cancelled
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Has been cancelled

This commit is contained in:
Joel
2026-02-14 11:00:08 +08:00
parent 5432bba0ca
commit 4b6f1861ef
2 changed files with 31 additions and 28 deletions

View File

@@ -29,34 +29,37 @@ const MarkdownFileEditor = ({
}, [value, onChange])
return (
<div className="h-full w-full bg-components-panel-bg">
<SkillEditor
instanceId={instanceId}
value={value}
onChange={handleChange}
editable={!readOnly}
autoFocus={!readOnly && autoFocus}
onAutoFocus={onAutoFocus}
collaborationEnabled={readOnly ? false : collaborationEnabled}
showLineNumbers
className="h-full"
wrapperClassName="h-full"
placeholder={readOnly
? undefined
: (
<span className="flex items-center gap-1 text-components-input-text-placeholder">
<span>{t('promptEditor.skillMarkdown.placeholderPrefix', { ns: 'common' })}</span>
<span className="inline-flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray px-[1px] text-text-placeholder system-kbd">/</span>
<span className="text-[13px] leading-4 underline decoration-dotted">
{t('promptEditor.skillMarkdown.placeholderReferenceFiles', { ns: 'common' })}
<div className="flex h-full min-h-0 w-full bg-components-panel-bg">
{/* Lexical editor defaults to `overflow: visible`; provide a bounded scroll container. */}
<div className="h-full min-h-0 flex-1 overflow-y-auto">
<SkillEditor
instanceId={instanceId}
value={value}
onChange={handleChange}
editable={!readOnly}
autoFocus={!readOnly && autoFocus}
onAutoFocus={onAutoFocus}
collaborationEnabled={readOnly ? false : collaborationEnabled}
showLineNumbers
className="h-full"
wrapperClassName="h-full"
placeholder={readOnly
? undefined
: (
<span className="flex items-center gap-1 text-components-input-text-placeholder">
<span>{t('promptEditor.skillMarkdown.placeholderPrefix', { ns: 'common' })}</span>
<span className="inline-flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray px-[1px] text-text-placeholder system-kbd">/</span>
<span className="text-[13px] leading-4 underline decoration-dotted">
{t('promptEditor.skillMarkdown.placeholderReferenceFiles', { ns: 'common' })}
</span>
<span className="inline-flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray px-[1px] text-text-placeholder system-kbd">@</span>
<span className="text-[13px] leading-4 underline decoration-dotted">
{t('promptEditor.skillMarkdown.placeholderUseTools', { ns: 'common' })}
</span>
</span>
<span className="inline-flex h-4 min-w-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray px-[1px] text-text-placeholder system-kbd">@</span>
<span className="text-[13px] leading-4 underline decoration-dotted">
{t('promptEditor.skillMarkdown.placeholderUseTools', { ns: 'common' })}
</span>
</span>
)}
/>
)}
/>
</div>
</div>
)
}

View File

@@ -204,7 +204,7 @@ const ArtifactsTab = (headerProps: InspectHeaderProps) => {
? (
<div className="min-h-0 grow">
{isDownloadUrlLoading
? <Loading type="area" />
? <div className="flex h-full items-center justify-center"><Loading type="area" /></div>
: downloadUrlData?.download_url
? (
<ReadOnlyFilePreview