From 39a96aa4182489030da1c825badbccb2f86f8d8f Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Fri, 11 Sep 2026 14:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=8B=E6=8B=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=AB=98=E5=BA=A6=E6=9C=89=E7=95=8C=EF=BC=9A=E5=81=A5?= =?UTF-8?q?=E5=A3=AE=E6=80=A7=E8=A1=A5=E5=BC=BA=EF=BC=8C=E6=9D=A1=E7=9B=AE?= =?UTF-8?q?=E5=A4=9A=E6=97=B6=E4=B8=8D=E5=86=8D=E7=9B=96=E4=BD=8F=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 性质说明:本条是**健壮性补强**,不是用户本轮报的那几条之一;由上一提交(锚点修复)排查时顺手发现的未修观察收尾。 - styles.css:`.conversation-model-menu` 补 `max-height: min(240px, 40vh)` + `overflow: auto` + `overscroll-behavior: contain`。菜单此前没有高度上限,模型条目很多时会长到 composer 顶边以上、盖住消息;240px 与视口 40vh 取小者,矮窗 / 窄屏(移动端优先)更稳。`overscroll-behavior: contain` 与既有 `.resource-reference-menu` 同一口径,菜单内滚动不传染给背后的消息列表。不新增视觉:border / radius / padding 与 token 全部沿用原值。 - 语义零改动:锚点与流式归属不变(`position: absolute; right: 0; bottom: calc(100% + 8px)` 未动),打开 / 选择 / 刷新模型列表的交互不变。 - project-development.suite.ts:新增声明级守卫「bounds the model dropdown height so a long catalog cannot cover the composer」——菜单规则必须同时声明 `max-height: min(240px, 40vh)`、`overflow: auto`、`overscroll-behavior: contain`,并仍是 `position: absolute`(高度有界不改锚点)。 - 变异验证(已实测):把 `max-height` 摘掉 → 用例红灯(expected '…' to match /max-height:\s*min\(\s*240px\s*,\s*40vh\s*\)/u)。 - 门禁:typecheck exit 0;AGC 子集 1206 passed / 4 skipped / 0 failed(基线 1205 + 本次新增 1 条);src/components/image-editor 1385 passed;check:encoding 4379 文件通过;`git diff --check` 全量与本次两个文件范围均 exit 0。 --- apps/ai-game-creator-shell/src/styles.css | 6 ++++++ .../appSurface/project-development.suite.ts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) 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({