refactor: 收口创作入口启动意图

This commit is contained in:
2026-06-04 02:20:48 +08:00
parent 5ba5ca6bf8
commit 83ae363670
7 changed files with 243 additions and 62 deletions

View File

@@ -394,6 +394,10 @@ import {
mergeBarkBattleWorkSummary,
shouldPreserveLocalBarkBattleWorkOnRefresh,
} from './barkBattleWorkCache';
import {
type PlatformCreationLaunchTarget,
resolvePlatformCreationLaunchIntent,
} from './platformCreationLaunchModel';
import {
buildBabyObjectMatchCreationUrlState,
buildBarkBattleCreationUrlState,
@@ -6701,7 +6705,12 @@ export function PlatformEntryFlowShellImpl({
const handleCreationHubCreateType = useCallback(
(type: PlatformCreationTypeId) => {
if (type === 'airp') {
const intent = resolvePlatformCreationLaunchIntent({
type,
isBabyObjectMatchVisible,
});
if (!intent.shouldPrepare) {
return;
}
@@ -6709,79 +6718,49 @@ export function PlatformEntryFlowShellImpl({
return;
}
if (type === 'baby-object-match' && !isBabyObjectMatchVisible) {
sessionController.setCreationTypeError(EDUTAINMENT_HIDDEN_MESSAGE);
if (intent.type === 'blocked') {
sessionController.setCreationTypeError(intent.message);
return;
}
if (type === 'rpg') {
runProtectedAction(() => {
if (intent.type !== 'launch') {
return;
}
const launchers = {
rpg: () => {
void sessionController.openRpgAgentWorkspace();
});
return;
}
if (type === 'big-fish') {
runProtectedAction(() => {
},
'big-fish': () => {
void openBigFishAgentWorkspace();
});
return;
}
if (type === 'match3d') {
runProtectedAction(() => {
},
match3d: () => {
void openMatch3DWorkspace();
});
return;
}
if (type === 'square-hole') {
runProtectedAction(() => {
},
'square-hole': () => {
void openSquareHoleAgentWorkspace();
});
return;
}
if (type === 'jump-hop') {
runProtectedAction(() => {
},
'jump-hop': () => {
void openJumpHopWorkspace();
});
return;
}
if (type === 'wooden-fish') {
runProtectedAction(() => {
},
'wooden-fish': () => {
void openWoodenFishWorkspace();
});
return;
}
if (type === 'puzzle') {
runProtectedAction(() => {
},
puzzle: () => {
void openPuzzleWorkspace();
});
return;
}
if (type === 'bark-battle') {
runProtectedAction(() => {
},
'bark-battle': () => {
void openBarkBattleWorkspace();
});
return;
}
if (type === 'visual-novel') {
runProtectedAction(() => {
},
'visual-novel': () => {
void openVisualNovelWorkspace();
});
return;
}
if (type === 'baby-object-match') {
runProtectedAction(() => {
},
'baby-object-match': () => {
void openBabyObjectMatchWorkspace();
});
}
},
} satisfies Record<PlatformCreationLaunchTarget, () => void>;
runProtectedAction(launchers[intent.target]);
},
[
isBabyObjectMatchVisible,