Add platform generation dialogs and task refresh

This commit is contained in:
kdletters
2026-05-26 19:40:23 +08:00
parent abea7cec1d
commit 4001ee0a5c
4 changed files with 58 additions and 10 deletions

View File

@@ -3404,6 +3404,7 @@ export function PlatformEntryFlowShellImpl({
})
| null
>(null);
const [profileTaskRefreshKey, setProfileTaskRefreshKey] = useState(0);
const [initialCreationUrlState] = useState(() => readCreationUrlState());
const handledInitialCreationUrlStateRef = useRef(false);
const [initialPuzzleRuntimeUrlState] = useState(() =>
@@ -3549,15 +3550,14 @@ export function PlatformEntryFlowShellImpl({
'ready',
viewedImmediately,
);
if (!viewedImmediately) {
const completedAtMs = Date.now();
setPendingPlatformTaskCompletionDialog({
key: `${kind}:${collectDraftNoticeKeys(kind, ids).join('|')}:${completedAtMs}`,
source: buildDraftCompletionDialogSource(kind, ids),
message: '生成任务已完成,可以继续查看草稿。',
completedAtMs,
});
}
setProfileTaskRefreshKey((current) => current + 1);
const completedAtMs = Date.now();
setPendingPlatformTaskCompletionDialog({
key: `${kind}:${collectDraftNoticeKeys(kind, ids).join('|')}:${completedAtMs}`,
source: buildDraftCompletionDialogSource(kind, ids),
message: '生成任务已完成,可以继续查看草稿。',
completedAtMs,
});
},
[setPendingPlatformTaskCompletionDialog, updateDraftGenerationNotices],
);
@@ -14755,6 +14755,7 @@ export function PlatformEntryFlowShellImpl({
isLoadingPlatform={platformBootstrap.isLoadingPlatform}
isLoadingDashboard={platformBootstrap.isLoadingDashboard}
hasUnreadDraftUpdate={hasUnreadDraftUpdates}
profileTaskRefreshKey={profileTaskRefreshKey}
isDesktopLayout={isDesktopLayout}
isResumingSaveWorldKey={platformBootstrap.isResumingSaveWorldKey}
platformError={