fix(desktop): prevent model list option overlap when provider has many models / 修复供应商模型较多时设置页面模型列表选项重叠 - #6539
Conversation
…y models Removes the undersized min-height (32px) from .provider-model-draft__option that was smaller than the actual minimum content height (~46px), causing option cards to visually overlap when model names wrapped to multiple lines. Adds overflow: hidden to prevent content bleeding, grid-auto-rows: min-content to size each grid row to its tallest card, and bottom padding to prevent the last row from touching the container edge. Closes esengine#5563, esengine#5585, esengine#5785, esengine#6480
6b7558d to
1469959
Compare
|
Rebased on the latest I've verified that the three CSS changes remain fully compatible with the new context window input row:
The diff against 已 rebase 至最新的 已验证三处 CSS 改动与新加的 context 输入行完全兼容:
与 |
手动构建验证修复前
修复后
After rebasing onto the latest The three CSS changes in this PR (removing I've built both versions (before and after) from the latest 在 rebase 到最新的 本 PR 的三处 CSS 改动(删除 我已基于最新 |
Context: PR esengine#6539 fixes provider model card overlap by correcting implicit grid row sizing and removing the undersized card minimum. Coverage: Assert that model rows stay content-sized, option cards keep no explicit minimum height, and unexpected overflow remains contained. Verification: typography-overflow-contract.test.ts passed with 127 tests; CSS syntax and z-index checks passed; git diff --check passed. Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>
SivanCola
left a comment
There was a problem hiding this comment.
Approved. This is a well-scoped CSS fix. The PR correctly prevents provider model cards from collapsing under a constrained model list by sizing implicit grid rows to their content, removing the undersized card minimum, and containing unexpected overflow.
Why this fits the desktop architecture:
- The shared selectors cover both the Refresh Models draft picker and the inline provider editor.
- The change is CSS-only and does not affect provider requests, prompt-cache behavior, persistence, or security boundaries.
The original checks passed but did not explicitly guard the changed CSS contract. I added test commit d2b69e2 with focused assertions for content-sized rows, absence of the 32px card minimum, and overflow containment.
Verified:
- npx tsx src/tests/typography-overflow-contract.test.ts — 127 passed
- node scripts/check-css-syntax.mjs src/styles.css — passed
- node scripts/check-z-index-tokens.mjs src/styles.css — passed
- git diff --check — passed
- Browser layout check confirmed the constrained cards grow to fit their controls and context-window inputs remain clickable.



Fixes #5563. Fixes #5585. Fixes #5785. Fixes #6480. Fixes #6723.
Summary
Fixes model list option overlap in the desktop settings when a provider (e.g., SiliconFlow, Volcengine) returns many models — the CSS grid container for model candidates had an undersized
min-heightper option card and no overflow protection, causing option cards to visually overlap, especially when model names wrapped to multiple lines.Root cause
.provider-model-draft__optionhadmin-height: 32px, which is smaller than the actual minimum content height (~46px: checkbox + model name + 4px gap + vision checkbox row + 10px padding). The grid container.provider-model-draft__listusedmax-height: 220pxwithoverflow: auto, so with many models the tightly packed rows allowed content to bleed into adjacent cards. Long model names that wrapped to 2+ lines made the overlap worse since the card height grew beyond 32px but had no explicit clipping boundary — the vision checkbox could be partially or fully covered by the next card.This affected four independent user reports across different providers (SiliconFlow, Volcengine, and others), all with the same underlying cause. A previous attempt ( #5943 only increasing
max-heightfrom 220px to 280px and adding bottom padding) merely reduced the probability of truncation without fixing the real issue — the cards could still overflow their boundaries.Changes
1 file changed:
desktop/frontend/src/styles.css(+3, −2).provider-model-draft__list:padding-right: 2px→padding: 0 2px 6px 0— bottom padding prevents the last grid row from touching the container edgegrid-auto-rows: min-content— each grid row sizes to the tallest option card in that row, preventing vertical overlap between rows regardless of how many lines a model name wraps to.provider-model-draft__option:min-height: 32px— content now determines height naturally via flexbox; the card can no longer be shorter than its actual contentoverflow: hidden— prevents text or checkbox content from bleeding into adjacent cards; long model names are handled by the existingoverflow-wrap: anywhereon the innerspanScope
These CSS classes are shared by both
ProviderModelDraftPicker(the "Refresh Models" draft panel shown after clicking "Refresh Models" in the provider access page) andProviderEditorModelPicker(the inline model picker insideProviderEditor), so both views benefit from the fix without any JSX changes.Closes
Verification
cd desktop/frontend && npx tsx src/__tests__/typography-overflow-contract.test.ts— 103 passed, 0 failedcd desktop/frontend && npx tsx src/__tests__/provider-model-refresh.test.ts— 18 passed, 0 failedgofmt -l .— no changes (no Go files touched)cd desktop && wails build— build succeeds, binary produced atdesktop/build/bin/reasonix-desktop.exeREASONIX_HOMEisolation — no runtime errors, settings UI renders correctlyCache impact
Cache-impact: none — CSS-only change in the desktop frontend stylesheet; no change to provider-visible system prompt, memory prefix, tool schemas, tool ordering, request serialization, compaction, or MCP/tool registration.
Cache-guard: N/A — purely visual CSS change with no cache implications.
System-prompt-review: N/A — no system-prompt-sensitive files changed.
摘要
修复桌面端设置页面中模型列表选项重叠的问题。当供应商(如硅基流动、火山引擎等)返回大量模型时,模型候选列表的 CSS 网格容器中每个选项卡片的
min-height设置过小且缺乏溢出保护,导致卡片之间视觉重叠——尤其是模型名换行时,vision 复选框会被相邻卡片部分或完全遮盖。根因
.provider-model-draft__option设置了min-height: 32px,但实际内容的物理最小高度约为 46px(复选框 + 模型名 + 4px 间距 + vision 复选框行 + 10px 内边距)。.provider-model-draft__list使用max-height: 220px配合overflow: auto,当模型数量较多时,紧凑排列的行之间内容会溢出到相邻卡片。模型名较长换至 2 行以上时,卡片高度超出 32px 但没有显式的裁剪边界——vision 复选框可能被下一个卡片完全遮盖导致点击不到。此问题有四位用户分别独立报告,涉及不同供应商(硅基流动、火山引擎等),根因完全相同。之前的一种方案( #5943 仅将
max-height从 220px 增至 280px 并加底部内边距)只能降低截断概率,没有解决根本问题——卡片内容仍会溢出边界。改动
1 个文件:
desktop/frontend/src/styles.css(+3 行,−2 行).provider-model-draft__list:padding-right: 2px→padding: 0 2px 6px 0— 底部内边距防止最后一行的卡片紧贴容器边缘grid-auto-rows: min-content— 每行高度自适应该行最高卡片,无论模型名换多少行都不会导致行间垂直重叠.provider-model-draft__option:min-height: 32px— 卡片高度由实际内容通过 flexbox 自然决定,卡片不会再比内容矮overflow: hidden— 防止文字或复选框溢出到相邻卡片;长模型名由已有的overflow-wrap: anywhere处理影响范围
这些 CSS 类被
ProviderModelDraftPicker(接入页面点击"刷新模型"后的候选面板)和ProviderEditorModelPicker(ProviderEditor 表单内的内联模型选择器)共用,因此两处均受益于此修复,无需改动任何 JSX。关闭 Issues
验证
cd desktop/frontend && npx tsx src/__tests__/typography-overflow-contract.test.ts— 103 通过,0 失败cd desktop/frontend && npx tsx src/__tests__/provider-model-refresh.test.ts— 18 通过,0 失败gofmt -l .— 无更改(未触碰 Go 文件)cd desktop && wails build— 构建成功,产物生成于desktop/build/bin/reasonix-desktop.exeREASONIX_HOME隔离环境启动 — 无运行时错误,设置页面 UI 正常渲染缓存影响
Cache-impact: none — 仅桌面端前端样式表的 CSS 改动;不影响 provider 可见的系统 prompt、memory 前缀、工具 schema、工具排序、请求序列化、压缩或 MCP/工具注册。
Cache-guard: N/A — 纯视觉 CSS 改动,无缓存影响。
System-prompt-review: N/A — 未改动系统 prompt 敏感文件。
效果展示