Repository navigation
fix(dashboard): Bot 配置名册搜索后行高不再被拉伸 - #1158
Merged
Merged
Conversation
搜索把 56 个机器人过滤到两三个时,左侧名册的行会被拉成几百像素高: 选中项渲染成一整块色带,最后一行沉到面板底部。 根因是桌面 fill-height 壳把整列剩余高度交给了 .bd-roster-list 这一行, 而 grid 默认 align-content:normal(=stretch) 会把这段余量平摊给每个自动行。 实测 1440x900 下 56 → 2 条结果时,行高从 54.4px 被撑到 348px;即使 12 条 结果也仍被拉到 55.5px,只是差得不明显。改成 align-content:start 后行保持 内容高度,余量留白,与同为 fill-height 页的 .schedules-list 写法一致。 影响面:只加一条属性到 .bot-defaults-page .bd-roster-list(桌面 ≥981px 规则), 未改 DOM、未改 980px 以下的移动端分支(移动端列表本就按内容高度排,实测 2 条 / 20 条结果的行高在改动前后均为 54.4px,无变化)。名册组件只在 Bot 配置页使用,其它页面不受影响。 验证(Chromium 无头 + 仓库真实 style.css,1440x900): - 修复前 n=2:行高 348px(复现用户截图);修复后 54.4px - 修复后 n=12:54.4px;n=56:54.4px 且 scrollHeight 3212 > 视口 699,滚动仍在 - 移动端 500x900:n=2 / n=20 改动前后均为 54.4px - 新增回归用例做过反变异:删掉 align-content:start 后恰好 1 条用例转红, 恢复后 14/14 绿 - bun run build 通过;98 个 dashboard 测试文件 1827 passed / 1 skipped Co-Authored-By: Claude Code <[email protected]>
This was referenced Sep 1, 2026
|
🚀 Released in v3.18.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Bot 配置页左侧名册,搜索把 56 个机器人过滤到只剩两三个时,行会被拉成几百像素高——选中项渲染成一整块色带,最后一行沉到面板底部。
根因
桌面 fill-height 壳(
main:has(.bot-defaults-page),≥981px)把整列剩余高度交给.bd-roster-list这一行,而 grid 默认align-content: normal(等同stretch)会把这段余量平摊给每个自动行。结果是行高与结果条数成反比:
条数越少摊到的余量越多,所以只有搜索后条数很少时才明显;12 条时其实也被拉了 1px,只是肉眼看不出来。
改法
.bot-defaults-page .bd-roster-list加一条align-content: start,让行保持内容高度、余量留白。与同为 fill-height 页的.schedules-list(style.css:14105)已有写法一致。影响面
.bot-defaults-page .bd-roster-list(桌面 ≥981px 规则),未改 DOM.bd-roster名册组件只在 Bot 配置页使用(grep过src/dashboard/web/,无其它引用),其它页面 / 会话类型不受影响验证
Chromium 无头 + 仓库真实
style.css(不是手写简化样式),复刻页面 DOM 结构,1440x900:scrollHeight3212 > 视口 699,滚动仍正常(没把滚动改没)新增回归用例并做了反变异(证明它有牙,而不是恒绿):
align-content: start→ 恰好 1 条用例转红(正是新增那条),其余 13 条不受影响其它:
bun run build通过🤖 Generated with Claude Code