diff --git a/apps/ai-game-creator-shell/src/styles.css b/apps/ai-game-creator-shell/src/styles.css index 96fca92e0..756394e86 100644 --- a/apps/ai-game-creator-shell/src/styles.css +++ b/apps/ai-game-creator-shell/src/styles.css @@ -9607,6 +9607,12 @@ iframe.preview-frame { display: grid; min-width: 150px; max-width: 190px; + /* 条目多时菜单不能无限长:240px 与视口 40vh 取小者,超出部分在菜单内滚动 + (窄屏 / 移动端优先下 40vh 更稳)。滚动不外溢给背后的消息列表,与 + `.resource-reference-menu` 同一口径。 */ + max-height: min(240px, 40vh); + overflow: auto; + overscroll-behavior: contain; padding: 5px; border: 1px solid var(--platform-surface-border, #e5e7eb); border-radius: 10px; 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 5eac03e00..d8477f256 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 @@ -5823,6 +5823,22 @@ export function registerProjectSupervisorSurfaceTests() { expect(controlsButtons).toMatch(/flex:\s*0 0 30px/u); }); + it('bounds the model dropdown height so a long catalog cannot cover the composer', () => { + const styles = readFileSync( + resolve(process.cwd(), 'apps/ai-game-creator-shell/src/styles.css'), + 'utf8', + ); + const menu = styleRuleBody(styles, '\\.conversation-model-menu'); + // 条目多时菜单不能无限长:240px 与视口 40vh 取小者,超出部分在菜单内滚动 + // (窄屏 / 移动端优先下 40vh 更稳)。高度有界不改锚点与流式归属,见上一条用例。 + expect(menu).toMatch(/max-height:\s*min\(\s*240px\s*,\s*40vh\s*\)/u); + expect(menu).toMatch(/overflow:\s*auto/u); + // 菜单内滚动不传染给背后的消息列表,与 `.resource-reference-menu` 同一口径。 + expect(menu).toMatch(/overscroll-behavior:\s*contain/u); + // 依旧不参与父容器流式布局。 + expect(menu).toMatch(/position:\s*absolute/u); + }); + it('runs a top workbench play request without a second confirmation', async () => { const projectPath = '/tmp/top-play-request'; const supervisorHarness = createProjectSupervisorRuntimeHarness({