) : null}
diff --git a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
index a24b6b78..0d22a681 100644
--- a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
+++ b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
@@ -755,6 +755,9 @@ export function PlatformEntryFlowShellImpl({
},
onActionComplete: ({ payload, response, setSession }) => {
setSession(response.session);
+ if (payload.action === 'big_fish_publish_game') {
+ void refreshBigFishShelf();
+ }
if (payload.action !== 'big_fish_compile_draft') {
return;
}
@@ -1099,7 +1102,11 @@ export function PlatformEntryFlowShellImpl({
const submitBigFishInput = useCallback(
(payload: SubmitBigFishInputRequest) => {
- if (!bigFishRun || bigFishInputInFlightRef.current) {
+ if (
+ !bigFishRun ||
+ bigFishRun.status !== 'running' ||
+ bigFishInputInFlightRef.current
+ ) {
return;
}
@@ -2096,6 +2103,9 @@ export function PlatformEntryFlowShellImpl({
onBack={() => {
setSelectionStage('big-fish-result');
}}
+ onRestart={() => {
+ void startBigFishRun();
+ }}
onSubmitInput={submitBigFishInput}
/>
diff --git a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx
index 36ca1769..fd448204 100644
--- a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx
+++ b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx
@@ -34,6 +34,7 @@ import {
} from '../../services/rpg-entry';
import {
createBigFishCreationSession,
+ executeBigFishCreationAction,
getBigFishCreationSession,
} from '../../services/big-fish-creation';
import { listBigFishWorks } from '../../services/big-fish-works';
@@ -172,13 +173,23 @@ vi.mock('../big-fish-result/BigFishResultView', () => ({
BigFishResultView: ({
session,
onBack,
+ onExecuteAction,
}: {
session: { draft?: { title: string } | null };
onBack: () => void;
+ onExecuteAction: (payload: { action: string }) => void;
}) => (
大鱼吃小鱼结果页
{session.draft?.title ?? '缺少草稿标题'}
+
@@ -1815,6 +1826,102 @@ test('big fish draft card restores the bound agent session and opens the result
expect(screen.getByText('我想做机械深海里微生物互相吞并进化。')).toBeTruthy();
});
+test('big fish result publish action refreshes creation works', async () => {
+ const user = userEvent.setup();
+ const baseBigFishSession = (await getBigFishCreationSession('big-fish-session-1'))
+ .session;
+ vi.mocked(getBigFishCreationSession).mockClear();
+ vi.mocked(listBigFishWorks).mockClear();
+ const publishedBigFishSession = {
+ ...baseBigFishSession,
+ stage: 'published',
+ publishReady: true,
+ assetCoverage: {
+ levelMainImageReadyCount: 8,
+ levelMotionReadyCount: 16,
+ backgroundReady: true,
+ requiredLevelCount: 8,
+ publishReady: true,
+ blockers: [],
+ },
+ updatedAt: '2026-04-22T12:20:00.000Z',
+ };
+ vi.mocked(executeBigFishCreationAction).mockResolvedValue({
+ session: publishedBigFishSession,
+ });
+ vi.mocked(listBigFishWorks)
+ .mockResolvedValueOnce({
+ items: [
+ {
+ workId: 'big-fish-work-big-fish-session-1',
+ sourceSessionId: 'big-fish-session-1',
+ title: '机械深海 大鱼吃小鱼',
+ subtitle: '机械微生物吞并进化 · 偏爽快节奏',
+ summary: '机械微生物吞并进化',
+ coverImageSrc: null,
+ status: 'draft',
+ updatedAt: '2026-04-22T12:10:00.000Z',
+ publishReady: true,
+ levelCount: 8,
+ levelMainImageReadyCount: 8,
+ levelMotionReadyCount: 16,
+ backgroundReady: true,
+ },
+ ],
+ })
+ .mockResolvedValue({
+ items: [
+ {
+ workId: 'big-fish-work-big-fish-session-1',
+ sourceSessionId: 'big-fish-session-1',
+ title: '机械深海 大鱼吃小鱼',
+ subtitle: '机械微生物吞并进化 · 偏爽快节奏',
+ summary: '机械微生物吞并进化',
+ coverImageSrc: null,
+ status: 'published',
+ updatedAt: '2026-04-22T12:20:00.000Z',
+ publishReady: true,
+ levelCount: 8,
+ levelMainImageReadyCount: 8,
+ levelMotionReadyCount: 16,
+ backgroundReady: true,
+ },
+ ],
+ });
+
+ render(
);
+
+ await openCreationHub(user);
+ const title = await screen.findByText('机械深海 大鱼吃小鱼');
+ const card = title.closest('.platform-surface');
+ if (!(card instanceof HTMLElement)) {
+ throw new Error('Missing big fish draft card');
+ }
+
+ await user.click(card);
+ await waitFor(() => {
+ expect(getBigFishCreationSession).toHaveBeenCalledWith(
+ 'big-fish-session-1',
+ );
+ });
+ vi.mocked(listBigFishWorks).mockClear();
+
+ expect(await screen.findByText('大鱼吃小鱼结果页')).toBeTruthy();
+ await user.click(await screen.findByRole('button', { name: '发布' }));
+
+ await waitFor(() => {
+ expect(executeBigFishCreationAction).toHaveBeenCalledWith(
+ 'big-fish-session-1',
+ {
+ action: 'big_fish_publish_game',
+ },
+ );
+ });
+ await waitFor(() => {
+ expect(listBigFishWorks).toHaveBeenCalled();
+ });
+});
+
test('starting draft generation leaves the agent workspace and shows the generation progress view', async () => {
const user = userEvent.setup();