收口通用图片输入字段标题

迁移通用图片输入面板主图和提示词标题到 PlatformFieldLabel

保留提示词原生 label 语义并补充公共字段标题断言

更新 PlatformUiKit 文档和 Hermes 决策记录
This commit is contained in:
2026-06-10 11:52:11 +08:00
parent 7fcaf346c7
commit 076970828a
4 changed files with 18 additions and 9 deletions

View File

@@ -68,9 +68,15 @@ test('creative image input panel handles reference uploads and preview', () => {
selector: 'input',
});
const promptTextarea = screen.getByLabelText('画面描述');
const imageFieldLabel = screen.getByText('拼图画面');
const promptFieldLabel = screen.getByText('画面描述');
const emptyMainImageIconBadge = document.querySelector(
'[aria-hidden="true"]',
);
expect(imageFieldLabel.className).toContain('shrink-0');
expect(imageFieldLabel.className).toContain('text-sm font-black');
expect(promptFieldLabel.className).toContain('mb-0');
expect(promptFieldLabel.className).toContain('text-sm font-black');
expect(promptTextarea.className).toContain(
'border border-[var(--platform-subpanel-border)]',
);

View File

@@ -3,6 +3,7 @@ import { type ReactNode, useEffect, useRef, useState } from 'react';
import { ResolvedAssetImage } from '../ResolvedAssetImage';
import { PlatformActionButton } from './PlatformActionButton';
import { PlatformFieldLabel } from './PlatformFieldLabel';
import { PlatformIconBadge } from './PlatformIconBadge';
import { PlatformIconButton } from './PlatformIconButton';
import { PlatformModalCloseButton } from './PlatformModalCloseButton';
@@ -204,9 +205,9 @@ export function CreativeImageInputPanel({
disabled ? 'opacity-55' : ''
}`}
>
<div className="mb-2 shrink-0 text-sm font-black text-[var(--platform-text-strong)]">
<PlatformFieldLabel variant="form" className="shrink-0">
{labels.imageField}
</div>
</PlatformFieldLabel>
<div className={imageFrameClassName}>
<div className={imageCardClassName}>
{isMainImageUploadEnabled ? (
@@ -344,11 +345,10 @@ export function CreativeImageInputPanel({
{showPrompt ? (
<div className="block shrink-0 lg:min-h-0">
<label
htmlFor={promptTextareaId}
className="mb-2 block text-sm font-black text-[var(--platform-text-strong)]"
>
{promptLabel}
<label htmlFor={promptTextareaId} className="mb-2 block">
<PlatformFieldLabel variant="form" className="mb-0">
{promptLabel}
</PlatformFieldLabel>
</label>
<div className="relative">
<PlatformTextField