Repository navigation
[PR] web: blocks pane — collapsible tree (default) + folded-block list + master-detail panel (#4608) - #4737
Conversation
…ment #4316 PR3/3 (restampRefsToLedger) re-homes citation numbers once on every full-mode cold load; goldens pinning exact ref numbers are born-red. Re-pin the 7 storage-lane tests (engine-proofs x6 + orphan-recovery x1) modulo that renumbering — zero production code touched. - golden-storage-drive.ts: per-turn citation-normalized digest (shaCiteNorm) and state digest modulo stripOneTimeAlignment (stateDigestAligned); the deep-sort helper is hoisted into golden-canonical.ts for sharing. - corrupt-index-child.ts: new stripOneTimeAlignment normalizer — strips the refLedgerAligned stamp and re-homes refs onto canonical raw-id order so a clean full-mode read and the legacy fallback load compare equal. - storage-engine-proofs.test.ts: wire legs assert shaCiteNorm equality vs the legacy restart leg and the committed goldens; state legs assert stateDigestAligned; rollback leg now spells BILI_STORAGE_UNIFIED=legacy explicitly (#3818 flip: absent resolves to full, deleting the env would vacate the legacy path). - storage-orphan-recovery.test.ts: pins the content-addressable byRaw->byRef round-trip instead of a counter-era m00003 literal. - golden/storage-render/*.json regenerated with shaCiteNorm/stateDigestAligned. Converges the master-red storage-lane family (#4599 plan A, owner directive).
…ster-detail side panel (#4608)
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.5837-pr.4737.4a362daThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4737.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…indow prunes them (#4738) Host-side native compaction prunes lastMessages client-side, so every folded message whose bytes left the resident window rendered as 'missing' even though the unified store still holds them — previews that used to be there vanished without any data loss (#4738). - UnifiedStore.messageContentByRefNums: per-ref message bodies (chunked ref_num IN query, retired rows excluded, media hydrated) - UnifiedShadow / SessionStore.unifiedMessageContentByRefs pass-throughs (null when the unified sidecar is unavailable — callers stay fail-open) - buildSessionDetail: leaves absent from the window are batch-hydrated from storage; refs absent from BOTH keep the honest missing marker - buildMessageContent (/message?ref=): same fallback for click-to-open, so any stored message serves verbatim again - tests/web-storage-fallback.test.ts: prune-then-hydrate e2e over a seeded index.db + fail-open case with the unified store off
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 没有其他 open/closed issue 或 PR 做同一件事(blocks pane 改成 tree+list+侧栏)。最接近的:已关闭的 #3917/#4173(旧 structure tab 与树缩放修复,早已合入)、open 的 #4738(同一 pane 里消息预览消失——独立 bug、不同机制,见下面第 2 条);其余 open web PR(#4631/#3337/#4651)各管各的面。 标签: 这是 [PR] 镜像,按规则不重做工作——核对代码与描述、确认 CI、报结论。初审发现(完整八问结论随后):
继续工作中:检出分支本地跑定向套件、通读全量 diff,随后给八问结论。 |
…dger parity masks The #4316 one-time renumbering restamped messageRefs but left state.tokenSnapshot keyed by the OLD refs, so post-restart bodies carried stale per-message token counts (1.3K vs 1.4K) and the full-mode-restart wire drifted off the legacy baseline (#4599). persist.ts: two-pass remap (stage moves, delete old keys, then write new keys) so entries whose new ref collides with another move's old ref survive; fires only when superseded refs exist. Aligned normalizer (corrupt-index-child.ts): the cacheLedger's segment bookkeeping (be/bl/bs, unfinalized tail line), the derived agg block, and per-line miss-attribution (prov/seam) are restart experience, not content — no-restart and restart legs legitimately differ there. Masked in the aligned view only; raw digests keep full accounting. Goldens regenerated (stateDigest + aligned). storage-engine-proofs 12/12, golden-storage-render 5/5 locally.
…persisted state (#4599) The fork-survival test asserted immediately after the compress tool response, but the fold lands in the live session state asynchronously (#3573 replay semantics). Slow CI runners persisted the pre-fold state ('0 block(s) (compressions=0)' cold load) and the deepEqual diverged. Bounded 5s wait on the in-memory fold; fast machines exit on the first iteration. Product semantics unchanged.
The #4316 cold-load alignment reads the unified sidecar; its ingest of just-flushed records completes asynchronously. Slow runners compared the pre-ingest state and saw refLedgerAligned missing while the fold itself had landed. Poll (bounded 5s) until the loaded state carries the flag; fast machines exit on the first probe.
…eme-following panes, Esc rebind after navigation Labeled review fixes for the blocks-pane rework (PR #4737 self-review): - styles.ts: a find-replace dropped the element suffix on the .block-item side of the shared '.block-item .body.md X / .bd-panel .body.md X' rules, which left the classic list's summary text unstyled (headings, lists, code blocks, quotes, hr) and shifted body color; restore the suffix on both sides of every rule. - styles.ts: .fd-left and .bd-card hardcoded background #fff, breaking the dark color scheme; follow the theme instead (var(--bg-elev) / inherited from .card). - client.ts: the once-bound Esc listener closed over the FIRST detail pane's renderTree/graphView, so after hash-navigating to another session the Escape collapse rendered into detached DOM (dead key); resolve the view and renderer at keypress time. - tests/web-blocks-tree.test.ts: pin the suffixed selector pairs and the theme-following pane backgrounds.
Git-for-Windows autocrlf checks the bundled .md posts out with CRLF; the exact-match '---' fences then failed to parse and every post lost its title/excerpt/date frontmatter (Windows CI: 'bundled meet-bili post found' assertion). Normalize CRLF to LF inside parseFrontmatter when the fence is CRLF-shaped; LF content is byte-identical as before. Regression test with a CRLF fixture.
… the #4599 bounded-wait commit Labeled follow-up (review of PR #4737 tree): ci-fixes 8082ee8 added a direct 'Session | null' -> '{ state: Record<string, unknown> }' cast in the refLedgerAligned bounded-wait probe, which fails tsc (TS2352 — CompressionState has no index signature). Route through unknown, matching the test-suite's existing two-step-cast convention.
… storage mode (#4599) The #4316 cold-load alignment sets refLedgerAligned only when the unified store is available; config-clean machines (CI runners) run legacy mode where it is an honest skip. The test asserted the flag unconditionally, so every shard carrying this file was born-red on CI while unified-config machines passed. Expectation now mirrors store.replicasAvailable(); verified 49/49 in BOTH modes locally.
# Conflicts: # tests/plugin-fork.test.ts
(ai: vllm-qwen/qwen3.8-27b) 结论代码核验通过、方向与描述一致;review 发现的 3 个缺陷已直接在 PR 分支修掉并推送;CI 红全部逐条定位到测试名级 = master 继承的在册簇(与本 PR diff 零交集),已把含修复的最新 ci-fixes tip 合入分支重跑。需人处理两项:标题编号写错、PR body 验证段基于旧 head。 八问
需人处理
判定代码质量达标、方向正确、本 PR 未引入回归;等 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.841-master.4dc1dc5 # this exact build
npm install -g billion-context@master # always the newest merged build
|
What this does
Reworks the Structure → blocks pane in the web session detail view:
Both language catalogs (en + zh) got the new strings; the old flame-chart draft from #4545-era exploration is NOT included — it was dropped on request before landing.
Why
The previous single SVG tree was hard to read on real sessions (600+ blocks): no topics visible, no way to collapse, nothing clickable. This gives a readable global picture first (collapsed), drill-down second, and keeps the proven list mode for people who prefer rows.
Scope & tests
src/web/client.ts— pane rewrite: layout engine, collapse state machine, selection/side-panel binding, zoom removed.src/web/styles.ts— block-list + tree + side-panel styles (keeps upstream's new blog styles from The panel includes a built-in snapshot of the official website: website/ is shipped with the npm package, and the proxy | 面板内置官网快照:website/ 随 npm 包发布,代理在 /__bili/site/ 提供博客与文档 #4587 untouched).src/web/i18n.ts— en/zh catalog entries only.tests/web-blocks-tree.test.ts— vm-render assertions on the generated page HTML/SVG: default mode = tree, collapse chips, expansion behavior, list-mode restore, side-panel population.Verification (head bb7c249-based rebase):
node --import tsx --test tests/web-blocks-tree.test.ts tests/web-i18n.test.ts→ 21/21 passnpm run typecheck→ cleanAlso fixes #4738 — folded-message previews vanishing after host-side native compaction
Symptom. In the session detail page, every folded message of older blocks rendered as "message no longer in the session" — previews that were visible before simply disappeared, though no data was lost.
Root cause. Message previews (and click-to-open text) were served only from
lastMessages— the newest full request snapshot the client sent. Folding never drops messages from that window, but host-side native compaction does: once the client's own compressor prunes old messages out of its context, every ref pointing at them reads as "missing", even though the unified store (index.db) still holds every byte (verified on the live session: 41k message rows intact, nothing retired).Fix. When a ref is absent from the resident window, fall back to storage:
UnifiedStore.messageContentByRefNums()— per-ref bodies via chunkedref_num INquery (retired rows excluded like every other view-lane reader).buildSessionDetailbatch-hydrates all window-pruned leaves in one query; refs absent from both window and storage keep the honestmissingmarker — nothing is invented.buildMessageContent(/__bili/sessions/<id>/message?ref=) applies the same fallback, so click-to-open serves any stored message verbatim again.Covered by
tests/web-storage-fallback.test.ts(prune-then-hydrate e2e over a seeded index.db + fail-open case); existing "pruned reports a miss" test unchanged and passing (it runs with unified storage off).