fix(view): map document tokens to the active theme

Legacy view tokens (--ink, --fill, --line, --muted) now resolve from the notebook theme. This fixes dark text and white annotation chips on the dark STRUCTURE surface, including function names, binding labels, tables, and the right rail.
This commit is contained in:
cflmy committed 2026-10-18 03:05:29 +08:00
1 parent dbf3f3a14b
commit 81f9ea0072
2 files changed
+23 -1

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
### Fixed
- **view 文档表面与标注 chip**:把旧 view 的 `--ink` / `--fill` / `--line` 等 token 映射到当前主题,修复 STRUCTURE 中 `main`、`内核表 =`、函数名和 annot-chip 深色文字/白色卡片与暗色背景不一致的问题。
- **view 代码对比度**:移除会互相覆盖的 highlight.js 深/浅两套外链样式,改用内置高对比 token 变量;深色代码正文 `#f0f0f0` on `#1e1e1e`(14.6:1),浅色 `#24292f` on `#f6f8fa`(13.8:1);关键词/字符串/注释均使用可读的对比色。
- **view 反向代理兼容**:Notebook / Debug 的 API 与 Debug URL 改为相对路径,可在 `/marqdo-view/...` 路径前缀下工作,便于 Docker 内通过 DSH 同源预览。
- **分支内共同局部变量**:if/else 各臂都赋值的局部变量不再被误提升为必选形参;修复 `# llm` 构造器无端要求 `key`,恢复 agent/llm/ext 全量测试。新增 `branch_else_common_local_is_not_a_param` 回归测试。
+22 -1
View File
@@ -2881,7 +2881,7 @@ body.notebook-page {
--nb-surface-3: #333333;
--nb-border: #3c3c3c;
--nb-border-soft: #2a2a2a;
--nb-text: #d4d4d4;
--nb-text: #f0f0f0;
--nb-strong: #f0f0f0;
--nb-muted: #9d9d9d;
--nb-accent: #0e639c;
@@ -2897,6 +2897,20 @@ body.notebook-page {
--nb-error-bg: #2a0f12;
--nb-error-border: #5a1d1d;
--nb-radius: 6px;
/* Map every legacy view token onto the active theme. This fixes the
document surface and annotation chips without duplicating rules. */
--bg: var(--nb-bg);
--surface: var(--nb-surface);
--ink: var(--nb-text);
--muted: var(--nb-muted);
--line: var(--nb-border);
--line-strong: var(--nb-strong);
--fill: var(--nb-surface-2);
--hover: var(--nb-surface-3);
--focus: var(--nb-accent);
--fail-bg: var(--nb-error-bg);
--ok-bg: var(--nb-surface);
--radius: var(--nb-radius);
background: var(--nb-bg);
color: var(--nb-text);
}
@@ -3192,6 +3206,13 @@ body.notebook-page .doc-table th {
body.notebook-page .doc-table td { color: var(--nb-text); }
/* ── Code cell ─────────────────────────────────────────────────────── */
body.notebook-page .annot-chip:hover,
body.notebook-page .annot-chip.is-focus {
background: var(--nb-surface-3);
}
body.notebook-page .mq-anchor.is-focus {
background: rgba(255,255,255,.08);
}
body.notebook-page .code-card {
display: flex;
flex-direction: column;