diff --git a/apps/ai-game-creator-shell/src/styles.css b/apps/ai-game-creator-shell/src/styles.css index 05f24f2c9..af78f75d4 100644 --- a/apps/ai-game-creator-shell/src/styles.css +++ b/apps/ai-game-creator-shell/src/styles.css @@ -12861,7 +12861,13 @@ button.design-workspace-tree__entry:hover, right: 0; bottom: 0; left: 0; - z-index: 240; + /* + * 必须低于二级浮层:这里点「运行配置」打开的是既有 `.settings-overlay` + * (z-index 220),插件面板 `.agc-plugin-panel-overlay` 为 230。 + * 设置浮层若压在最上层,二级弹窗就会盖在它下面;210 仍高于工作台内容 + * 与启动器(200),同时让运行配置 / 插件面板正常叠在其上。 + */ + z-index: 210; display: grid; padding: 20px; background: rgb(65 43 34 / 42%); diff --git a/apps/ai-game-creator-shell/tests/windowChromeOverlayContract.test.ts b/apps/ai-game-creator-shell/tests/windowChromeOverlayContract.test.ts index b9bbb16d9..2369c472c 100644 --- a/apps/ai-game-creator-shell/tests/windowChromeOverlayContract.test.ts +++ b/apps/ai-game-creator-shell/tests/windowChromeOverlayContract.test.ts @@ -50,4 +50,19 @@ describe('窗口标题栏与全屏弹层的层叠约定', () => { `${selector} 必须声明 top: var(--window-chrome-height)`, ).toBe('var(--window-chrome-height)'); }); + + it('从「对话设置」打开的二级弹窗叠在设置浮层之上', () => { + const zIndexOf = (selector: string) => { + const raw = declarationsForSelector(css, selector).get('z-index'); + expect(raw, `${selector} 必须声明 z-index`).toBeDefined(); + return Number(raw); + }; + const settingsZIndex = zIndexOf('.project-chat-settings-backdrop'); + const runtimeConfigZIndex = zIndexOf('.settings-overlay'); + const pluginPanelZIndex = zIndexOf('.agc-plugin-panel-overlay'); + // 对话设置里点「运行配置」会就地打开 `.settings-overlay`,插件面板又从 + // 运行配置里打开;三层必须严格递增,否则后开的会盖在上一层下面。 + expect(runtimeConfigZIndex).toBeGreaterThan(settingsZIndex); + expect(pluginPanelZIndex).toBeGreaterThan(runtimeConfigZIndex); + }); });