From 8448913d2f5e1481c333df22f31cc7e1872ad483 Mon Sep 17 00:00:00 2001 From: kdletters Date: Sun, 26 Apr 2026 21:43:24 +0800 Subject: [PATCH] chore: clean platform entry lint --- .../PlatformEntryFlowShellImpl.tsx | 20 +++++---- ...gEntryFlowShell.agent.interaction.test.tsx | 44 +++++++++---------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx index 0d22a681..ec717465 100644 --- a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx +++ b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx @@ -61,6 +61,7 @@ import { type MiniGameDraftGenerationState, } from '../../services/miniGameDraftGenerationProgress'; import { getPlatformProfileDashboard } from '../../services/platform-entry/platformProfileClient'; +import { isSamePuzzlePublicWorkCode } from '../../services/publicWorkCode'; import { createPuzzleAgentSession, executePuzzleAgentAction, @@ -78,7 +79,6 @@ import { swapLocalPuzzlePieces, } from '../../services/puzzle-runtime/puzzleLocalRuntime'; import { deletePuzzleWork, listPuzzleWorks } from '../../services/puzzle-works'; -import { isSamePuzzlePublicWorkCode } from '../../services/publicWorkCode'; import { deleteRpgCreationAgentSession } from '../../services/rpg-creation'; import { rpgCreationPreviewAdapter } from '../../services/rpg-creation/rpgCreationPreviewAdapter'; import { @@ -87,15 +87,15 @@ import { } from '../../services/rpg-entry/rpgEntryLibraryClient'; import type { CustomWorldProfile } from '../../types'; import { useAuthUi } from '../auth/AuthUiContext'; -import { useRpgCreationAgentOperationPolling } from '../rpg-entry/useRpgCreationAgentOperationPolling'; -import { useRpgCreationEnterWorld } from '../rpg-entry/useRpgCreationEnterWorld'; -import { useRpgCreationResultAutosave } from '../rpg-entry/useRpgCreationResultAutosave'; -import { useRpgCreationSessionController } from '../rpg-entry/useRpgCreationSessionController'; import { isPuzzleGalleryEntry, mapPuzzleWorkToPlatformGalleryCard, type PlatformPublicGalleryCard, } from '../rpg-entry/rpgEntryWorldPresentation'; +import { useRpgCreationAgentOperationPolling } from '../rpg-entry/useRpgCreationAgentOperationPolling'; +import { useRpgCreationEnterWorld } from '../rpg-entry/useRpgCreationEnterWorld'; +import { useRpgCreationResultAutosave } from '../rpg-entry/useRpgCreationResultAutosave'; +import { useRpgCreationSessionController } from '../rpg-entry/useRpgCreationSessionController'; import { PlatformEntryCreationTypeModal } from './PlatformEntryCreationTypeModal'; import type { PlatformCreationTypeId } from './platformEntryCreationTypes'; import { @@ -109,8 +109,8 @@ import { } from './platformEntryShared'; import type { PlatformEntryFlowShellProps } from './platformEntryTypes'; import { PlatformEntryWorldDetailView } from './PlatformEntryWorldDetailView'; -import { usePlatformEntryBootstrap } from './usePlatformEntryBootstrap'; import { usePlatformCreationAgentFlowController } from './usePlatformCreationAgentFlowController'; +import { usePlatformEntryBootstrap } from './usePlatformEntryBootstrap'; import { usePlatformEntryLibraryDetail } from './usePlatformEntryLibraryDetail'; import { usePlatformEntryNavigation } from './usePlatformEntryNavigation'; @@ -1575,7 +1575,9 @@ export function PlatformEntryFlowShellImpl({ try { await tryOpenGalleryEntry(); return; - } catch {} + } catch { + // 作品号优先时允许继续回退到用户号搜索。 + } } if (shouldSearchUserFirst) { @@ -1583,7 +1585,9 @@ export function PlatformEntryFlowShellImpl({ const user = await getPublicAuthUserByCode(normalizedKeyword); setSearchedPublicUser(user); return; - } catch {} + } catch { + // 用户号优先时允许继续回退到作品号搜索。 + } } if (!shouldSearchWorkFirst) { diff --git a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx index fd448204..69125496 100644 --- a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx +++ b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx @@ -8,30 +8,8 @@ import { beforeEach, expect, test, vi } from 'vitest'; import type { CustomWorldAgentSessionSnapshot } from '../../../packages/shared/src/contracts/customWorldAgent'; import type { PuzzleWorkSummary } from '../../../packages/shared/src/contracts/puzzleWorkSummary'; import type { HydratedSavedGameSnapshot } from '../../persistence/runtimeSnapshotTypes'; -import { - createRpgCreationSession, - executeRpgCreationAction, - getRpgCreationOperation, - getRpgCreationSession, - listRpgCreationWorks, - streamRpgCreationMessage, - upsertRpgWorldProfile, -} from '../../services/rpg-creation'; -import type { AuthUser } from '../../services/authService'; import { ApiClientError } from '../../services/apiClient'; -import { - clearRpgProfileBrowseHistory as clearProfileBrowseHistory, - getRpgEntryWorldGalleryDetail, - getRpgProfileDashboard as getProfileDashboard, - listRpgEntryWorldGallery, - listRpgEntryWorldLibrary, - listRpgProfileBrowseHistory as listProfileBrowseHistory, - listRpgProfileSaveArchives as listProfileSaveArchives, - publishRpgEntryWorldProfile, - resumeRpgProfileSaveArchive as resumeProfileSaveArchive, - unpublishRpgEntryWorldProfile, - upsertRpgProfileBrowseHistory as upsertProfileBrowseHistory, -} from '../../services/rpg-entry'; +import type { AuthUser } from '../../services/authService'; import { createBigFishCreationSession, executeBigFishCreationAction, @@ -47,6 +25,26 @@ import { listPuzzleGallery, } from '../../services/puzzle-gallery'; import { listPuzzleWorks } from '../../services/puzzle-works'; +import { + createRpgCreationSession, + executeRpgCreationAction, + getRpgCreationOperation, + getRpgCreationSession, + listRpgCreationWorks, + streamRpgCreationMessage, + upsertRpgWorldProfile, +} from '../../services/rpg-creation'; +import { + clearRpgProfileBrowseHistory as clearProfileBrowseHistory, + getRpgEntryWorldGalleryDetail, + getRpgProfileDashboard as getProfileDashboard, + listRpgEntryWorldGallery, + listRpgEntryWorldLibrary, + listRpgProfileBrowseHistory as listProfileBrowseHistory, + listRpgProfileSaveArchives as listProfileSaveArchives, + resumeRpgProfileSaveArchive as resumeProfileSaveArchive, + upsertRpgProfileBrowseHistory as upsertProfileBrowseHistory, +} from '../../services/rpg-entry'; import { deleteRpgEntryWorldProfile, getRpgEntryWorldGalleryDetailByCode,