Refine play type integration flow and docs

This commit is contained in:
2026-06-03 00:57:24 +08:00
parent dbe4c902b4
commit 67ba40c678
35 changed files with 2226 additions and 619 deletions

View File

@@ -131,7 +131,9 @@ test('match3d workspace can defer visible chrome to the unified creation page',
expect(workspace?.className).not.toContain('overflow-hidden');
expect(workspace?.className).not.toContain('platform-remap-surface');
expect(screen.queryByRole('heading', { name: '想做个什么玩法?' })).toBeNull();
expect(screen.getByLabelText('想做一个什么题材的抓大鹅?')).toBeTruthy();
const themeInput = screen.getByLabelText('想做一个什么题材的抓大鹅?');
expect(themeInput).toBeTruthy();
expect(themeInput.className).not.toContain('h-full');
});
test('match3d workspace omits legacy asset style fields from entry payload', () => {

View File

@@ -239,7 +239,7 @@ export function Match3DCreationWorkspace({
: 'min-h-0 flex-1 grid-rows-[minmax(0,1fr)_auto] lg:grid-rows-1'
} ${isBusy ? 'opacity-55' : ''}`}
>
<label className="block min-h-0">
<label className={unifiedChrome ? 'block' : 'block min-h-0'}>
<span className="mb-2 block text-sm font-black text-[var(--platform-text-strong)]">
</span>
@@ -254,7 +254,11 @@ export function Match3DCreationWorkspace({
themeText: event.target.value,
}))
}
className="h-full min-h-[7.75rem] w-full resize-none rounded-[1.15rem] border border-[var(--platform-subpanel-border)] bg-white/90 px-4 py-3 text-base leading-6 text-[var(--platform-text-strong)] outline-none transition focus:border-[var(--platform-surface-hover-border)] focus:bg-white focus:ring-2 focus:ring-[var(--platform-warm-border)] sm:min-h-[9rem] lg:min-h-[14rem]"
className={`w-full resize-none rounded-[1.15rem] border border-[var(--platform-subpanel-border)] bg-white/90 px-4 py-3 text-base leading-6 text-[var(--platform-text-strong)] outline-none transition focus:border-[var(--platform-surface-hover-border)] focus:bg-white focus:ring-2 focus:ring-[var(--platform-warm-border)] ${
unifiedChrome
? 'min-h-[11rem] sm:min-h-[12rem]'
: 'h-full min-h-[7.75rem] sm:min-h-[9rem] lg:min-h-[14rem]'
}`}
aria-label="想做一个什么题材的抓大鹅?"
/>
</label>

View File

@@ -202,6 +202,7 @@ test('puzzle workspace submits the work form instead of agent chat', () => {
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '一只猫在雨夜灯牌下回头。',
workDescription: '一只猫在雨夜灯牌下回头。',
pictureDescription: '一只猫在雨夜灯牌下回头。',
referenceImageSrc: null,
referenceImageSrcs: [],
@@ -367,6 +368,7 @@ test('puzzle workspace selects a history image from the upload card', async () =
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '保留历史图里的主体,改成晴天花园。',
workDescription: '保留历史图里的主体,改成晴天花园。',
pictureDescription: '保留历史图里的主体,改成晴天花园。',
referenceImageSrc: null,
referenceImageSrcs: [],
@@ -425,6 +427,7 @@ test('puzzle workspace falls back to compile action for restored sessions', () =
expect(onCreateFromForm).not.toHaveBeenCalled();
expect(onExecuteAction).toHaveBeenCalledWith({
action: 'compile_puzzle_draft',
workDescription: '潮雾中的灯塔与断桥',
pictureDescription: '潮雾中的灯塔与断桥',
promptText: '潮雾中的灯塔与断桥',
referenceImageSrc: null,
@@ -528,6 +531,7 @@ test('puzzle workspace restores form draft fields and autosaves edits', () => {
expect(onAutoSaveForm).toHaveBeenCalledWith({
seedText: '旧街灯牌下的猫和发光雨伞。',
workDescription: '旧街灯牌下的猫和发光雨伞。',
pictureDescription: '旧街灯牌下的猫和发光雨伞。',
referenceImageSrc: null,
referenceImageSrcs: [],
@@ -576,6 +580,7 @@ test('puzzle workspace hides prompt and cost when AI redraw is off', async () =>
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: 'first-level.png',
workDescription: 'first-level.png',
pictureDescription: 'first-level.png',
referenceImageSrc: 'data:image/png;base64,uploaded-square',
referenceImageSrcs: [],
@@ -632,6 +637,7 @@ test('puzzle workspace submits history image when AI redraw is off', async () =>
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '历史素材 · image.png',
workDescription: '历史素材 · image.png',
pictureDescription: '历史素材 · image.png',
referenceImageSrc: '/generated-puzzle-assets/history/image.png',
referenceImageSrcs: [],
@@ -674,6 +680,7 @@ test('puzzle workspace submits uploaded reference image as data URL when AI redr
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '保留上传画面的主体和构图,改成雨夜灯街。',
workDescription: '保留上传画面的主体和构图,改成雨夜灯街。',
pictureDescription: '保留上传画面的主体和构图,改成雨夜灯街。',
referenceImageSrc: 'data:image/png;base64,uploaded-square',
referenceImageSrcs: [],
@@ -764,6 +771,7 @@ test('puzzle workspace uploads prompt references as asset object ids', async ()
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '一只猫在雨夜灯牌下回头。',
workDescription: '一只猫在雨夜灯牌下回头。',
pictureDescription: '一只猫在雨夜灯牌下回头。',
referenceImageSrc: null,
referenceImageSrcs: [
@@ -852,6 +860,7 @@ test('puzzle workspace uploads prompt reference images from the description box'
expect(onCreateFromForm).toHaveBeenCalledWith({
seedText: '一只猫在雨夜灯牌下回头。',
workDescription: '一只猫在雨夜灯牌下回头。',
pictureDescription: '一只猫在雨夜灯牌下回头。',
referenceImageSrc: null,
referenceImageSrcs: [

View File

@@ -321,6 +321,7 @@ export function PuzzleCreationWorkspace({
const autosavePayload = useMemo(
() => ({
seedText: pictureDescription,
workDescription: pictureDescription,
pictureDescription,
referenceImageSrc: mainReferenceImageSrcForPayload,
referenceImageSrcs: promptReferenceImageSrcsForPayload,
@@ -551,6 +552,7 @@ export function PuzzleCreationWorkspace({
: pictureDescription || formState.referenceImageLabel || '上传拼图图片';
const payload = {
seedText: payloadPictureDescription,
workDescription: payloadPictureDescription,
pictureDescription: payloadPictureDescription,
referenceImageSrc: mainReferenceImageSrcForPayload,
referenceImageSrcs: promptReferenceImageSrcsForPayload,
@@ -571,6 +573,7 @@ export function PuzzleCreationWorkspace({
onExecuteAction({
action: 'compile_puzzle_draft',
promptText: payloadPictureDescription,
workDescription: payloadPictureDescription,
pictureDescription: payloadPictureDescription,
referenceImageSrc: mainReferenceImageSrcForPayload,
referenceImageSrcs: promptReferenceImageSrcsForPayload,