Repository navigation
fix(dashboard): 滚动条统一改用原生细滚动条,恢复鼠标拖动 - #3098
Merged
Merged
Conversation
Dashboard 在 #app-root 内用 scrollbar-width: none 隐藏了全部原生滚动条, 改由 body 下一层只负责显示、不接收指针事件的悬浮条代替,所以页面、列表、 弹窗、抽屉里的滚动条都拖不动;会话表格为此又单独补了一条可拖的横向条。 删掉悬浮滚动条层和会话表格的局部横向条,全局沿用 style.css 顶部已有的 原生细滚动条规则(scrollbar-width: thin + 随主题变化的颜色);去掉各列表 单独写的滚动条颜色、宽度和 scrollbar-gutter,以及 design-tokens.css 里 重复的一套滚动条样式。终端 tab、终端按键条、⌘K 范围条、示例侧栏 tab 四处横向标签栏仍隐藏滚动条。设计基准里「滚动条不占布局宽度」一条同步 改写:Linux / Windows 上滚动条占约 10px,内容开始溢出时可用宽度变窄是 预期行为。 Fixes #1338
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 18:56
This was referenced Nov 7, 2026
Owner
Author
|
已合入 master(squash 落地 81d5ee2)。记录三条不阻断的后续观察,方便按需跟进:
另外建议在 Linux 真机上人工看一眼会话表格右下角(横向条与末行勾选框)和移动端顶部导航的实际观感。 |
|
🚀 Released in v3.59.0 |
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.
Fixes #1338
症状
Dashboard 的页面、列表、弹窗、抽屉里,滚动条都不能用鼠标拖动,只能靠滚轮或触控板滚。会话表格是唯一例外,它单独有一条可拖动的横向条。
根因
设计基准要求滚动条不占布局宽度,所以 Dashboard 在
#app-root里用scrollbar-width: none隐藏了全部原生滚动条,换成挂在body下、只负责显示、不接收指针事件的悬浮条(floating-scrollbars.ts)。悬浮条本身就拖不动。之后 #1987 只给会话表格补了一条可拖动的局部横向条(session-horizontal-scrollbar.tsx),其他滚动区域仍然拖不动。修法
style.css顶部已有的原生细滚动条规则(scrollbar-width: thin,颜色随浅色和深色主题变化)。scrollbar-gutter,以及design-tokens.css里重复的一套::-webkit-scrollbar样式。docs/design/dashboard-ui-baseline.md里滚动条那一条:统一使用原生细滚动条,Linux 和 Windows 上占约 10px 布局宽度。共 11 个文件,+165 / −1349。
影响
style.css。两个 PR 谁后合,谁 rebase。验证
只在 Linux 上的 Chromium 151(Playwright)验证过,macOS 和 Safari 没有测试。
test/dashboard-native-scrollbars.e2e.ts。它用 esbuild 打包真实的app.tsx,接口全部由合成数据替代,用 Playwright 关闭--hide-scrollbars后实际拖动滚动条,共 6 条用例:bun scripts/fenced-run.ts -- npx vitest run --project e2e test/dashboard-native-scrollbars.e2e.tsbun run build(包含 tsc)通过,新测试文件单独做 tsc 检查也通过。截图
以下截图都使用合成数据。每张图左边是修改前,右边是修改后,橙框标出滚动条位置。修改前截的是鼠标悬停时显示的悬浮条。
主页面
会话表格
弹窗
抽屉
会话表格从放得下变成溢出时的 10px 位移(修改后,1920×1000)