Merge remote-tracking branch 'origin/master' into codex/wechat-mini-program-auth-flow
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 }),
|
||||
|
||||
Reference in New Issue
Block a user