Repository navigation
[PR] fix(web): switch large-session compressed structure tree to vertical layout when too wide, no longer shrinking to sub-pi | fix(web): 大会话压缩结构树图过宽时转竖向布局,不再缩成亚像素 (#4173) - #4211
Conversation
…raph #4173: a 180-block session lays out 21558px wide, and fit-to-card shrank it to ~0.052x (blocks ~6px, labels ~0.6px, unreadable). blockGraphLayout gains a vertical orientation (depth on x, siblings stacked on y); buildGraphSvg falls back to it at natural size whenever the landscape fit would drop below GRAPH_MIN_FIT (0.5), and the g-svg-natural class exempts the SVG from the CSS max-width cap inside the existing 70vh scroll container. Narrow trees render unchanged.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5005-pr.4211.7ce990eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4211.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:无重复条目(检索 open+closed issue/PR,无其他条目触碰 Web 树图布局)。但发现一个平行 PR:#4174 修同一个 #4173(10-21 开,早于本 PR),处置建议见文末「平行 PR」。 标签:bug / dsh / scope/ui / p2 —— 缺陷修复;报告会话为 dsh 主会话;纯 Web UI 展示面;大会话树图不可读但列表模式与核心功能不受影响 → p2。 审查依据:diff 全量 4 文件(+147/-28)逐行读完,测试里的几何数字全部手算复核通过,既有行为逐项清点;CI head b0f6c65 共 42 个检查全 success/skipped(skipped 均为路径门控的 e2e 车道,web-only 改动下属预期);mergeable_state=blocked 是等人合并,不是 CI 红。 结构化八问
测试质量:3 个新用例经既有 平行 PR 处置(需 owner 拍板):
无需补修。满足 §7.4 auto-merge gate 条件(纯 fix:、单模块、回归测试复现原 bug、CI 绿、不触碰承重区、diff 干净、Fixes #4173)。 结论:建议合并,人执行合并:#4211 |
|
(ai: zhipuai-lb/glm-5.3) 目标 issue #4173 已关。列车审查确认不再需要,关单。 |
Fixes #4173
问题
大会话(dsh 主会话,180 块 / 161 片叶子)平铺宽度 21558px,fit-to-card 缩放系数 0.052——118×36 的方块被缩成 ~6px、文字 ~0.6px,完全不可读。
修法
blockGraphLayout(blocks, vertical)支持双朝向:竖向 = 深度走 x 轴、兄弟沿 y 轴堆叠;横向路径与原实现逐字节等价(同一套坐标公式,只是轴互换)。buildGraphSvg:先算横向布局,若fit = min(1, 1120/W) < GRAPH_MIN_FIT (0.5)则改用竖向布局且 fit=1(自然尺寸),svg 加g-svg-natural类——CSSmax-width:none豁免,防止被.g-svg { max-width:100% }二次缩小;在现有.tree-graph70vh 滚动容器内滚动查看。行为变更(旧→新)
测试
tests/web-blocks-tree.test.ts 新增 3 例:
本地定向验证全绿:web-blocks-tree + web-i18n 21/21、upstream-alerts + web-sessions 34/34、typecheck clean;全量回归以 CI 为准。
仅触碰 Web UI 展示面(src/web/client.ts、styles.ts、i18n.ts + 对应测试),不涉及 wire/存储/内核。