hide frontend image model names
This commit is contained in:
@@ -174,7 +174,7 @@ test('baby object result blocks placeholder assets and exposes regeneration', as
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByText('当前作品仍是占位资源,请重新生成 image-2 资源后再试玩或发布。'),
|
||||
screen.getByText('当前作品仍是占位资源,请重新生成素材后再试玩或发布。'),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
(screen.getByRole('button', { name: '试玩' }) as HTMLButtonElement)
|
||||
|
||||
@@ -158,7 +158,7 @@ export function BabyObjectMatchResultView({
|
||||
|
||||
{!hasGeneratedAssets ? (
|
||||
<div className="platform-banner mt-3 rounded-2xl text-sm leading-6">
|
||||
当前作品仍是占位资源,请重新生成 image-2 资源后再试玩或发布。
|
||||
当前作品仍是占位资源,请重新生成素材后再试玩或发布。
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -7441,7 +7441,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
setBabyObjectMatchError(
|
||||
resolvePuzzleErrorMessage(
|
||||
error,
|
||||
'重新生成宝贝识物 image-2 资源失败。',
|
||||
'重新生成宝贝识物素材失败。',
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
@@ -7474,7 +7474,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
setBabyObjectMatchError(
|
||||
resolvePuzzleErrorMessage(
|
||||
error,
|
||||
'生成宝贝识物 image-2 资源失败,请重试后再发布。',
|
||||
'生成宝贝识物素材失败,请重试后再发布。',
|
||||
),
|
||||
);
|
||||
} finally {
|
||||
@@ -7525,7 +7525,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
} catch (error) {
|
||||
const message = resolvePuzzleErrorMessage(
|
||||
error,
|
||||
'生成宝贝识物 image-2 资源失败,请重试后再试玩。',
|
||||
'生成宝贝识物素材失败,请重试后再试玩。',
|
||||
);
|
||||
setBabyObjectMatchError(message);
|
||||
if (options.embedded) {
|
||||
|
||||
@@ -411,7 +411,7 @@ test('puzzle workspace falls back to compile action for restored sessions', () =
|
||||
});
|
||||
});
|
||||
|
||||
test('puzzle workspace switches the image model from the description box', () => {
|
||||
test('puzzle workspace switches image mode without exposing model names', () => {
|
||||
const onCreateFromForm = vi.fn();
|
||||
|
||||
render(
|
||||
@@ -427,9 +427,9 @@ test('puzzle workspace switches the image model from the description box', () =>
|
||||
fireEvent.change(screen.getByLabelText('画面描述'), {
|
||||
target: { value: '一只猫在雨夜灯牌下回头。' },
|
||||
});
|
||||
fireEvent.click(screen.getByRole('button', { name: '图片模型' }));
|
||||
expect(screen.queryByRole('menuitemradio', { name: '原模型' })).toBeNull();
|
||||
fireEvent.click(screen.getByRole('menuitemradio', { name: 'nanobanana2' }));
|
||||
fireEvent.click(screen.getByRole('button', { name: '图片生成模式' }));
|
||||
expect(screen.queryByText(/gpt|nanobanana|gemini/u)).toBeNull();
|
||||
fireEvent.click(screen.getByRole('menuitemradio', { name: '创意模式' }));
|
||||
fireEvent.click(screen.getByRole('button', { name: /生成拼图游戏草稿/u }));
|
||||
confirmPuzzlePointCost();
|
||||
|
||||
|
||||
@@ -45,8 +45,8 @@ export function PuzzleImageModelPicker({
|
||||
className={`inline-flex min-h-8 max-w-[10rem] items-center rounded-full border border-[var(--platform-subpanel-border)] bg-white/96 px-3 text-[11px] font-bold text-[var(--platform-text-strong)] shadow-sm transition hover:bg-[var(--platform-subpanel-fill)] ${disabled ? 'cursor-not-allowed opacity-55' : ''}`}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={isOpen}
|
||||
aria-label="图片模型"
|
||||
title="图片模型"
|
||||
aria-label="图片生成模式"
|
||||
title="图片生成模式"
|
||||
>
|
||||
<span className="truncate">
|
||||
{getPuzzleImageModelLabel(normalizedValue)}
|
||||
|
||||
@@ -9,8 +9,8 @@ export const PUZZLE_IMAGE_MODEL_OPTIONS: Array<{
|
||||
id: PuzzleImageModelId;
|
||||
label: string;
|
||||
}> = [
|
||||
{ id: PUZZLE_IMAGE_MODEL_GPT_IMAGE_2, label: 'gpt-image-2' },
|
||||
{ id: PUZZLE_IMAGE_MODEL_NANOBANANA2, label: 'nanobanana2' },
|
||||
{ id: PUZZLE_IMAGE_MODEL_GPT_IMAGE_2, label: '标准模式' },
|
||||
{ id: PUZZLE_IMAGE_MODEL_NANOBANANA2, label: '创意模式' },
|
||||
];
|
||||
|
||||
export function normalizePuzzleImageModel(
|
||||
@@ -25,6 +25,6 @@ export function normalizePuzzleImageModel(
|
||||
export function getPuzzleImageModelLabel(model: PuzzleImageModelId) {
|
||||
return (
|
||||
PUZZLE_IMAGE_MODEL_OPTIONS.find((option) => option.id === model)?.label ??
|
||||
'gpt-image-2'
|
||||
'标准模式'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1305,7 +1305,7 @@ describe('PuzzleResultView', () => {
|
||||
expect(screen.queryByPlaceholderText('参考图链接或资产ID')).toBeNull();
|
||||
});
|
||||
|
||||
test('passes the selected image model when regenerating a level image', () => {
|
||||
test('passes the selected image mode without exposing model names', () => {
|
||||
const onExecuteAction = vi.fn();
|
||||
|
||||
render(
|
||||
@@ -1319,9 +1319,12 @@ describe('PuzzleResultView', () => {
|
||||
openPuzzleLevelsTab();
|
||||
fireEvent.click(screen.getByText('雨夜猫街'));
|
||||
const dialog = screen.getByRole('dialog', { name: '关卡详情' });
|
||||
fireEvent.click(within(dialog).getByRole('button', { name: '图片模型' }));
|
||||
fireEvent.click(
|
||||
within(dialog).getByRole('menuitemradio', { name: 'gpt-image-2' }),
|
||||
within(dialog).getByRole('button', { name: '图片生成模式' }),
|
||||
);
|
||||
expect(within(dialog).queryByText(/gpt|nanobanana|gemini/u)).toBeNull();
|
||||
fireEvent.click(
|
||||
within(dialog).getByRole('menuitemradio', { name: '标准模式' }),
|
||||
);
|
||||
fireEvent.click(
|
||||
within(dialog).getByRole('button', { name: /重新生成画面/u }),
|
||||
|
||||
@@ -279,7 +279,7 @@ async function generateBabyObjectMatchAssets(
|
||||
const assets = normalizeGeneratedAssets(response.assets, itemNames);
|
||||
const visualPackage = normalizeGeneratedVisualPackage(response.visualPackage);
|
||||
if (!assets || !visualPackage) {
|
||||
throw new Error('宝贝识物 image-2 资源生成结果不完整,请重试。');
|
||||
throw new Error('宝贝识物素材生成结果不完整,请重试。');
|
||||
}
|
||||
|
||||
return { assets, visualPackage };
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('miniGameDraftGenerationProgress', () => {
|
||||
'建立可恢复草稿,整理首关描述与关卡结构,约 8 秒。',
|
||||
);
|
||||
expect(progress?.steps[2]?.detail).toBe(
|
||||
'调用 gpt-image-2 生成 1:1 拼图首图,预计 4 分钟。',
|
||||
'生成 1:1 拼图首图,预计 4 分钟。',
|
||||
);
|
||||
expect(progress?.estimatedRemainingMs).toBe(446_500);
|
||||
expect(progress?.overallProgress).toBe(0);
|
||||
|
||||
@@ -167,7 +167,7 @@ function buildPuzzleTimedSteps(state: MiniGameDraftGenerationState) {
|
||||
steps.push({
|
||||
id: 'puzzle-cover-image',
|
||||
label: '生成拼图首图',
|
||||
detail: '调用 gpt-image-2 生成 1:1 拼图首图,预计 4 分钟。',
|
||||
detail: '生成 1:1 拼图首图,预计 4 分钟。',
|
||||
durationMs: PUZZLE_COVER_IMAGE_GENERATION_EXPECTED_MS,
|
||||
});
|
||||
}
|
||||
@@ -177,15 +177,15 @@ function buildPuzzleTimedSteps(state: MiniGameDraftGenerationState) {
|
||||
id: 'puzzle-level-scene',
|
||||
label: '生成关卡画面',
|
||||
detail: shouldSkipPuzzleCoverGeneration(state)
|
||||
? '直接使用上传图作为参考,调用 gpt-image-2 生成 9:16 完整关卡画面,预计 90 秒。'
|
||||
: '使用拼图首图作为参考,调用 gpt-image-2 生成 9:16 完整关卡画面,预计 90 秒。',
|
||||
? '直接使用上传图作为参考,生成 9:16 完整关卡画面,预计 90 秒。'
|
||||
: '使用拼图首图作为参考,生成 9:16 完整关卡画面,预计 90 秒。',
|
||||
durationMs: PUZZLE_IMAGE_GENERATION_EXPECTED_MS,
|
||||
},
|
||||
{
|
||||
id: 'puzzle-ui-assets',
|
||||
label: '生成UI与背景',
|
||||
detail:
|
||||
'用关卡画面作参考,并发生成 UI spritesheet 与 9:16 纯背景;两次 gpt-image-2 并发,预计 90 秒。',
|
||||
'用关卡画面作参考,并发生成 UI spritesheet 与 9:16 纯背景,预计 90 秒。',
|
||||
durationMs: PUZZLE_IMAGE_GENERATION_EXPECTED_MS,
|
||||
},
|
||||
{
|
||||
@@ -305,7 +305,7 @@ const MATCH3D_STEPS = [
|
||||
{
|
||||
id: 'match3d-level-scene',
|
||||
label: '生成关卡整图',
|
||||
detail: '调用 gpt-image-2 生成 9:16 完整抓大鹅关卡画面。',
|
||||
detail: '生成 9:16 完整抓大鹅关卡画面。',
|
||||
weight: 28,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user