Repository navigation
[PR] web: Rotate the "Compressed Structure" tree view of large sessions to vertical full size, no longer shrunk to sub-pixel | web: 大会话「压缩结构」树图旋转为竖向全尺寸,不再缩成亚像素 (#4173) - #4174
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5136-pr.4174.c29248bThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4174.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
Progress on this branch: live tree thumbnail committed ( The session detail page now carries an always-visible minimap of the compression tree in the top-right of the page head, refreshing itself every 5s while the view is open — compressions landing in a live session are watchable without opening the tab:
|
|
da60fe3 — in-pane live tree panorama (replaces the page-head chip) The fixed ~170×56 corner chip could not render pathological trees: this session's rotated graph is 386×8356, which the CSS-capped box scaled down to a few pixels of content — effectively blank. Reworked per review:
Verification: web-blocks-tree 10/10; battery 49 runs → only the 5 pre-existing environment reds (#1590×2, #1809×3) identical to clean master; tsc 0; gen-config-docs zero diff; unused-exports clean; npm run build OK. |
|
298e978 — natural-size scroll, instead of a second meeting-to-fit The first cut still had the chip's disease one size up: with no transform set, the browser met-scaled the whole viewBox into the fixed viewport. For this session's rotated tree (386×8356 user units in a ~1500×440 box) that means scale ≈ 0.05 — the "overview" rendered as a ~20px sliver of lines. Uniform meet can never make a 21:1 aspect ratio legible in a 3.4:1 box; it was only ever a coincidence for near-square trees. Now the pane renders at natural pixels (a block box is always 118×36, its labels readable) inside a natively scrollable viewport:
|
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 检索了 open+closed 的 issue/PR(关键词:压缩结构、树图、亚像素、web tree graph、blockGraph、rotate),除 #4173 本体与本 PR 外无相似条目。 初审进行中,先报两个要点,完整八问结论随后补:
|
…g them to smears (#4173) 大会话(如 dsh 主会话,180 个压缩块)的「压缩结构」树图实测平铺布局 21558px 宽 x 204px 高,fit-to-card 缩放系数 0.052 —— 每个 118x36 的方块 渲染为约 6px 的像素点,完全不可读。根因:blockGraphLayout 的宽度由叶子数 决定,而 buildGraphSvg 一律 fit = min(1, 1120/W)。 The tree now rotates when the flat width overflows the card AND the rotated long dimension is shorter: depth becomes the x-axis, sibling stacks pile along y at full box size inside the pane's existing 70vh scroll area. Same fixture: 414px wide x 8356px tall, all 180 nodes + 104 edges intact. Small/narrow trees render byte-identically to before (rotation is only considered once flat width exceeds GRAPH_FIT_W). New det.tree_graph_hint_lr names the left-to-right reading direction; the hint switches per orientation.
A small always-visible minimap of the compression tree sits in the top-right corner of the session detail page and refreshes itself while the session is live — you can watch compressions land without opening the tab. - GET /__bili/sessions/<id>/tree: compact edge feed only (id/tier/active/ parent/fold edges, no summaries or refs) — a 180-block session ships ~6KB. Served by buildSessionTree() with the same first-parent-wins inversion the detail payload uses. - client.ts shares ONE orientation rule (graphLayouts) between the full graph and the new rect-only thumbnail, plus one bezier helper (graphEdgePath), so both drawings always agree and wide trees rotate in the chip as well. - the chip joins the existing 5s poller on the detail view only; it is a decorative lane: failures keep the last good frame and never touch the error strip or the #1937 backoff ladder. Clicking it jumps into the Compression-Structure tab, switches to Tree-Graph mode, and scrolls there. - tests: server-side feed pin (edges wired, summaries never leave the wire, unknown session -> null), thumbnail invariants (no text nodes, width cap, rotation shared), i18n key pair, bundle wiring regexes.
) The shell document inlines the entire client bundle and carried no cache directive, so browsers applied HEURISTIC caching: after a proxy upgrade the page kept serving an old client build until someone happened to hard-refresh (witnessed live — the tree thumbnail deploy stayed invisible this way). Cache-Control: no-cache forces revalidation; the document is stateless HTML so always-refetch costs nothing but a few hundred KB of loopback traffic.
…4173) The fixed-size corner chip rendered as a blank sliver for pathological trees (this session: rotated 386x8356 -> ~3px of content in a 170px box). The compression tree now opens its own pane section: full labeled drawing at natural node size inside a bounded viewport, wheel zoom to cursor, drag pan, fit button, click a block to jump to its list row. Same 5s /tree poller; re-renders only on population change and restores the viewer transform.
…shrink (#4173) The default meet-scaled viewBox still smears pathological aspect ratios inside the fixed viewport (this session: a 386x8356 rotated tree met into a ~20px sliver). The pane now renders the drawing at natural pixels (block boxes stay 118x36, labels readable) in a natively scrollable box; wheel zooms around the cursor by resizing the inner frame so scroll ranges stay honest, drag pans via the native scroll position, Fit shrinks to the whole-tree overview, double-click restores natural size. Click-through to the list row and the 5s /tree refresh are unchanged.
The /tree poller's change signature covered blockId/tier/active, so an absorption that only adds a fold edge (the child keeps its id, tier and active flag) left the in-pane panorama stale until the next unrelated population change. Edges are part of the drawing, so they belong in the signature.
298e978 to
4b8e6b4
Compare
(ai: vllm-qwen/qwen3.8-27b) PR #4174 review 结论(结构化八问)
review 附加动作(已完成并推送):
判定:可合并。 无阻塞项;上述三处行为变更均已披露且合理。 |
|
(ai: vllm-qwen/qwen3.8-27b) 交叉链接:#4211(10-22 开)覆盖了本 PR 与 #4173 的同一根因,scope 更小——只做「预计缩放系数低于 0.5 时转竖向自然尺寸」这一项修复(无全景图 / no-cache 增量),CI 全绿。两个 PR 改同一组函数(blockGraphLayout/buildGraphSvg + styles/i18n/tests),不能共存。 按「一个 issue 一个 scope」,建议:合并 #4211 关 #4173;关闭本 PR;若页内实时全景图功能仍想要,另立 issue 拆独立 PR。等 owner 拍板,未对任何一侧做处置。 |
…oom (#4173) User reported two trees on the compression pane (standalone panorama card above plus the 列表/树图 switch below) and asked for ONE: drop the real-time card, give 树图 itself the natural-size live drawing with zoom. - #tree-graph now renders the wrapped natural-size svg (treeMapInnerHtml): boxes stay 118x36 px, native two-axis scroll, wheel zoom at cursor, drag pan, 适配(Fit) overview, double-click resets, click a box jumps to its list row. The 5s /tree poller repaints this same container (sig-guarded, including awork's fold-edge signature fix). - The hint line and Fit button move into the 列表/树图 row; Fit only shows while 树图 is active. Per-node click listeners dropped (delegated pointerup in bindTreeMap covers click-vs-drag). - Removed: tm-wrap/tm-head card markup+CSS, det.tree_map_title (zh/en). Re-applied on top of the rebuilt branch history (previous attempt was lost when the branch was rebased onto master); gates green (tsc, web-blocks-tree 10/10, battery, gen-config-docs, unused-exports, build).
|
Re-applied the merge on top of the rebuilt branch history (the earlier merge commit was dropped when the branch was rebased onto master). This sits cleanly on 4b8e6b4 and keeps the fold-edge signature fix — the poller now repaints #tree-graph itself. Shape: one tree. 树图 renders the natural-size drawing (wheel zoom at cursor, drag/scroll pan, 适配 overview, double-click reset, click-to-jump, 5 s live refresh); the standalone panorama card is gone and its hint/Fit control live in the 列表/树图 row (Fit only shown while 树图 is active). Gates green: tsc 0, web-blocks-tree 10/10, battery 33/33 (+ dsh-settings-ui at the known 5 env-red baseline), gen-config-docs zero diff, unused-exports clean, build rc 0. |
…ss live refreshes (#4173 review) 78a123f moved #tm-fit into the list/graph row starting hidden, but setMode never unhides it - the advertised Fit overview was unreachable. The 5s poller also replaced the whole #tree-graph innerHTML, wiping the legend row that now lives inside the pane after the first refresh. - setMode toggles fit.hidden with the graph mode (visible only while the tree view is active) - refreshTreeMap swaps only the .tm-inner drawing frame so the pane's other children survive live refreshes - pin both behaviors as bundle regexes in tests/web-blocks-tree.test.ts; correct the stale #tree-map comment to #tree-graph
(ai: vllm-qwen/qwen3.8-27b) 第二轮 review(新 commit
关于「earlier merge commit was dropped」:我核了 git 证据——rebase 前的远端分支历史是线性的(c7e8af4d9→b2ac0217e→05e5df63b→da60fe3c4→298e9787b,每个都只有一个父提交),我的 rebase 没有从远端历史丢掉任何 merge commit;如果之前有未推送的本地尝试,现已由 验证(head 判定:CI 全绿即可合并(当前无红项;两处缺陷已在本分支闭环)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 终态确认(head
判定维持不变:可合并——功能与回归面已闭环(两处 review 缺陷已修并钉测试),唯一待办是环境性的 artifact 重发。 |
…k map+list instead of hiding details (#4173)
|
Fixing the two regressions reported after the merge (#4173): Click-to-jump was dead — "All the block details were lost" — graph mode hid the whole Gates: bundle parse check ✓, tsc 0 ✓, web-blocks-tree 10/10, web-sessions + embed-cors 37/37 combined ✓. New pins: |
(ai: vllm-qwen/qwen3.8-27b) 两处回归修复已独立核验(head 先澄清一点:PR #4174 尚未合并——两个回归都只存在于 PR 构建(npm 代码核对(diff 逐行读过):
本地定向验证(分支 head 实跑,kernel 先构建):web-blocks-tree + web-sessions + dsh-panel-embed-cors 共 37/37 绿,与报告一致。 远程 CI(head 八问:
判定:修复成立、验证齐备,可合并——当前无任何红项,最后一个 Windows 分片正常收尾即可直接合。 |
…ive/inactive contrast, raw-view toggle (#4173)
|
Five review nits from @ranxianglei addressed (
Gates: bundle check + tsc 0 + web-blocks-tree 10/10 + web-sessions/embed-cors 27/27. Deployed as 0.1.207-treemap.9 on 18824/18826; live probe on the 211-block session: rows open=0, 201/211 nodes show a message span. |
(ai: vllm-qwen/qwen3.8-27b) 第二轮修复(5 条 review 意见, 逐条核验
本地验证:web-blocks-tree + web-sessions + dsh-panel-embed-cors 三套定向测试 37/37 绿(含新钉的 span 规范化断言;第一轮的两个 pin CI(head 八问
判定:五条意见的实现与评论声明一致,本地定向验证通过,CI 暂无红——剩余 shard 跑完即可合并;如有红我会被唤醒跟进。 |
|
In-page flow for the live tree map (follow-up to review feedback on 194542c): Problem. The map lived in its own ~440px scroll box ( Change (client-side only):
Gates: bundle extract + |
Review nit found while verifying 06e280a: since the map flows with the page, #tree-graph is no longer an inner scroll box, so capturing/restoring its scrollLeft/scrollTop on every live refresh is a no-op. Remove the dead lines and fix the stale 'zoom/pan' wording in the poller's doc comment (pan no longer exists).
CI red found while verifying this PR: master merge aa198fe (#4177) added tests/storage-durability.test.ts without registering it in the process-spawning LIVE_FILES table, so the SPAWN_RE tripwire in scripts/run-ci-tests.mjs fails every test shard on any PR whose checkout includes current master (and master itself). Append at the end of the array: slot = index drives each file's zone port band, so mid-list insertion would renumber every later band.
(ai: vllm-qwen/qwen3.8-27b) 本轮两个新 commit( 逐条核验
本地门禁:web-blocks-tree / web-sessions / dsh-panel-embed-cors / issue3862-context-view / web-i18n 五套定向测试 53/53 绿; 验证过程中发现并处理的两个问题(均已提交到本分支)
同一症状的另一机制(mysql-contract lane 因 job 缺 kernel build 步骤解析不到 当前 CI(head 八问
判定:两 commit 实现与声明一致,本地定向全绿,CI 红风暴已止血(facet A 随本 PR 合入生效,facet B 独立跟踪 #4326)——剩余 3 个 shard 跑完即可合并,目前无新增红;如有红我会被唤醒跟进。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.739-master.9e2d217 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #4173
现象(有实测数字)
180 块会话(dsh 主会话,
01a152ba…)的「压缩结构」树图:平铺布局 21558px × 204px,fit-to-card 缩放 0.052 —— 每个 118×36 方块渲染成 ~6px 像素点,文字 0.6px。块数一多整棵树退化成色带。修法
blockGraphSvg之前一律fit=min(1,1120/W)。现在:平铺宽度溢出卡片、且转置后的长边更短时改用blockGraphLayoutVertical(深度走 x 轴、兄弟堆叠走 y 轴),方块保持自然尺寸,在.tree-graph既有的 70vh 滚动区内滚动;提示语按朝向切换(新键det.tree_graph_hint_lr)。同一会话实测:414px 宽 × 8356px 高,180 节点 + 104 边一个不少。窄树/小树走原路径,渲染逐字节不变(只在 flat 宽 > GRAPH_FIT_W 时才考虑转置)。验证
tests/web-blocks-tree.test.ts:新增功能测试——从 WEB_CLIENT bundle 里抽出真实布局代码跑 fixture(30-root 平铺树必转置且节点数不丢、窄链不转置、空树保持{html:""}契约)+ bundle 正则钉 + i18n 双语文键对齐。9/9 绿。