Merge branch 'codex/platform-creation-flow-polish'

# Conflicts:
#	docs/【玩法创作】平台入口与玩法链路-2026-05-15.md
#	src/components/rpg-entry/RpgEntryHomeView.tsx
This commit is contained in:
2026-06-06 22:49:48 +08:00
12 changed files with 435 additions and 100 deletions

View File

@@ -743,6 +743,20 @@ function getPlatformRecommendRuntimeKind(
return 'rpg';
}
function resolveRecommendEntryShareStage(
entry: PlatformPublicGalleryCard,
): PublishShareModalPayload['stage'] {
if (isBigFishGalleryEntry(entry)) {
return 'big-fish-runtime';
}
if (isPuzzleGalleryEntry(entry)) {
return 'puzzle-gallery-detail';
}
return 'work-detail';
}
function isRecommendRuntimeReadyForEntry(
entry: PlatformPublicGalleryCard,
state: RecommendRuntimeState,
@@ -1920,6 +1934,13 @@ function buildPuzzleCreationUrlState(
};
}
function pushPuzzleResultHistoryEntry(
session: PuzzleAgentSessionSnapshot | null,
) {
pushAppHistoryPath('/creation/puzzle/result');
writeCreationUrlState(buildPuzzleCreationUrlState(session));
}
function buildPuzzleDraftRuntimeUrlState(
item: PuzzleWorkSummary,
levelId?: string | null,
@@ -5205,6 +5226,22 @@ export function PlatformEntryFlowShellImpl({
[],
);
const openRecommendShareModal = useCallback(
(entry: PlatformPublicGalleryCard) => {
const publicWorkCode = resolvePlatformPublicWorkCode(entry)?.trim();
if (!publicWorkCode) {
return;
}
openPublishShareModal({
title: entry.worldName,
publicWorkCode,
stage: resolveRecommendEntryShareStage(entry),
});
},
[openPublishShareModal],
);
const openRpgPublishShareModal = useCallback(
async (profile: CustomWorldProfile | null | undefined) => {
const profileId = profile?.id?.trim();
@@ -6635,6 +6672,7 @@ export function PlatformEntryFlowShellImpl({
setPuzzleRun(run);
setPuzzleRuntimeAuthMode('default');
setPuzzleRuntimeReturnStage('puzzle-result');
pushPuzzleResultHistoryEntry(response.session);
openPuzzleRuntimeStage(
setSelectionStage,
buildPuzzleDraftRuntimeUrlState(item, null),
@@ -7000,6 +7038,7 @@ export function PlatformEntryFlowShellImpl({
setPuzzleRun(run);
setPuzzleRuntimeAuthMode('default');
setPuzzleRuntimeReturnStage('puzzle-result');
pushPuzzleResultHistoryEntry(latestSession);
openPuzzleRuntimeStage(
setSelectionStage,
buildPuzzleDraftRuntimeUrlState(item, null),
@@ -7992,6 +8031,7 @@ export function PlatformEntryFlowShellImpl({
setPuzzleRun(run);
setPuzzleRuntimeAuthMode('default');
setPuzzleRuntimeReturnStage('puzzle-result');
pushPuzzleResultHistoryEntry(response.session);
openPuzzleRuntimeStage(
setSelectionStage,
buildPuzzleDraftRuntimeUrlState(item, null),
@@ -11926,6 +11966,7 @@ export function PlatformEntryFlowShellImpl({
setPuzzleRun(run);
setPuzzleRuntimeAuthMode('default');
setPuzzleRuntimeReturnStage('puzzle-result');
pushPuzzleResultHistoryEntry(puzzleSession);
openPuzzleRuntimeStage(
setSelectionStage,
buildPuzzleDraftRuntimeUrlState(item, options.levelId ?? null),
@@ -11940,8 +11981,7 @@ export function PlatformEntryFlowShellImpl({
},
[
isPuzzleBusy,
puzzleSession?.publishedProfileId,
puzzleSession?.sessionId,
puzzleSession,
resolvePuzzleErrorMessage,
setIsPuzzleBusy,
setPuzzleError,
@@ -17789,6 +17829,9 @@ export function PlatformEntryFlowShellImpl({
onLikeRecommendEntry={(entry) => {
likePublicWork(entry);
}}
onShareRecommendEntry={(entry) => {
openRecommendShareModal(entry);
}}
onRemixRecommendEntry={(entry) => {
remixPublicWork(entry);
}}
@@ -19702,7 +19745,13 @@ export function PlatformEntryFlowShellImpl({
error={puzzleError}
hideBackButton={Boolean(puzzleOnboardingDraft)}
onBack={() => {
setSelectionStage(puzzleRuntimeReturnStage);
const returnStage = puzzleRuntimeReturnStage;
setSelectionStage(returnStage);
if (returnStage === 'puzzle-result') {
writeCreationUrlState(
buildPuzzleCreationUrlState(puzzleSession),
);
}
}}
onRemodelWork={
selectedPuzzleDetail?.publicationStatus === 'published'