fix: 收窄创作入口关闭熔断范围

This commit is contained in:
2026-06-03 20:45:27 +08:00
parent 01a68bcf3d
commit deadce9cf1
9 changed files with 267 additions and 81 deletions

View File

@@ -1,4 +1,4 @@
import { ArrowRight } from 'lucide-react';
import { ArrowRight, LockKeyhole } from 'lucide-react';
import type { CreationEntryConfig } from '../../services/creationEntryConfigService';
import { UnifiedModal } from '../common/UnifiedModal';
@@ -33,6 +33,7 @@ function CreationTypeCard(props: {
}) {
const { item, busy, onSelect } = props;
const disabled = item.locked || busy;
const lockedBadge = item.badge.trim() || '暂未开放';
return (
<button
@@ -60,12 +61,15 @@ function CreationTypeCard(props: {
/>
<div className="relative z-10 flex min-h-6 items-start justify-end gap-3 px-4 pt-4">
{item.locked ? (
<span className="platform-pill platform-pill--neutral px-3 text-[var(--platform-text-soft)]">
{item.badge}
<span className="platform-pill platform-pill--neutral gap-1 px-3 text-[var(--platform-text-soft)]">
<LockKeyhole className="h-3.5 w-3.5" />
{lockedBadge}
</span>
) : null}
{item.locked ? (
<span className="text-lg leading-none text-white/62">·</span>
<span className="inline-flex h-7 w-7 items-center justify-center rounded-full bg-white/18 text-white/72">
<LockKeyhole className="h-3.5 w-3.5" />
</span>
) : (
<ArrowRight className="h-4 w-4 text-white/80" />
)}
@@ -169,7 +173,6 @@ export function PlatformEntryCreationTypeModal({
/>
))}
</div>
</UnifiedModal>
);
}

View File

@@ -2150,6 +2150,19 @@ function normalizePlatformErrorMessage(message: string | null | undefined) {
return normalized ? normalized : null;
}
/** 首页公开数据降级时,入口关闭错误不弹窗;真实创作动作仍由对应工作台提示。 */
function isCreationEntryDisabledErrorMessage(
message: string | null | undefined,
) {
const normalized = normalizePlatformErrorMessage(message);
return Boolean(
normalized &&
(normalized.includes('creation_entry_disabled') ||
normalized.includes('该玩法入口暂不可用') ||
normalized.includes('创作入口已关闭')),
);
}
function formatPlatformErrorSource(label: string, id?: string | null) {
const normalizedId = id?.trim();
return normalizedId ? `${label} ${normalizedId}` : label;
@@ -6747,6 +6760,11 @@ export function PlatformEntryFlowShellImpl({
isMiniGameDraftGenerating(
activePuzzleBackgroundCompileTask?.generationState ?? null,
);
const platformBootstrapErrorForDisplay = isCreationEntryDisabledErrorMessage(
platformBootstrap.platformError,
)
? null
: platformBootstrap.platformError;
const [dismissedPlatformErrorDialogKey, setDismissedPlatformErrorDialogKey] =
useState<string | null>(null);
const [
@@ -6774,7 +6792,7 @@ export function PlatformEntryFlowShellImpl({
{
key: 'platform-bootstrap',
source: '平台首页',
message: platformBootstrap.platformError,
message: platformBootstrapErrorForDisplay,
},
{
key: 'rpg-creation-type',
@@ -6954,7 +6972,7 @@ export function PlatformEntryFlowShellImpl({
match3dRun?.runId,
match3dSession?.sessionId,
pendingPlatformTaskFailureDialog,
platformBootstrap.platformError,
platformBootstrapErrorForDisplay,
publicWorkDetailError,
puzzleCreationError,
puzzleError,
@@ -16352,7 +16370,7 @@ export function PlatformEntryFlowShellImpl({
platformError={
platformBootstrap.isLoadingPlatform
? null
: (platformBootstrap.platformError ??
: (platformBootstrapErrorForDisplay ??
sessionController.agentWorkspaceRestoreError)
}
dashboardError={