From c39049b7ba2c2546062d80598ba3a444d139f74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 18 Aug 2026 16:34:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AD=97=E4=BD=93=E7=B4=A0?= =?UTF-8?q?=E6=9D=90=E6=A7=BD=E7=BB=9F=E8=AE=A1=E8=AF=AD=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅将 Bound 字体计入素材槽并视为已绑定 SystemFont 不再计入素材槽、待绑定或组件素材需求 同步 binding overview 回归测试 --- .../src/features/ui-editor/bindingOverview.ts | 8 +++++++- apps/ai-game-creator-shell/tests/bindingOverview.test.ts | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) 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,