Repository navigation
[PR] fix: dsh lane: rename + hide switch for the top-bar Context tab (#4237) - #4238
Conversation
The DSH top-bar tab registered by bili-native ("上下文"/"Context") shares its name with dsh-context's own "Context" tab, and there was no way to rename or hide it (disabling bili-native would kill compression). Per owner ruling on #4237: provide both a rename option and a hide setting on the web settings page; default keeps the current name (zero behavior change).
Config surface (additive, owner-approved in the #4237 thread):
- dsh.contextTab (boolean, default true): false removes only the conversation.view slot registration; compression, settings section, plugin bundle config, Web UI and /acp are all unaffected. Env tier BILI_DSH_CONTEXT_TAB (0/false hides, any other value forces on), env > file > default.
- dsh.contextTabLabel (string, file-only tier): custom tab label; empty/unset = built-in localized label.
Host -> browser carriers reuse the existing __BILI__ snapshot + /bili/origin route (both now carry contextTab/contextTabLabel, read live per call so a web-settings edit lands on next page load without a proxy restart). The client bundle gates the conversation.view registration at apply() time and fails open when the fields are absent (legacy hosts/pages behave byte-identically). Web quick-config page gains a checkbox + text row. Docs: CONFIGURATION.md en+zh, yaml seeds + regenerated tables, LIFECYCLE.md §2.9. Tests: carrier cascade (host), gate + label resolution (client bundle), existing snapshot assertions updated.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g [email protected]This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4238.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 按 标签: dsh、scope/ui、p3(DSH 车道顶栏 tab 的显隐/改名展示开关 + web 设置页控件,属体验级功能实现,不影响可用性) 接单,进入评审:拉取分支与最新 master 对账、通读 diff、盯 CI 结果,随后按八问体例给出评审结论。PR 当前状态:mergeable,但 base 落后于 master(behind),会先核对落后区间是否有交互影响。 |
(ai: vllm-qwen/qwen3.8-27b) Review 完成,结论:可合并(请人工合并)。我没有复用 #4237 线程里的既有分析,独立通读了全部 12 个文件的 diff,并做了本地定向验证 + CI 核对。查重见首条评论(不重复)。 结构化八问
验证证据
PR 虽 behind master,但零文件重叠且 GitHub 判 mergeable,无需强推 rebase。#4237 第三项诉求(并入 dsh-mnemon Memory System 页)涉及跨仓嵌入点,正确声明在范围外。 结论:可合并,请手动合并:#4238 |
📦 Merged Build PublishedThis merge to master was published as npm install -g [email protected] # this exact build
npm install -g billion-context@master # always the newest merged build
|
… built-in tab label Rebased onto master after #4238 merged (contextTab/contextTabLabel knobs shipped). Those changes reference the tab's built-in name as fact; the #4319 rename makes those references stale: - readCtxTabFace comment, web quick-config row labels (zh/en), CONFIGURATION.md/ zh-CN, website config-reference yaml seeds, LIFECYCLE.md: built-in name is now 「压缩代理」/「Compression」, not 「上下文」/「Context」 - tests/dsh-settings-ui.test.ts: the two contextTabLabel fallback pins now expect the renamed built-in label - README Host plugin integration: /bili/origin bodies also carry the #4237 face flags (contextTab/contextTabLabel) — documented as internal, ignore
…n tab label docs-sync drift: the #4238-alignment pass renamed the built-in tab references to 「压缩代理」/「Compression」 in the EN seed, the committed CONFIGURATION.zh-CN.md row and every other surface, but missed the ZH seed desc (still 「顶栏上下文标签页」), so gen-config-docs regenerated a line different from the committed doc. Align the seed with its EN twin and the already-committed ZH doc text.
Closes #4237
What & why
The DSH top-bar tab bili registers (「上下文」/"Context", order 30) shares its name with dsh-context's own "Context" tab (order 20) — two identical labels side by side — and there was no user-side switch: the registration is unconditional and disabling
bili-nativewould stop compression entirely. Owner ruling in the #4237 thread: provide BOTH a rename option and a hide setting on the web settings page; default keeps the current name (no forced rename).Config surface (additive)
dsh.contextTabtrueBILI_DSH_CONTEXT_TAB(0/falsehides; any other value forces on; unset = file tier)dsh.contextTabLabelsrc/agent/dsh-native-client.tswas unconditional (ctx.slots.inject("conversation.view", …)with a hardcoded i18n label); nothing underdsh.*, noui.*section and no env var touched it.ui.*section (rejected — display knobs ride their lane section, cf.pi.subagents; new sections are owner-gated anyway); pure env var (rejected — 彻底整治环境变了滥用,除非必要都走配置文件 #2030: knob = file key resolved through knobs.ts, env-only reserved for six categories); DSH profile config (rejected — host-side, cannot ship from bili). Chosen: two keys in the existingdshsection + one env tier, exposed on the web quick-config page.Behavior change disclosure
Default = zero change: the tab stays visible with its current name unless the user opts in. Opt-in effects:
dsh.contextTab: falseremoves ONLY the top-bar tab — compression, the settings section, plugin bundle config face, Web UI and/acpall keep working (the ledger remains reachable there);dsh.contextTabLabel: "X"renames the tab to X.Both take effect on next page load / dsh restart (slot registration happens at page load). Values flow through the existing
__BILI__snapshot +/bili/originroute, read live per call, so editing the web settings page needs no proxy restart.How it works
src/agent/dsh-native.ts): both carriers now carrycontextTab(+contextTabLabelwhen set), resolved through newsrc/knobs.tsresolvers (env > file > default).src/agent/dsh-native-client.ts):readCtxTabFace()reads the snapshot once at apply(); theconversation.viewregistration is skipped when hidden; label resolves custom → built-in localized fallback.src/web/client.ts+src/web/i18n.ts): checkbox + text row for the two keys.Local targeted runs green: typecheck, tests/dsh-settings-ui.test.ts 20/20, config-surface-guard 5/5, issue2028 warning path 6/6, docs-sync/config-surface/lifecycle guards. Full suite on CI.
Note: merging our tab INTO dsh-mnemon's Memory System page (#4237 ask 3) stays out of scope — it needs an embedding point on the mnemon/host side (cross-repo); tracked in the issue thread.