refactor: 收口创作恢复URL模型

This commit is contained in:
2026-06-03 20:46:39 +08:00
parent fe2f8a66e6
commit 30ead590e2
9 changed files with 569 additions and 218 deletions

View File

@@ -14,6 +14,15 @@ import {
type CreationWorkShelfRuntimeState,
resolvePuzzleWorkCoverImageSrc,
} from '../custom-world-home/creationWorkShelf';
import {
buildPuzzleResultProfileId,
buildPuzzleResultWorkId,
} from './platformPuzzleIdentityModel';
export {
buildPuzzleResultProfileId,
buildPuzzleResultWorkId,
} from './platformPuzzleIdentityModel';
export type DraftGenerationNoticeStatus = 'generating' | 'ready' | 'failed';
@@ -58,20 +67,6 @@ export type PlatformDraftGenerationVisibleShelfSources = {
babyObjectMatchItems: readonly BabyObjectMatchDraft[];
};
export function buildPuzzleResultProfileId(
sessionId: string | null | undefined,
) {
const stableSuffix = resolvePuzzleSessionStableSuffix(sessionId);
return stableSuffix ? `puzzle-profile-${stableSuffix}` : null;
}
export function buildPuzzleResultWorkId(
sessionId: string | null | undefined,
) {
const stableSuffix = resolvePuzzleSessionStableSuffix(sessionId);
return stableSuffix ? `puzzle-work-${stableSuffix}` : null;
}
export function buildDraftNoticeKey(
kind: CreationWorkShelfKind,
id: string,
@@ -825,18 +820,6 @@ export function buildPendingBarkBattleWorks(
}));
}
function resolvePuzzleSessionStableSuffix(
sessionId: string | null | undefined,
) {
const normalizedSessionId = sessionId?.trim();
if (!normalizedSessionId) {
return null;
}
return normalizedSessionId.startsWith('puzzle-session-')
? normalizedSessionId.slice('puzzle-session-'.length)
: normalizedSessionId;
}
function pickDraftCompletionDialogSourceId(
ids: Array<string | null | undefined>,
) {