合并分享链路重构到主分支
合入通用作品分享卡片与小程序直达路径 合入推荐页当前作品系统分享参数同步 合入小程序九宫切图与相关测试 # Conflicts: # .hermes/shared-memory/decision-log.md # docs/【开发运维】本地开发验证与生产运维-2026-05-15.md # docs/【玩法创作】平台入口与玩法链路-2026-05-15.md # src/components/custom-world-home/CustomWorldCreationHub.tsx # src/components/platform-entry/PlatformEntryFlowShellImpl.test.ts # src/components/platform-entry/PlatformEntryFlowShellImpl.tsx # src/components/rpg-entry/RpgEntryHomeView.tsx
This commit is contained in:
@@ -353,6 +353,7 @@ import {
|
||||
updateVisualNovelWork,
|
||||
} from '../../services/visual-novel-works';
|
||||
import { requestGenerationResultSubscribePermission } from '../../services/wechatMiniProgramSubscribe';
|
||||
import { postWechatMiniProgramShareTarget } from '../../services/wechatMiniProgramShareTarget';
|
||||
import {
|
||||
woodenFishClient,
|
||||
type WoodenFishGalleryCardResponse,
|
||||
@@ -378,6 +379,7 @@ import {
|
||||
selectAdjacentPlatformRecommendEntry,
|
||||
} from '../rpg-entry/rpgEntryPublicGalleryViewModel';
|
||||
import {
|
||||
describePublicGalleryCardKind,
|
||||
isBigFishGalleryEntry,
|
||||
isEdutainmentGalleryEntry,
|
||||
isJumpHopGalleryEntry,
|
||||
@@ -387,6 +389,8 @@ import {
|
||||
mapPuzzleWorkToPlatformGalleryCard,
|
||||
type PlatformPublicGalleryCard,
|
||||
resolvePlatformPublicWorkCode,
|
||||
resolvePlatformWorldCoverImage,
|
||||
resolvePlatformWorldFallbackCoverImage,
|
||||
} from '../rpg-entry/rpgEntryWorldPresentation';
|
||||
import { useRpgCreationAgentOperationPolling } from '../rpg-entry/useRpgCreationAgentOperationPolling';
|
||||
import { useRpgCreationEnterWorld } from '../rpg-entry/useRpgCreationEnterWorld';
|
||||
@@ -844,6 +848,25 @@ function resolveRecommendEntryShareStage(
|
||||
return 'work-detail';
|
||||
}
|
||||
|
||||
function postRecommendEntryMiniProgramShareTarget(
|
||||
entry: PlatformPublicGalleryCard | null | undefined,
|
||||
) {
|
||||
if (!entry) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const publicWorkCode = resolvePlatformPublicWorkCode(entry)?.trim();
|
||||
if (!publicWorkCode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return postWechatMiniProgramShareTarget({
|
||||
targetPath: '/works/detail',
|
||||
work: publicWorkCode,
|
||||
title: entry.worldName,
|
||||
});
|
||||
}
|
||||
|
||||
function pushPuzzleResultHistoryEntry(
|
||||
session: PuzzleAgentSessionSnapshot | null,
|
||||
) {
|
||||
@@ -2858,10 +2881,14 @@ export function PlatformEntryFlowShellImpl({
|
||||
return;
|
||||
}
|
||||
|
||||
postRecommendEntryMiniProgramShareTarget(entry);
|
||||
openPublishShareModal({
|
||||
title: entry.worldName,
|
||||
publicWorkCode,
|
||||
stage: resolveRecommendEntryShareStage(entry),
|
||||
workTypeLabel: describePublicGalleryCardKind(entry),
|
||||
coverImageSrc: resolvePlatformWorldCoverImage(entry),
|
||||
fallbackCoverImageSrc: resolvePlatformWorldFallbackCoverImage(entry),
|
||||
});
|
||||
},
|
||||
[openPublishShareModal],
|
||||
@@ -13455,6 +13482,22 @@ export function PlatformEntryFlowShellImpl({
|
||||
puzzleRun?.currentLevel?.profileId ?? null,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
selectionStage !== 'platform' ||
|
||||
platformBootstrap.platformTab !== 'home' ||
|
||||
!activeRecommendEntry
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
postRecommendEntryMiniProgramShareTarget(activeRecommendEntry);
|
||||
}, [
|
||||
activeRecommendEntry,
|
||||
platformBootstrap.platformTab,
|
||||
selectionStage,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
const decision = resolvePlatformRecommendRuntimeAutoStartDecision({
|
||||
isDesktopLayout,
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import type {
|
||||
MiniGameDraftGenerationKind,
|
||||
MiniGameDraftGenerationState,
|
||||
} from '../../services/miniGameDraftGenerationProgress';
|
||||
import type { SelectionStage } from './platformEntryTypes';
|
||||
|
||||
type MiniGameGenerationProgressTickStateMap = Partial<
|
||||
Record<MiniGameDraftGenerationKind, MiniGameDraftGenerationState | null>
|
||||
>;
|
||||
|
||||
export function resolveMiniGameGenerationProgressTickState(
|
||||
selectionStage: SelectionStage,
|
||||
states: MiniGameGenerationProgressTickStateMap,
|
||||
) {
|
||||
const stageKindMap: Partial<
|
||||
Record<SelectionStage, MiniGameDraftGenerationKind>
|
||||
> = {
|
||||
'puzzle-generating': 'puzzle',
|
||||
'big-fish-generating': 'big-fish',
|
||||
'square-hole-generating': 'square-hole',
|
||||
'match3d-generating': 'match3d',
|
||||
'baby-object-match-generating': 'baby-object-match',
|
||||
'jump-hop-generating': 'jump-hop',
|
||||
'puzzle-clear-generating': 'puzzle-clear',
|
||||
'wooden-fish-generating': 'wooden-fish',
|
||||
};
|
||||
const kind = stageKindMap[selectionStage];
|
||||
|
||||
return kind ? (states[kind] ?? null) : null;
|
||||
}
|
||||
Reference in New Issue
Block a user