|
242 | 242 | sourceBindingState: "invalid" |
243 | 243 | }); |
244 | 244 | this.updateRepoRuntimeBinding(invalidBinding); |
245 | | - this.applyContextResult({ |
| 245 | + await this.applyContextResult({ |
246 | 246 | assetCount: metrics.assetCount, |
247 | 247 | context: restoredToolState.context, |
248 | 248 | game: restoredToolState.game, |
|
261 | 261 | sourceBindingState: "bound" |
262 | 262 | }); |
263 | 263 | this.updateRepoRuntimeBinding(reboundBinding); |
264 | | - this.applyContextResult({ |
| 264 | + await this.applyContextResult({ |
265 | 265 | assetCount: metrics.assetCount, |
266 | 266 | context: restoredToolState.context, |
267 | 267 | game: sourceBinding.game, |
|
319 | 319 | return; |
320 | 320 | } |
321 | 321 |
|
322 | | - this.applyContextResult(result); |
| 322 | + await this.applyContextResult(result); |
323 | 323 | if (result.assetWarning) { |
324 | 324 | this.statusLog.info(`Warning: ${result.assetWarning}`); |
325 | 325 | } |
|
432 | 432 | this.repoDestination.setRepoDestinationDisplayName(repoReferenceResult.reference.displayName); |
433 | 433 | this.gameSelector.setValue(restoredResult.game.id, restoredResult.game.name); |
434 | 434 | const requiresRepoHandle = !this.activeRepoHandle; |
435 | | - this.applyContextResult(restoredResult, { requiresRepoHandle }); |
| 435 | + await this.applyContextResult(restoredResult, { requiresRepoHandle }); |
436 | 436 | if (restoredResult.assetWarning) { |
437 | 437 | this.statusLog.info(`Warning: ${restoredResult.assetWarning}`); |
438 | 438 | } |
|
465 | 465 | this.statusLog.ok(`Restored ${restoredResult.game.name} workspace from session context ${restoredResult.hostContextId}.`); |
466 | 466 | } |
467 | 467 |
|
468 | | - applyContextResult(result, { requiresRepoHandle = false } = {}) { |
| 468 | + async applyContextResult(result, { requiresRepoHandle = false } = {}) { |
469 | 469 | const tools = this.contextService.workspaceLaunchableTools(); |
470 | 470 | const runtimeBinding = this.runtimeBindingMetadata({ |
471 | 471 | bindingSource: requiresRepoHandle |
|
500 | 500 | const textToSpeechCount = Number.isInteger(textToSpeechSummary.speechQueueCount) |
501 | 501 | ? textToSpeechSummary.speechQueueCount |
502 | 502 | : 0; |
| 503 | + const previewStatus = await this.contextService.previewAssetStatusForGame({ |
| 504 | + game: result.game, |
| 505 | + repoHandle: requiresRepoHandle ? null : this.activeRepoHandle |
| 506 | + }); |
503 | 507 | this.activeContext = sessionRefresh.context; |
504 | 508 | this.activeGame = result.game; |
505 | 509 | this.activeHostContextId = result.hostContextId || null; |
|
522 | 526 | enabledToolIds: hydration.ok ? hydration.hydratedToolIds : [], |
523 | 527 | manifestStatus: this.activeToolStateRequiresRepoHandle ? "Repo folder required" : "Schema-valid manifest", |
524 | 528 | paletteSwatchCount, |
| 529 | + previewStatus: previewStatus.status, |
525 | 530 | textToSpeechCount |
526 | 531 | }); |
527 | 532 | this.syncLifecycleControls(); |
|
591 | 596 | } |
592 | 597 | } |
593 | 598 | const metrics = this.contextSummaryMetrics(this.activeContext); |
594 | | - this.applyContextResult({ |
| 599 | + await this.applyContextResult({ |
595 | 600 | assetCount: metrics.assetCount, |
596 | 601 | context: this.activeContext, |
597 | 602 | game, |
|
721 | 726 | this.updateRepoRuntimeBinding(reboundBinding); |
722 | 727 | this.statusLog.info(`Save source rebound to ${sourceBinding.source} for ${result.game.id}.`); |
723 | 728 | this.statusLog.ok(`Runtime handle rebound: ${this.runtimeBindingDetails(reboundBinding)}.`); |
724 | | - this.applyContextResult({ ...result, game: sourceBinding.game }); |
| 729 | + await this.applyContextResult({ ...result, game: sourceBinding.game }); |
725 | 730 | if (result.assetWarning) { |
726 | 731 | this.statusLog.info(`Warning: ${result.assetWarning}`); |
727 | 732 | } |
|
736 | 741 | return { ok: false, message: refreshedValidation.message }; |
737 | 742 | } |
738 | 743 | const metrics = this.contextSummaryMetrics(sessionRefresh.context); |
739 | | - this.applyContextResult({ |
| 744 | + await this.applyContextResult({ |
740 | 745 | assetCount: metrics.assetCount, |
741 | 746 | context: sessionRefresh.context, |
742 | 747 | game: this.activeGame, |
|
829 | 834 | return; |
830 | 835 | } |
831 | 836 | const metrics = this.contextSummaryMetrics(context); |
832 | | - this.applyContextResult({ |
| 837 | + await this.applyContextResult({ |
833 | 838 | assetCount: metrics.assetCount, |
834 | 839 | context, |
835 | 840 | game: this.activeGame, |
|
957 | 962 | } |
958 | 963 | const hostContextId = this.contextService.persistContext(result.context); |
959 | 964 | this.gameSelector.setValue(result.game.id, result.game.name); |
960 | | - this.applyContextResult({ ...result, hostContextId }); |
| 965 | + await this.applyContextResult({ ...result, hostContextId }); |
961 | 966 | if (result.assetWarning) { |
962 | 967 | this.statusLog.info(`Warning: ${result.assetWarning}`); |
963 | 968 | } |
|
0 commit comments