diff --git a/apps/ai-game-creator-shell/src/features/ui-editor/bindingOverview.ts b/apps/ai-game-creator-shell/src/features/ui-editor/bindingOverview.ts index e2c7e0cae..84e6cc6ce 100644 --- a/apps/ai-game-creator-shell/src/features/ui-editor/bindingOverview.ts +++ b/apps/ai-game-creator-shell/src/features/ui-editor/bindingOverview.ts @@ -46,7 +46,13 @@ export function getImageBindingCounts( export function getTextBindingCounts( component: Extract['Text'], ): ComponentBindingCounts { - void component; + if ( + typeof component.font !== 'object' || + component.font === null || + !('Bound' in component.font) + ) { + return EMPTY_COMPONENT_BINDING_COUNTS; + } return countRequiredAssetSlot(true); } diff --git a/apps/ai-game-creator-shell/tests/bindingOverview.test.ts b/apps/ai-game-creator-shell/tests/bindingOverview.test.ts index 8fdbd1c0c..d4e564458 100644 --- a/apps/ai-game-creator-shell/tests/bindingOverview.test.ts +++ b/apps/ai-game-creator-shell/tests/bindingOverview.test.ts @@ -105,9 +105,9 @@ const trees: UITree[] = [ describe('getBindingOverview', () => { it('uses per-component helpers to include both image and text slots', () => { expect(getBindingOverview(trees, sprites)).toEqual({ - componentsNeedingAssets: 4, - assetSlots: 4, - boundSlots: 3, + componentsNeedingAssets: 3, + assetSlots: 3, + boundSlots: 2, pendingSlots: 1, needsAttention: 2, blocked: 1,