复用平台图标按钮收口参考图入口

编辑器生成输入框参考图按钮改为 PlatformIconButton surfaceFloating。

保留生成器局部尺寸和浅灰覆盖,避免重复维护图标按钮基础 chrome。

补充测试覆盖参考图按钮平台浮动按钮 class,并更新 TRACKING。
This commit is contained in:
2026-06-14 14:38:06 +08:00
parent 8157622718
commit 80d3a06e29
4 changed files with 14 additions and 5 deletions

View File

@@ -731,6 +731,12 @@ describe('ImageCanvasEditorView', () => {
);
expect(screen.getByLabelText('图像生成占位图')).toBeTruthy();
expect(within(generateDialog).getByText('参考图')).toBeTruthy();
expect(
within(generateDialog).getByRole('button', { name: '添加参考图' }).className,
).toContain('bg-white/94');
expect(
within(generateDialog).getByRole('button', { name: '添加参考图' }).className,
).toContain('image-canvas-editor__generation-ref');
expect(within(generateDialog).getByRole('button', { name: '生成比例 1:1 2k 1张' })).toBeTruthy();
expect(within(generateDialog).getByRole('button', { name: '生成模型 GPT Image' })).toBeTruthy();
expect(within(generateDialog).getByRole('button', { name: '生成' }).className).toContain(

View File

@@ -69,6 +69,7 @@ import {
PlatformFloatingMenu,
PlatformFloatingMenuItem,
} from '../common/PlatformFloatingMenu';
import { PlatformIconButton } from '../common/PlatformIconButton';
import { PlatformStatusMessage } from '../common/PlatformStatusMessage';
import { UnifiedModal } from '../common/UnifiedModal';
@@ -2784,16 +2785,16 @@ export function ImageCanvasEditorView() {
}
}}
>
<button
type="button"
<PlatformIconButton
variant="surfaceFloating"
className="image-canvas-editor__generation-ref"
aria-label="添加参考图"
label="添加参考图"
disabled={generateDialog.status === 'generating'}
onClick={() => uploadInputRef.current?.click()}
icon={<ImageIcon className="h-4 w-4" />}
>
<ImageIcon className="h-4 w-4" />
<span></span>
</button>
</PlatformIconButton>
<textarea
aria-label="生成提示词"
value={generateDialog.prompt}