模型下拉菜单高度有界:健壮性补强,条目多时不再盖住消息
Project CI / Repository checks (pull_request) Successful in 2m36s
Project CI / Frontend tests (pull_request) Successful in 3m20s
Project CI / Backend tests (pull_request) Successful in 6m29s
Project CI / Native shell tests (pull_request) Successful in 18m34s

- 性质说明:本条是**健壮性补强**,不是用户本轮报的那几条之一;由上一提交(锚点修复)排查时顺手发现的未修观察收尾。
- 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。
This commit is contained in:
2026-09-11 14:59:42 +08:00
parent 4f3516a5d9
commit 39a96aa418
2 changed files with 22 additions and 0 deletions
@@ -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;
@@ -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({