Repository navigation
feat(web): detailed visual config form over the raw JSON editor (#1748) - #1752
ranxianglei wants to merge 2 commits into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1704-pr.1752.153b96dThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1752.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…ute ids Review fixes for the visual config form (review of this PR): 1. Default-on bool controls could not be disabled: collectValue deleted the key when a switch was unchecked, but for fields whose config default is ON (absent key = on) that leaves the feature on — and the switch rendered unchecked while the effective state was on. Mark those 12 fields with def: true (log, compress.injectTool/injectNudge/tiers/visibilityMarkers, autoUpdate, advisoryCheck, maskHosts, subagentSplit, resumeInheritance, chainContentDetection, mitm.enabled), render the switch checked for an absent key, and write an explicit false when turned off. Default-off fields keep the delete-key semantics. 2. Route control ids were index-based (cf_r_<i>_<f>): addRoute re-sorts and removeRoute splices routeKeys before re-rendering, so snapshot/restore by id shifted unsaved edits onto the wrong provider rows. Ids are now key-stable via routeCtrlId(key, f). 3. Drop the orphaned en-only i18n key toast.passthrough_cleared left behind when this PR removed its only consumer (the standalone passthrough card). Adds regression tests pinning the def-marked field set, the render/collect semantics, and the key-stable route ids.
[bot] 🏷 Review 完成 — 方向正确,发现并直接修掉了 2 个表单缺陷(已补 commit ① 原 issue(#1748)方向:要的是 web 配置页面按钮化、点一点就能改、保留原 JSON 高级编辑。PR 完全对题——每个已知字段一个控件、按 server/compress/update/behavior/advanced/providers/other-keys 分组,raw JSON editor 原样保留作 escape hatch。✅ ② 回归审查(diff 触碰路径的既有行为清点):
③ 代码审查 — 发现 2 个真实缺陷,已直接在 PR 分支修掉(commit
另顺手清理:en i18n 残留孤儿键 ④ 测试有效性:新增 ⑤ diff 整洁度:单 commit、6 文件、每行都与 #1748 相关,无跑题内容。✅ 行为变更(flagged,均为新表单自身,无存量行为漂移):
CI:新 head 小观察(不修,留档): 一句话中文摘要:审查了 web 可视化配置表单 PR,修了两个缺陷——12 个默认开启的 bool 开关原来关不掉(关=删 key 仍保持开启)、增删 provider 时未保存的编辑会错位到别的行——已在 PR 分支补 commit 并加了回归测试,待 CI 转绿即可合并。 |
[bot] 🏷 补充:新 head |
What
#1748 — web 页面配置按钮化。The config page now renders a detailed visual form covering every field of
~/.config/billion-context/config.json, above the raw JSON editor which is kept as-is as the advanced escape hatch (per the issue: "保留原来的json高级配置").Design
modelContextLimit/maxContextLimit, tool lists, and JSON boxes for sub-objects likeprompts/absorb/ccr/reasoning), update, behavior (passthrough/debug/modelContextLimit/maskHosts/subagentSplit/forkAdoption/resumeInheritance/chainContentDetection/stableSystemAnchor/imageBilling), advanced (promptCache.routing/mitm/compat/claude.nativePort/native.attachExternal), plus a providers section (add/remove routes; per-route models/proxy/compressProtocol/passthrough/direct/imageBilling/compress/compat) and an other-keys section (any unmodeled top-level key gets its own JSON box).{file}. Unmodeled keys at every level survive byte-for-byte (pinned by test). The form never invents values for what it doesn't model.GET /__bili/confignow includes read-onlyenvForced(dot-path → env var names) computed from the same resolution order assrc/config.ts. Controls whose effective value an env var currently overrides render locked with a badge naming the variable instead of letting a file write silently lose to it.Config surface
No new/renamed/re-semantics'd config fields — the form edits exactly the existing file schema; no new env vars or CLI flags. The only API delta is the additive read-only
envForcedobject in the GET response.Behavior changes (flagged)
GET /__bili/configresponse gainsenvForced(additive; old clients ignore unknown keys).Pre-flight
npm run typecheck— cleannpm test— 3235 pass / 1 fail / 12 skipped; the single failure (issue1452-socket-hardening.test.tsstall-guard timing test) is unrelated to this diff and passes in isolation (full-suite load flake)npm run build— OKtests/web-config-form.test.ts: envForced reporting, whole-file PUT preservation of unmodeled keys, client wiring presence, exact-path env lookup semanticsCloses #1748