Skip to content

[PR] fix(web): make compression-blocks treemap follow the dark theme - #5422

Closed
ranxianglei wants to merge 0 commit into
masterfrom
2026-11-01_treemap-dark-mode
Closed

ranxianglei wants to merge 0 commit into
masterfrom
2026-11-01_treemap-dark-mode

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

The web panel's compression-blocks treemap did not follow the dark theme. Node fills were pinned to hardcoded light hexes (#fff, #f2f7ff, #f6f3ff, #fffaf0, #f7f8fa) while node text uses var(--text) — so in dark mode the map rendered light text on white/light fills and became essentially unreadable. The rest of the panel already supports dark mode; the treemap was simply left behind.

Change

  • Add five theme vars --tm-{base,t1,t2,t3,tn}-fill to all three palette blocks in src/web/styles.ts (light + OS-dark + ?theme=dark pin).
  • Point the five .g-node / .g-node.tier-* rect rules' fill: at those vars. Strokes and text are untouched (already theme-aware / legible in both schemes).
  • Regression guard in tests/web-blocks-tree.test.ts: each node rule must use a var(--tm-*-fill) fill (no hardcoded hex), and both dark palettes must define all five vars.

Behavior change (flagged)

  • Light mode: unchanged. The new light --tm-*-fill values are byte-identical to the previous hardcoded hexes, so light-mode rendering is identical.
  • Dark mode: fixed. Nodes now sit on subtle dark tints (tier-1 #182338, tier-2 #241a38, tier-3 #2c2416, neutral #1c2129) so the light node text stays legible. Previously the dark-mode treemap was unreadable.

Tests

Targeted tests/web-blocks-tree.test.ts green locally (13/13, including the new guard) on the rebased head; full suite + typecheck run on CI.

Closes #5417

@ranxianglei ranxianglei changed the title fix(web): make compression-blocks treemap follow the dark theme [PR] fix(web): make compression-blocks treemap follow the dark theme Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-01_treemap-dark-mode (f977355)

Latest build — install this exact version

npm install -g billion-context@0.0.7685-pr.5422.89d6116

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
f977355 billion-context@0.0.7685-pr.5422.89d6116 build
a4a00af billion-context@0.0.7681-pr.5422.ffeb97c build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5422.tgz
npm install -g package

Install instructions are refreshed on each push.

ranxianglei pushed a commit that referenced this pull request Nov 1, 2026
…emap theme guard

Review nit from #5422 review: the CSS comment and test title pointed at
#5419, which on GitHub is the unrelated release-v0.1.211 PR; the treemap
dark-mode issue is #5417. Comment/test-title only, no behavior change.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 这是 #5417(treemap 深色模式不可读)的指定修复 PR,检索 open+closed 未见针对同一改动的并列 PR/issue。分类:bug 修复 · scope/ui · p3(深色下体验瑕疵,不丢数据、不影响核心功能)。

已拉分支 pr-5422 核对代码 + 独立复验,逐条如下。

结构化八问

  1. 是什么问题:网页面板"压缩块"的 treemap(方块树图)在深色模式下基本不可读——节点底色被写死成浅色(#fff/#f2f7ff/…),而同一节点的文字走 var(--text)(深色下是浅字),于是浅字压浅底,看不清。其余面板都支持深色,只有这个 treemap 漏了。

  2. 什么原因导致的:根因是五条 .g-node rect / .g-node.tier-* rect 规则的 fill: 用了写死的浅色 hex,没接入主题变量体系;而文字早已用 var(--text)。三套调色板(:root 浅色、@media OS-dark、[data-theme="dark"] 钉死深色)本就有完整变量,唯独 treemap 填充色没接进去——属"新组件没跟上主题系统"的遗漏,不是设计缺陷。

  3. 影响范围与严重程度:仅影响"在深色模式(系统深色或 ?theme=dark)下面板查看压缩块 treemap"的用户。p3 体验瑕疵:不丢数据、不影响核心功能,只是那张图深色下难读;浅色模式完全不受影响。

  4. 怎么修复的:把五个填充色抽成 --tm-{base,t1,t2,t3,tn}-fill,在三套调色板各定义一次(浅色值 = 原写死 hex 原样搬,零漂移;两个深色调色板给低亮度底),再让五条规则 fill: 指向变量。描边/文字不动(本就随主题)。这是"写死值→主题变量"的标准修法,治的是填充来源本身,不是在别处盖遮罩。

  5. 是否有回归问题(逐项过):

    • 浅色渲染不变——独立验证浅色五值与原 hex 等价(base 仅 #fff→#ffffff,同色不同串);
    • 两套深色调色板都补齐五个变量且彼此一致,钉死浅色([data-theme="light"])继承 :root 浅色值,四条主题路径完整;
    • +/- 小方块 .tchip rect 有更靠后的专属规则,不受影响;
    • 全仓 grep 确认这五个 tier 色只出现在此处,无列表行等复用,覆盖完整;
    • 纯 CSS(web 面板字符串),不碰 wire/cache/persistence/config/kernel。
      无回归。
  6. 是否破坏缓存:不涉及——纯前端样式,与压缩/前缀缓存、存储无关。

  7. 是否改了设计方向:不改架构/边界/数据流,只是把一处主题化遗漏补齐,沿用既有 CSS 变量约定。

  8. 是否引入新的配置:不涉及——无新 env/config/CLI flag,--tm-*-fill 是浏览器内 CSS 变量,非用户可配项。

补充验证

  • CI 绿:镜像缓存报 head a4a00afbb 共 24 check,0 failed / 0 pending(8 个 gate 为分片 test/typecheck/build 矩阵,3 个 skipped 是默认跳过的 codex e2e);mergeable_state=blocked 仅表示等人工 approve,非 check 红。
  • 回归测试有牙:做反证——把 tier-2 的 fill 改回 #f6f3ff,新测试的正向断言(必须 var(--tm-*-fill))与负向断言(不得出现写死 hex)同时失败,证明它真能兜住回归,不是恒真测试。正向+负向双向都断言,符合 gate 纪律。
  • 一个措辞 nit(非代码缺陷,无需改):PR 描述说浅色值"byte-identical",严格讲 base 由 #fff 变 #ffffff(同色、串长不同),其余四个才是逐字节相同;渲染结果一致,只影响描述措辞。

合并判定

可合(approve)。方向对、根因修到位、浅色零漂移、深色补齐、回归测试有牙、CI 全绿、diff 干净(2 文件每行都在目的内)。满足 §7.4 自动合入门禁全部条件;按规矩我不执行 merge,请人工合并。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: vllm-qwen/qwen3.8-27b)

Review verdict: MERGEABLE — one small finding fixed directly on this PR's branch (below). Note: posted as a comment review because GitHub forbids approving one's own PR from this account; the review substance below stands as the approval record.

Direction check (issue #5417): verified the root cause independently — the five .g-node rect fills were pinned to hardcoded light hexes while node text runs on themed vars (.g-id/.g-meta fill: var(--text)/var(--text-muted)), so dark mode rendered light text on white/light grounds = unreadable. The fix targets the producer of the offending bytes (the fill values are now theme-driven at the source), not a symptom mask. Direction is correct.

Regression audit — existing behaviors of the touched paths, item by item:

  • Light-mode rendering: NEW light var values are byte-identical to the old hexes (#fff ≡ #ffffff; the other four verbatim) → preserved, zero drift.
  • OS-dark (@media (prefers-color-scheme: dark) { :root:not([data-theme]) }) and ?theme=dark pin: both palettes define all five vars; cascade verified across all four OS-scheme × pin combinations, including pinned-light inheriting the light values from base :root (the light pin block defines no tm vars) → correct.
  • Strokes (tier-1 var(--accent); tier-2/3/n mid-tone hexes legible on both grounds), text, .inactive, :hover, .fsel rules: untouched, preserved.
  • High-risk patterns (semantic drift, fail-fast→swallow, threshold/timing/output-format changes): not applicable — pure frontend CSS presentation, one view; no wire/config/persistence/kernel/update.ts touchpoints.

Test validity: the new guard has teeth in both directions — every node rule must use a var(--tm-*-fill) fill AND carry no hardcoded hex, and BOTH dark palettes must define all five vars; reverting any fill to a hardcode fails it. Matches the established theme-guard pattern in the same file (#4737).

Small finding fixed in review (own labeled commit f977355, comment/test-title only, zero behavior change): the CSS comment and test title cited #5419 — on GitHub that number is the unrelated release-v0.1.211 PR; the treemap dark-mode issue is #5417 (repo convention cites GitHub numbers throughout this file: #2473/#2559/#4737). Corrected in place per the fix-in-review rule; CI re-runs on the new head.

结构化八问

  1. 是什么问题:web 面板的压缩块树图不跟随暗色模式——节点填充写死浅色,文字走主题变量变浅,暗色下基本不可读。
  2. 什么原因导致的:树图后加时 5 个节点 fill 直接硬编码浅色 hex,没接进面板早已存在的暗色调色板;文字侧已用变量,暗色下 fill 与文字错配。
  3. 影响范围与严重程度:仅暗色模式(OS 偏好深色或 ?theme=dark)下的树图视图;可读性缺陷(该场景该视图不可用),无数据丢失 → p3。
  4. 怎么修复的:引入 5 个 --tm-{base,t1,t2,t3,tn}-fill 主题变量,在三个调色板块(亮色/OS 暗色/暗色 pin)各定义一次,5 条规则的 fill: 改引变量;描边/文字/inactive 不动。
  5. 是否有回归问题:无。亮色逐字节不变;描边/文字/hover/inactive/fsel 未触碰;四种主题组合级联逐一验证(见上方 regression audit)。原 head CI 绿;新 head 唯一差异是注释/测试标题修正,零行为影响。
  6. 是否破坏缓存:不涉及(纯前端 CSS,无缓存/重试/游标/去重键)。
  7. 是否改了设计方向:不涉及——沿用面板既有 CSS 变量主题机制。
  8. 是否引入了新的配置:不涉及——仅内部 CSS 变量,非用户配置/env/CLI flag。

判定:可合(新 head CI 绿后由 owner 合并)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)
review 完成:PR #5422(treemap 暗色模式)判定可合——八问结论+逐项回归审计已发在 PR 上(GitHub 禁止自批自己的 PR,以 comment 型 review 提交)。审中顺手修掉一处小问题:代码注释/测试标题误引内部镜像号 #5419(GitHub 上那是无关的 release PR),已改为 #5417 并推 f977355 到 PR 分支;新 head CI 进行中,目前 0 失败。

ranxianglei added a commit that referenced this pull request Nov 7, 2026
…k-mode readable (#5417, picked up from PR #5422; supersedes PR #5254 which fixes the same visual defect)
ranxianglei added a commit that referenced this pull request Nov 7, 2026
…k-mode readable (#5417, picked up from PR #5422; supersedes PR #5254 which fixes the same visual defect)
ranxianglei added a commit that referenced this pull request Nov 7, 2026
…k-mode readable (#5417, picked up from PR #5422; supersedes PR #5254 which fixes the same visual defect)
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)

被强制重启后恢复。汇报进度与结论:

结论:PR #5422 的改动已全部在 master 上,PR 冗余,建议关闭

验证过程

  1. 拉取 PR 分支 pr-5422(head f97735558c,含 reviewer 的 [PR] release v0.1.211 #5419→The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 修正)与当前 master(33104b1f95)对比
  2. PR 只改两个文件:src/web/styles.ts + tests/web-blocks-tree.test.ts
  3. 逐行核对:master 已包含 PR 的全部功能改动——
    • 三套调色板(:root 浅色 / @media OS-dark / [data-theme="dark"] 钉死深色)各定义了五个 --tm-{base,t1,t2,t3,tn}-fill 变量
    • 五条 .g-node / .g-node.tier-* rect 规则的 fill: 已指向 var(--tm-*-fill)
    • 回归测试 #5417: the treemap node fills follow the theme 已在 master 的 tests/web-blocks-tree.test.ts:352
  4. 唯一差异:PR 分支原始注释/测试标题写 #5419(内部镜像号),master 已修正为 #5417(GitHub 真实 issue 号)——正是 floor 5 里 reviewer 推的 f97735558c 修正
  5. git merge-base --is-ancestor pr-5422 origin/master → false(PR 不是 master 祖先),说明改动不是通过 merge 这个 PR 进入 master 的,而是通过其他路径已落地

结构化八问

  1. 是什么问题:PR [PR] fix(web): make compression-blocks treemap follow the dark theme #5422(treemap 深色模式)与 master 产生 merge conflict,CI 工程师被唤醒处理冲突。
  2. 什么原因导致的:PR 基于旧 master(c78ecb4b59),之后 master 前进了大量 commits;更关键的是,PR 的改动已通过其他路径进入 master,导致 PR 分支与 master 在同一区域有"同内容不同来源"的文本冲突。
  3. 影响范围与严重程度:无用户影响——改动已在 master 生效,深色模式 treemap 已可读。仅 PR 状态冗余(占一个 open PR 位)。
  4. 怎么修复的:无需修复——改动已在 master。建议 owner 直接关闭 PR [PR] fix(web): make compression-blocks treemap follow the dark theme #5422(冗余,改动已落地)。
  5. 是否有回归问题:不涉及——未做任何代码变更。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新的配置:不涉及。

处置建议

PR #5422 的改动已全部在 master 上(含 reviewer 的 #5419→#5417 修正),PR 冗余。建议 owner 关闭 PR #5422。我不执行关闭(owner-only)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)

Re-verified live state this run: 4 test shards still failing + merge state dirty on head f97735558c. Not fixing the PR — it is redundant. Here is why:

The PR's changes are already in master. Commit 6c13364c72 on master reads:

fix(web): compression-blocks treemap node fills follow the theme, dark-mode readable (#5417, picked up from PR #5422; supersedes PR #5254 which fixes the same visual defect)

I verified line-by-line that master's src/web/styles.ts and tests/web-blocks-tree.test.ts contain every functional change from the PR (all five --tm-*-fill vars in all three palettes, all five .g-node rules pointing at the vars, and the regression test). The only textual difference is the issue-number comment (#5419 in the PR vs #5417 in master), which the reviewer already corrected in f97735558c.

Why I am not rebasing or fixing the 4 red shards:

  • Rebasing the PR onto current master would produce an empty or near-empty diff (the changes are already applied). There is nothing left to merge.
  • The 4 failing test shards are running on the stale PR branch (based on c78ecb4b59, ~100+ commits behind master). The failures are inherited from that old base, not from the PR's own two-file change. Fixing them on the PR branch would be wasted effort since the branch will not be merged.

Recommendation: close PR #5422. Its work is done — it landed on master via 6c13364c72. I cannot close it (owner-only).

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: unused-exports — stopping for human review

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)

Re-verified live: state unchanged (open, dirty, 4 failed, sha f97735558c). My analysis from the two prior comments stands — the PR's changes are already on master via 6c13364c72 ("picked up from PR #5422"). Rebasing would produce an empty diff; the 4 red shards are on the stale branch base, not on the PR's own change. Not rebasing or fixing — the PR is redundant. Awaiting owner to close.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] auto-fix stalled: unused-exports — stopping for human review

@ranxianglei
ranxianglei force-pushed the 2026-11-01_treemap-dark-mode branch from f977355 to e1f31ad Compare November 13, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式

1 participant