From f11942f357ca0bf56fbf018446652733b3a09ca7 Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Fri, 11 Sep 2026 23:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=80=81=E8=A1=A5=E5=9B=9E?= =?UTF-8?q?=E7=A9=BA=E6=80=81=E6=8F=90=E7=A4=BA=EF=BC=9A=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=A0=8F=E7=9B=AE=E9=A1=B5=E5=90=8C=E4=B8=80=E4=B8=AA=20.game-?= =?UTF-8?q?resource-page-empty=20=E4=B8=8E=E6=96=87=E6=A1=88=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E6=96=B0=E5=A2=9E=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - index.tsx:展开态在"可见资源为 0"时渲染

没有匹配资源

,与栏目页那一条同一条判据口径与同一句文案 - 它挂在既有的画布浮层 host 下(该 host 自身不定位),因此按画本场景根居中,观感与栏目页一致,不需要任何新 CSS - 测试:空项目的「所有资源」用例补三条断言——进入展开态后标题栏是 .is-active[data-resource-book-category="all"]、卡片宿主数为 0、空态文案是「没有匹配资源」(把"复用既有空态、不新增样式"变成可执行判据) --- .../src/view/project-development/index.tsx | 11 +++++++++++ .../appSurface/project-development.suite.ts | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/apps/ai-game-creator-shell/src/view/project-development/index.tsx b/apps/ai-game-creator-shell/src/view/project-development/index.tsx index da1e22671..9a84c336a 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/index.tsx +++ b/apps/ai-game-creator-shell/src/view/project-development/index.tsx @@ -6263,6 +6263,17 @@ export default function ProjectDevelopmentView({ overlay={ resourceBookView === 'main' ? null : (
+ {/* + 展开态的空态:复用栏目页同一个类与同一句文案(不新增样式)。 + `.game-resource-page-empty` 是 `absolute + inset: 0 + place-items: center`, + 而这条 host 自身不定位,所以它会按场景根居中,和栏目页那条判定同一观感。 + */} + {resourceBookOpensAllResources && + visibleResources.length === 0 ? ( +

+ 没有匹配资源 +

+ ) : null} {selectedResourceLayer && selectedToolbarStyle && ((selectedToolbarActions?.size ?? 0) > 0 || diff --git a/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts b/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts index 671d174e9..9a30e2d27 100644 --- a/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts +++ b/apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts @@ -9771,6 +9771,23 @@ export function registerProjectAgentStatusTests() { '.game-resource-book-scene-titlebar[data-resource-book-category="all"] .game-resource-book-titlebar-meta small', )?.textContent, ).toBe('0 项'); + + // 空项目进展开态也不破版:一张卡都不挂,空态复用栏目页同一个类与同一句文案 + // (「不新增样式」这条红线的可执行判据)。 + fireEvent.click(screen.getByRole('button', { name: '打开所有资源' })); + await waitFor(() => + expect( + document.querySelector( + '.game-resource-book-scene-titlebar.is-active[data-resource-book-category="all"]', + ), + ).not.toBeNull(), + ); + expect( + document.querySelectorAll('.game-resource-book-scene-card'), + ).toHaveLength(0); + expect( + document.querySelector('.game-resource-page-empty')?.textContent, + ).toBe('没有匹配资源'); }); /**