Skip to content

[PR] Make compression-tree block fills theme-aware (dark-mode readable) - #5254

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-10-31_5210-node-fill-theme
Open

ranxianglei wants to merge 1 commit into
masterfrom
2026-10-31_5210-node-fill-theme

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

In the session-detail Structure tab, the compression-tree block boxes (b1/b2/b3 …) were unreadable in dark mode: the box background was hardcoded light (#fff / #f2f7ff / …) while the text inside follows the theme (var(--text) / var(--text-muted)), which turns near-white in dark mode → light text on a light box. Reported in #5210 with screenshots of exactly this.

Root cause

src/web/styles.ts set the five .g-node* rect fills to literal light hexes, written assuming a "light canvas" (the #3917 comment even said so). Node text has always been themed. Light mode: dark text, reads fine. Dark mode: text flips light and the hardcoded light fill erases it. Same defect class already guarded for .fd-left / .bd-card by the #4737 test ("must not hardcode white (dark scheme)") — the g-node fills were the one spot that slipped through.

Fix

Made the five fills theme-aware via CSS custom properties defined in all three palettes (light :root, the media-query dark block, the pinned-dark block):

  • Light values kept byte-identical (#fff, #f2f7ff, #f6f3ff, #fffaf0, #f7f8fa) — light mode looks exactly as before.
  • Dark values are raised tints just above the panel canvas (--bg-elev = #161b22), keeping a faint tier hue: base #1c2129, T1 #1a2234, T2 #201e32, T3 #28231c, n #22272e. Both --text and --text-muted now have strong contrast on every fill.

Tier border colors are unchanged (borders read fine on both themes). Also fixed the now-false "on a light canvas" wording in the #3917 comment. Pure CSS + one regression test; no logic / wire / config / persistence change.

Behavior change (intended)

Dark-mode appearance of the tree node boxes only: pale/white boxes → subtle dark tinted boxes. Light mode is byte-for-byte unchanged. That is the point of the fix.

Tests

  • New guard in tests/web-blocks-tree.test.ts: each of the five .g-node* rect rules must resolve its fill to a theme variable (never a hardcoded #hex), and all three palettes must define the five vars — so any scheme silently falling back to a hardcoded fill re-breaks the test.
  • Local on rebased head: tsc --noEmit clean; tests/web-blocks-tree.test.ts 13/13 pass. Full suite runs in CI.

Closes #5210

@ranxianglei ranxianglei changed the title Make compression-tree block fills theme-aware (dark-mode readable) [PR] Make compression-tree block fills theme-aware (dark-mode readable) Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-31_5210-node-fill-theme (d7adcfc)

Latest build — install this exact version

npm install -g billion-context@0.0.9104-pr.5254.c6bc415

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
d7adcfc billion-context@0.0.9104-pr.5254.c6bc415 build
881da1e billion-context@0.0.7193-pr.5254.57fba92 build

Download artifact

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

Install instructions are refreshed on each push.

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
…ment

The theme-aware node-box fills already landed on master via #5417
(6c13364, supersedes this PR's fill changes), leaving the #3917
comment's "on a light canvas" premise false. This rebased commit keeps
only that comment correction from the original head; the duplicate
--node-fill* vars and their test guard were dropped because master's
#5417 fix already ships the equivalent --tm-*-fill vars + guard.
@ranxianglei
ranxianglei force-pushed the 2026-10-31_5210-node-fill-theme branch from 881da1e to d7adcfc Compare November 11, 2026 08:41
@ranxianglei ranxianglei added bug Something isn't working p3 scope/ui labels Nov 11, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Conflict resolved and pushed — new PR head d7adcfced2 (single commit, 1 file, +2/−1).

Why the conflict existed: master already merged the same visual fix — 6c13364c72 (#5417, picked up from PR #5422, commit message explicitly says "supersedes PR #5254 which fixes the same visual defect"). Both fixes rewrite the same five .g-node* rect fill rules and append a guard to the end of tests/web-blocks-tree.test.ts, so they collide by construction. Master's version uses --tm-*-fill var names; this PR used --node-fill*.

Resolution (rebase): rebased PR head 881da1e onto current master dc041dd1ab. Both conflicting files resolved in master's favor — keeping this PR's duplicate vars would leave dead code, and the two test guards assert different var names and cannot coexist. The one piece NOT already on master is kept: the #3917 comment still said "layered block boxes on a light canvas", which became false once #5417 made the fills theme-aware. That wording is corrected now (citing #5417, the change that actually landed). Commit message amended to match the surviving diff.

Verified on the rebased head (targeted, per local-test discipline): tests/web-blocks-tree.test.ts 13/13 pass · tsc --noEmit clean · full build OK (dist import/external checks pass). Full-suite verdict is the remote CI lanes.

Live status (mirror cache, fetched this run @ sha d7adcfced2): 30/30 checks complete — 15 success, 15 skipped (file-gated e2e lanes), 0 failed, 0 pending. Reported merge state is blocked, which with all checks green and no conflict corresponds to branch-protection/human-review requirements, not to a conflict or red CI — merging stays human-only regardless.

Recommendation: the PR's substantive work shipped via #5417; what remains is a one-line stale-comment correction. Owner: merge the micro-residual or close as superseded by #5417 — closing is yours alone to do.

七问(本轮 CI 处理)

  1. 是什么问题:PR 分支与 master 冲突(merge state dirty),自 11-06 merge-guard 首次报警后连续多日未解决。实质是同一视觉缺陷被两条线各修一版,The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 先合入 master。
  2. 什么原因导致的:The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417(6c13364)与本 PR 改的是同五条 .g-node* rect 填充规则 + 同一测试文件末尾追加守卫,只是变量命名不同(--tm-*-fill vs --node-fill*);两边都改同一位置,合并必然冲突。
  3. 影响范围与严重程度:冲突本身只阻塞本 PR 合并数日,无用户可见行为影响;残留改动为一条 CSS 注释,零渲染影响。
  4. 怎么处理的:rebase 到当前 master(dc041dd);两处文件冲突均取 master 侧(避免死代码与双守卫互斥);仅保留未被取代的残留——修正 feat(web): session detail compact structure tab — tier tree, graph view and lazy originals | feat(web): session detail 压缩结构 tab — tier tree, graph view and lazy originals #3917 注释中在 The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 落地后已失真的 "on a light canvas" 表述;重写提交信息使其与实际 diff 一致;force-with-lease 推送(推送前已 fetch 确认远端 head 未变,属本任务明确授权的冲突 rebase 场景)。
  5. 是否有回归问题:逐项审过——浅色模式外观(未动)、深色节点填充(master 的 The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 取值原样保留)、The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 回归守卫(本地 13/13 绿)、typecheck/build 干净。改动仅是 src/web/styles.ts 字符串内一条 CSS 注释,不参与布局。无回归。
  6. 是否破坏缓存:不涉及(纯前端注释,prefix cache/重试/游标无关)。
  7. 是否改了设计方向/引入新配置:均不涉及;无新 env/config/默认值。

收工判定:冲突已解除、无红项,本车道工作完成;剩余动作(合并或关闭)归 owner。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

最终审核结论(当前 head d7adcfced2):PR 的实质内容(五条 .g-node* rect 主题化填充)已由 #5417(6c13364)先行合入 master;rebase 后整个 PR 收敛为一条 CSS 注释措辞修正(src/web/styles.ts,+2/−1)。逐项独立复核如下:无回归,可合并(或直接以 superseded by #5417 关闭——两种处置都成立,取舍归 owner)。

本轮独立验证(自己重做,非引用前楼层):

八问

  1. 是什么问题:本 PR 现为「同一视觉缺陷(css fill on blocks makes them impossible to read. #5210 深色模式树节点盒子不可读)被两条线各修一版」之后的残留——主修复经 The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 先入 master,这里只剩一条过期注释待更正。
  2. 什么原因导致的:原 PR([PR] Make compression-tree block fills theme-aware (dark-mode readable) #5254)与 The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 改同五条填充规则 + 同一测试文件末尾守卫,仅变量命名不同(--node-fill* vs --tm-*-fill);rebase 取 master 侧后,除注释修正外全部被取代。
  3. 影响范围与严重程度:零用户可见影响——改动是 TS 字符串内的一条 CSS 注释,浏览器完全忽略,不参与任何渲染/布局/行为;纯文档准确性问题。
  4. 怎么修复的:rebase 到 master,只保留未被取代的残留(注释措辞),丢弃重复变量与互斥测试守卫(master 的 The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 已提供等价的 --tm-*-fill 变量 + 守卫)。
  5. 是否有回归问题:逐项审过——浅色/深色外观(未动,The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 取值原样保留)、The treemap for Web compression blocks needs to support dark mode. | web 压缩块的树图需要支持暗色模式 #5417 回归守卫(CI 绿)、文件语法(tsc/static gates 绿);CSS 注释不参与渲染。无回归。
  6. 是否破坏缓存:不涉及(纯前端注释,与 prefix cache/重试/游标/去重键无关)。
  7. 是否改了设计方向:不涉及。
  8. 是否引入新配置:不涉及。

进度说明:前两轮运行卡死在工作区依赖安装(工作区无 node_modules,共享机器上全量装依赖/构建长时间无输出);本轮避开本地构建,改用 git 级核对 + 镜像缓存取证,结论如上。

收工判定:审核通过,可合并。剩余动作二选一归 owner:①合并这条微残留(一行注释修正,零风险);②以 superseded by #5417 关闭(旧注释措辞保留,影响可忽略)。本车道工作完成。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p3 scope/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

css fill on blocks makes them impossible to read.

1 participant