fix: reconcile architecture adjustment merge

This commit is contained in:
2026-06-07 00:57:23 +08:00
parent ce930ee5c3
commit 48ef19d518
20 changed files with 431 additions and 33 deletions

View File

@@ -219,6 +219,7 @@ import {
buildSquareHoleGenerationAnchorEntries,
buildWoodenFishGenerationAnchorEntries,
createMiniGameDraftGenerationState,
type MiniGameDraftGenerationKind,
type MiniGameDraftGenerationState,
resolveMiniGameDraftGenerationStartedAtMs,
} from '../../services/miniGameDraftGenerationProgress';
@@ -234,6 +235,7 @@ import {
buildSquareHolePublicWorkCode,
buildVisualNovelPublicWorkCode,
buildWoodenFishPublicWorkCode,
isSamePuzzleClearPublicWorkCode,
isSamePuzzlePublicWorkCode,
} from '../../services/publicWorkCode';
import {
@@ -373,7 +375,12 @@ import {
selectAdjacentPlatformRecommendEntry,
} from '../rpg-entry/rpgEntryPublicGalleryViewModel';
import {
isBigFishGalleryEntry,
isEdutainmentGalleryEntry,
isJumpHopGalleryEntry,
isPuzzleGalleryEntry,
isPuzzleClearGalleryEntry,
mapPuzzleClearWorkToPlatformGalleryCard,
mapPuzzleWorkToPlatformGalleryCard,
type PlatformPublicGalleryCard,
resolvePlatformPublicWorkCode,
@@ -415,6 +422,7 @@ import {
buildBigFishCreationUrlState,
buildJumpHopCreationUrlState,
buildMatch3DCreationUrlState,
buildPuzzleClearCreationUrlState,
buildPuzzleCreationUrlState,
buildPuzzleDraftRuntimeUrlState,
buildPuzzlePublishedRuntimeUrlState,
@@ -456,6 +464,7 @@ import {
buildPendingBigFishWorks,
buildPendingJumpHopWorks,
buildPendingMatch3DWorks,
buildPendingPuzzleClearWorks,
buildPendingPuzzleWorks,
buildPendingSquareHoleWorks,
buildPendingVisualNovelWorks,
@@ -557,6 +566,8 @@ import {
} from './platformMiniGameDraftPayloadModel';
import {
buildJumpHopPendingSession,
buildPuzzleClearPendingSession,
buildPuzzleClearSessionFromWorkDetail,
buildPuzzleRuntimeWorkFromSession,
buildSquareHoleProfileFromSession,
buildVisualNovelSessionFromWorkDetail,
@@ -752,7 +763,7 @@ async function resumePuzzleProfileSaveArchiveRaw(worldKey: string) {
);
}
const RECOMMEND_RUNTIME_BACKGROUND_AUTH_OPTIONS =
const RECOMMEND_RUNTIME_BACKGROUND_AUTH_OPTIONS: JumpHopRuntimeRequestOptions =
BACKGROUND_AUTH_REQUEST_OPTIONS;
const RECOMMEND_PUZZLE_BACKGROUND_AUTH_OPTIONS: JumpHopRuntimeRequestOptions =
RECOMMEND_RUNTIME_BACKGROUND_AUTH_OPTIONS;
@@ -778,6 +789,16 @@ function resolveCurrentRecommendRuntimeAuthPlan(
hasStoredAccessToken: Boolean(getStoredAccessToken()),
});
}
function shouldUseRecommendRuntimeGuestAuth(authUi: RecommendRuntimeAuthUi) {
return (
resolveCurrentRecommendRuntimeAuthPlan(authUi, {
embedded: true,
allowRuntimeGuestAuth: true,
}).requestKind === 'runtime-guest'
);
}
async function buildRecommendRuntimeOptionsFromAuthPlan(
plan: ReturnType<typeof resolvePlatformRecommendRuntimeAuthPlan>,
) {
@@ -797,6 +818,28 @@ async function buildRecommendRuntimeAuthOptions(
resolveCurrentRecommendRuntimeAuthPlan(authUi, { embedded }),
);
}
function resolveRecommendEntryShareStage(
entry: PlatformPublicGalleryCard,
): PublishShareModalPayload['stage'] {
if (isBigFishGalleryEntry(entry)) {
return 'big-fish-runtime';
}
if (isPuzzleGalleryEntry(entry)) {
return 'puzzle-gallery-detail';
}
return 'work-detail';
}
function pushPuzzleResultHistoryEntry(
session: PuzzleAgentSessionSnapshot | null,
) {
pushAppHistoryPath('/creation/puzzle/result');
writeCreationUrlState(buildPuzzleCreationUrlState(session));
}
const PUZZLE_DRAFT_GENERATION_POINT_COST = 2;
const MATCH3D_DRAFT_GENERATION_POINT_COST = 10;
const BARK_BATTLE_DRAFT_GENERATION_POINT_COST = 3;
@@ -2795,6 +2838,7 @@ export function PlatformEntryFlowShellImpl({
bigFishEntries: bigFishGalleryEntries,
match3dEntries: match3dGalleryEntries,
puzzleEntries: puzzleGalleryEntries,
puzzleClearEntries: puzzleClearGalleryEntries,
barkBattleGalleryEntries,
barkBattleWorks,
jumpHopEntries: jumpHopGalleryEntries,
@@ -12358,6 +12402,12 @@ export function PlatformEntryFlowShellImpl({
{ authMode: intent.authMode },
);
return;
case 'start-puzzle-clear':
setPublicWorkDetailError(null);
void startPuzzleClearRunFromProfile(intent.profileId, {
returnStage: intent.returnStage,
});
return;
case 'start-jump-hop':
setPublicWorkDetailError(null);
void startJumpHopRunFromProfile(intent.profileId, {
@@ -12491,6 +12541,8 @@ export function PlatformEntryFlowShellImpl({
setBigFishError(intent.errorMessage);
} else if (intent.errorTarget === 'puzzle') {
setPuzzleError(intent.errorMessage);
} else if (intent.errorTarget === 'puzzle-clear') {
setPuzzleClearError(intent.errorMessage);
} else if (intent.errorTarget === 'match3d') {
setMatch3DError(intent.errorMessage);
} else if (intent.errorTarget === 'square-hole') {
@@ -12514,6 +12566,12 @@ export function PlatformEntryFlowShellImpl({
{ embedded: intent.embedded },
);
break;
case 'start-puzzle-clear':
started = await startPuzzleClearRunFromProfile(intent.profileId, {
embedded: intent.embedded,
returnStage: intent.returnStage,
});
break;
case 'start-jump-hop':
started = await startJumpHopRunFromProfile(intent.profileId, {
embedded: intent.embedded,
@@ -13092,6 +13150,7 @@ export function PlatformEntryFlowShellImpl({
hasBigFishRun: Boolean(bigFishRun),
hasJumpHopRun: Boolean(jumpHopRun),
hasMatch3DRun: Boolean(match3dRun),
hasPuzzleClearRun: Boolean(puzzleClearRun),
hasSquareHoleRun: Boolean(squareHoleRun),
hasVisualNovelRun: Boolean(visualNovelRun),
hasWoodenFishRun: Boolean(woodenFishRun),
@@ -13114,6 +13173,7 @@ export function PlatformEntryFlowShellImpl({
hasBigFishRun: Boolean(bigFishRun),
hasJumpHopRun: Boolean(jumpHopRun),
hasMatch3DRun: Boolean(match3dRun),
hasPuzzleClearRun: Boolean(puzzleClearRun),
hasSquareHoleRun: Boolean(squareHoleRun),
hasVisualNovelRun: Boolean(visualNovelRun),
hasWoodenFishRun: Boolean(woodenFishRun),