Repository navigation
[PR] feat(web): resizable session-table columns (whole-side cascade, outer edges fixed) - #4827
yanhuojiyusheng wants to merge 1 commit into
Conversation
|
(ai: opencode/vllm-qwen/qwen3.8-27b) 独立审核完成(方向 / 回归 / 代码 / 测试有效性 / diff 整洁度五关全过)。head 发现两处小问题(合计两行内可修)。本 PR 分支在 fork 上且关闭了 maintainer edits,我推不进去——请自行应用,或重新开启 "Allow edits by maintainers" 我来推: 1. 省略号规则缺 基础规则里
修法(一行): .twide .columns-resized th, .twide .columns-resized td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }标题列已确认不受影响: 2. 空 catch 的未用变量(src/web/client.ts
CI 状态: 结论:应用上面第 1 条一行 CSS(+第 2 条可选改名)后本 PR 可合入;合并由 owner 执行。 |
(ai: vllm-qwen/qwen3.8-27b) **查重: 不重复。**按「列宽 / resizable / column width」检索 open+closed issue 与 PR:无其他同需求条目;相关历史条目机制均不同——#4363/#4362(会话事件/折叠明细表对齐)、#2450/#2448(dsh embed 窄屏适配)、#3566(会话过滤/分页)。本 PR 是原 issue #4826 的唯一实现。 标签: pr + scope/ui + p3(bili 自身 Web 面板的功能增强,UX 打磨级,非缺陷) Review 结论代码质量达标,可合。合入前还差两步:① 作者把 master 同步进分支(消继承红,见下);② 新 head 上 CI 绿。 结构化八问
测试有效性新单测有牙:从 WEB_CLIENT 源码里按标记提取真实的 CI 现状与需要作者操作的一步
已知边界(作者已自述,v1 可接受,不阻塞)列宽不持久化、无双击复位;最小宽度按列序硬编码(增删列会静默错位);把手占表头最右 8px,窄列压字;单测 mock 只铺 3 列,13 列与隐藏列交互目前靠 CDP 实测。后续若要持久化/复位,建议另开 issue 跟踪。 判定: 可合 —— 等作者同步 master 后,我在新 head 上核对 CI 结果并回报收口。 |
(ai: opencode/vllm-qwen/qwen3.8-27b) lock-sync 红 = 继承性失败(master 自身同款红);修复已备好并本地验证通过,卡在 fork 写权限——需要你跑一条命令或开启 maintainer edits。 结构化结论:
卡点:分支在你的 fork 上,且 PR 关闭了 "Allow edits by maintainers"——我们的账号对你的 fork 没有写权限(实测
转绿后等全量 CI 即可;其余车道目前全绿或正常 skip。按政策未为此新开 issue(继承性失败收敛在 master/ci-fixes 侧)。 |
(ai: opencode/vllm-qwen/qwen3.8-27b) 状态未变,补一行确认(详情见本线程前两条回复):PR head 仍是 仍只差你一步,二选一:
转绿后等全量 CI 即可收口。 |
(ai: opencode/vllm-qwen/qwen3.8-27b) 我的审核已完成并收口(完整八问见本线程我的上一条回复),这里汇总现状: 已做:① 查重——不重复;② 打标签 pr + scope/ui + p3;③ 逐行审核代码与测试(cascade 算术手工复核、隐藏列/ellipsis 门控/hydrate-once 绑定有效性/specificity 逐项验证)——未发现回归,判定可合;④ 本地定向验证(master 合并后的树): 现状(刚核过):PR head 仍是 唯一待办仍是 floor 9 的 A/B 二选一(A: 作者自行 |
00591c4 to
7a4aa8e
Compare
Session tables (overview + sessions list) get a drag handle on every column boundary except the last. Dragging widens one side and shrinks the other cascade-style (nearest column first), so the table's total width and both outer edges stay fixed and the rightmost column can never leave the viewport. - lazy snapshot on the first pointermove: a plain click no longer pins the table to pixel widths - per-column floors (120px for the first column, 48px otherwise) clamp the cascade instead of the nearest neighbour - columns hidden by col:nth-child(n+6) at <=720px are never revived - keyboard: focusable handle, ArrowLeft/ArrowRight step 20px - pointercancel / lostpointercapture detach the listeners - th/td clip with ellipsis once the columns are pinned - i18n: ses.resize_column (zh/en); handle labels refresh on locale switch Refs ranxianglei#4826
7a4aa8e to
216f0b3
Compare
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — 实现与声明一致,级联算术/最小宽度钳制/隐藏列守卫都正确,单测有牙(断言值逐一手工核对过),无阻塞项。审出两处小问题(其一导致 PR 声称的省略号效果实际不生效):修复已在本地备好并验证,但向你的 fork 推送 permission denied,精确的两行改动见下方「发现的小问题」,可直接提交。
结构化结论(八问)
- 是什么问题:web 面板两张会话表(总览 recent + sessions 列表)13 列宽度全部写死在 colgroup,1800px 视口实测标题列吞掉 ~912px、数值列挤到 48–72px,用户完全无法调整——纯 UI 可用性缺陷,对代理/压缩行为零影响。
- 什么原因导致的:页面最初按「固定列宽 + 首列吸收剩余」布局且没有调宽入口;相邻列转移方案因最小宽度死锁被否(#4826 的分析),本 PR 用整侧级联 + 外缘钉死绕开该死锁。
- 影响范围与严重程度:仅 loopback web UI 的两张表;默认视图在首次拖动前逐像素不变(新增 CSS 全挂在 .columns-resized 类下,该类只在首次 pointermove 时添加)。体验增强类,无数据/安全影响。
- 怎么修复的:每个 th(末列除外)挂一个可聚焦的 8px 把手;惰性快照只在首次拖动时做(点击不锁表);右拉扩大左邻、右侧由近及远让宽,左拉反之;最小宽度 120px(首列)/48px 兜底;回写 colgroup 前跳过 width:0 的隐藏列(移动端 ≤720px 隐藏的 n+6 列不会被复活);pointercancel/lostpointercapture/pointerup 全路径拆监听;键盘 ←/→ 步进 20px;aria-label 走 i18n 且重绑时刷新语言。
- 是否有回归问题:逐项清点既有行为,未见破坏——① 默认流式布局(未拖动):保持,新 CSS 全在 .columns-resized 作用域内,仅 .twide th{position:relative} 为布局中性;② 移动端 ≤720px 隐藏列规则:保持,回写被 initial[i]>0 守卫挡住(逻辑核对 + 零宽列测试用例覆盖);③ embed 变体:同一套通用逻辑,min-width:0 场景同样成立;④ 语言切换(location.reload 流程):保持,i18n 双 locale 齐加、parity 套件绿;⑤ 行渲染/轮询刷新:tbody innerHTML 重建不动 table+colgroup,已钉宽度跨轮询存活(预期行为);⑥ 行点击跳转:监听器在数据行 tr 上且对 button 目标早退,与表头把手无交互。高危模式(语义漂移/fail-fast 变吞错/阈值时序/输出格式变化):均不涉及——无 wire、无 kernel、无配置面、无持久化格式变更。
- 是否破坏缓存:不涉及(纯前端展示层,不碰 prefix cache / 增量游标 / 去重键)。
- 是否改了设计方向:不涉及后端架构;前端新增一个交互面,边界清晰(只写 colgroup + table 内联样式,类名懒加)。
- 是否引入了新的配置:无(无新 env/config/CLI flag)。
测试有效性
新单测从 WEB_CLIENT 源码抽出 bindSessionColumns 在 vm mock DOM 里跑:级联算术、双向钳制、零宽列跳过、点按不钉死、键盘步进、监听清理,断言值我逐一手工核算过,是真断言不是恒真;作者已披露缺口(真实 13 列结构 + 移动端媒体查询靠手动 CDP 取证,正文有数据;label 刷新路径未断言)——对 UI 功能可接受。本地复跑 node --import tsx --test tests/web-i18n.test.ts → 11/11 通过。
发现的小问题(非阻塞;修复已备好并本地验证,待你提交)
向你 fork 推送返回 permission denied(直连与既有 yhj-fork remote 各试一次),以下两处小修留在原地,合计两行:
- PR 声称的省略号实际没生效(src/web/styles.ts 新增规则):text-overflow: ellipsis 对允许换行的盒从不触发,缺了 white-space: nowrap,压窄后仍是换行长行、不可断 token 硬切(正是本 PR 声称要修的 302.8M→302.8 症状)。修法:该规则补上 white-space: nowrap; ——与仓库既有 .clip 模式一致,.twide .badge 有显式 normal 不受影响:
.twide .columns-resized th, .twide .columns-resized td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } - 空 catch 补一行 why 注释(src/web/client.ts pointerdown 内):setPointerCapture 抛错被吞是刻意降级(没有这个 try/catch,抛错会中断 pointerdown、move/stop 监听器来不及挂载,把手整体静默失效)——补一行注释防止后人当坏味道删掉 try/catch 反而复活原始缺陷:
// capture is best-effort: a throw here must degrade the drag, not kill the handler
(放在现有 try 行上方即可。)
两处改动本地已验证:web-i18n 套件仍 11/11 绿。如希望由我直接提交,请把 ranxianglei 账号加成你 fork 的 collaborator。
备注(不改码)
- 「既有把手刷新 label」分支在当前生产流程里是防御性的:语言切换走 location.reload(),DOM 每次全新,该分支实际不会命中(单测里通过二次 bind 覆盖了它)——留着无害。
- 已知限制(PR 正文已如实披露):宽度不持久化、双击不重置、最小宽度按列序写死(增删列会错位)、把手占表头最右 8px 窄列时压字——都是后续打磨项,不构成回归。
判定:APPROVE,可合并(本 head CI 已绿;上述两行外观性修复合入与否不影响功能正确性)。
[bot] 🏷 review-worker-r1 审核收口(本轮 head 做了什么:
两处小问题(非阻塞,与 10-26 那轮 floor 2/floor 5 发现的是同一组,新 head 仍未带上):
卡点(同上轮,需作者一步):两处修复我已在本地 commit 并验证(web-i18n 仍 11/11),但向你 fork 推送实测 判定:APPROVE,代码本身可合;上述两行属外观性精修,合不合入都不影响功能正确性,由 owner 定夺。 |
Session tables (overview + sessions list) get a drag handle on every column boundary except the last. Dragging widens one side and shrinks the other cascade-style (nearest column first), so the table's total width and both outer edges stay fixed and the rightmost column can never leave the viewport. - lazy snapshot on the first pointermove: a plain click no longer pins the table to pixel widths - per-column floors (120px for the first column, 48px otherwise) clamp the cascade instead of the nearest neighbour - columns hidden by col:nth-child(n+6) at <=720px are never revived - keyboard: focusable handle, ArrowLeft/ArrowRight step 20px - pointercancel / lostpointercapture detach the listeners - th/td clip with ellipsis once the columns are pinned - i18n: ses.resize_column (zh/en); handle labels refresh on locale switch Refs #4826 Co-authored-by: wxy <2398249916@qq.com> (external contribution preserved from PR #4827 by @yanhuojiyusheng, fixes #4826)
Session tables (overview + sessions list) get a drag handle on every column boundary except the last. Dragging widens one side and shrinks the other cascade-style (nearest column first), so the table's total width and both outer edges stay fixed and the rightmost column can never leave the viewport. - lazy snapshot on the first pointermove: a plain click no longer pins the table to pixel widths - per-column floors (120px for the first column, 48px otherwise) clamp the cascade instead of the nearest neighbour - columns hidden by col:nth-child(n+6) at <=720px are never revived - keyboard: focusable handle, ArrowLeft/ArrowRight step 20px - pointercancel / lostpointercapture detach the listeners - th/td clip with ellipsis once the columns are pinned - i18n: ses.resize_column (zh/en); handle labels refresh on locale switch Refs #4826Co-authored-by: wxy <2398249916@qq.com> (external contribution preserved from PR #4827 by @yanhuojiyusheng, fixes #4826)
Session tables (overview + sessions list) get a drag handle on every column boundary except the last. Dragging widens one side and shrinks the other cascade-style (nearest column first), so the table's total width and both outer edges stay fixed and the rightmost column can never leave the viewport. - lazy snapshot on the first pointermove: a plain click no longer pins the table to pixel widths - per-column floors (120px for the first column, 48px otherwise) clamp the cascade instead of the nearest neighbour - columns hidden by col:nth-child(n+6) at <=720px are never revived - keyboard: focusable handle, ArrowLeft/ArrowRight step 20px - pointercancel / lostpointercapture detach the listeners - th/td clip with ellipsis once the columns are pinned - i18n: ses.resize_column (zh/en); handle labels refresh on locale switch Refs #4826 Co-authored-by: wxy <2398249916@qq.com> (external contribution preserved from PR #4827 by @yanhuojiyusheng, fixes #4826)
Closes #4826
问题
会话表(概览「最近活跃会话」+ 会话列表)的 13 列宽度写死在 colgroup 里,
table-layout: fixed+ 首列 auto 让标题列吞掉全部剩余宽度(1800px 视口实测 912px,其中 700+px 被.w-title { max-width: 200px }浪费成空白),而「命中率」190px / 「客户端」84px 这种数值列贴边挤满。用户没有任何调节手段。做法:整侧级联,外边界固定
每条列边界(除最后一列)挂一个
.col-resize把手:pointermove才快照(冻结总宽为 px、各col写 px、加.columns-resized),单纯单击不会把表格钉死;col:nth-child(n + 6) { width: 0 !important }隐藏的列不参与回写,不会被复活;ses.resize_column中英双语,切语言时标签同步刷新;pointercancel/lostpointercapture/pointerup全部 detach;th, td统一overflow: hidden; text-overflow: ellipsis(之前302.8M会被硬切成302.8)。setPointerCapture包了 try/catch —— 它抛错会中断整个pointerdown处理器,拖拽会没有任何报错地失效。验证
[710,48,48,48,48,48,48,48,548,54,48,48,56],表格left 0 / right 1800不变;键盘 ArrowRight 生效;700px 视口滚动仍在.twrap内。node --import tsx --test tests/web-i18n.test.ts11/11(新增反向断言:pointerdown后不移动不得修改table.style.width/minWidth)。npm run typecheck、npm run build通过。已知边界
只动
src/web/**与该测试,不涉 kernel / 配置面 / wire。