Skip to content

fix(console): a deployment-level settings value set here reads Modified and offers Reset to default - #30428

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-z0ygsj
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-z0ygsj

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2

Fixes #30329

Clause-②: yes (widening) — two published language-pack keys in all ten built-in packs: console.settingsView.sourceBadgeModified and console.settingsView.defaultValueHint (with {{value}}).
Metadata-protocol: none

维护者速读

  • 改了什么:部署级设置页(清单 scope: 'global',如 Setup 的认证页)上管理员自己改过的值,徽标从「继承自全局」改为「已修改」,旁边写出默认值(如「默认:8」,选项显示选项名、开关显示是/否、密码从不显示),并提供「恢复默认」;点了以后照常要按保存才生效。
  • 为什么改:原来改过的值看上去像是从别处继承来的,也没有恢复默认按钮,想回到默认只能自己记得默认值或清空输入框。
  • 风险与回滚:只动 console 设置页两个文件、十个语言包各加两个键、一个测试文件和 changeset;不动 spec、服务端或元数据。组织级和用户级页面的徽标不变,环境变量锁定的值仍不给恢复。回滚即 revert 本 PR。
  • 先看:ui/apps/console/src/pages/settings/SettingsField.tsx 的 sourceBadgeOf(新增 modified 分支)和 FieldHeader(恢复按钮条件、默认值提示)→ SettingsView.tsx 传入的 writeScope → 测试文件新增的 describe。
  • 两分钟验证:pnpm --dir ui exec vitest run apps/console/src/pages/settings/__tests__/SettingsView.unsetAndReset-13145.test.tsx,预期 9/9 通过(在 main 源码上新加的 3 条失败)。
  • 需要你做的:无,席位落地。

What changes

The card's two Expected bullets, quoted:

  • A value changed here says so, for example 已修改, and names the default.
  • Reset to default is available on it, with Save confirming it as other changes do.
  • SettingsView passes each row writeScope, the scope its Save writes, resolved exactly as the server resolves it in registerManifest: the specifier's scope, else the manifest's, else the spec default tenant (SettingsManifestSchema declares scope: SpecifierScopeSchema.default('tenant')). The served manifest is the registered one unparsed, so an absent scope is the server's tenant too.
  • sourceBadgeOf returns a new modified badge when the effective layer is global and the row's writeScope is global; any other global or env value still reads Inherited from …. The tenant and user arms are unchanged, so the organization and user pages keep their Overrides … badges.
  • A modified row shows Modified (已修改), the default layer's value from the server's cascadeChain as Default: VALUE (默认:VALUE), and Reset to default. The default is spelled as an option's label, Yes or No for a boolean, and never shown for a password or encrypted key or for an object value.
  • Reset is the existing draft null path: Save sends null and the badge follows the server's answer.
  • An env-locked row (resolved.locked) gets no badge and no Reset, as before.
  • The number control now shows an empty box for an unset value. With value={null} React left the last number on screen, so a Reset on a number row (the card's 密码最小长度) looked as if nothing happened. This is the same path the card asks for, in the same file.

PM mechanism assumptions, measured on origin/main 6fa842a:

  • The badge: held. sourceBadgeOf returned inherited for every effective scope other than default, user and tenant.
  • The reset button: held. It rendered only for badge.kind === 'overrides'.
  • The page's scope: the console already had it. GET /api/settings/:namespace serves the manifest with scope on it and on each specifier, and the server's write scope per key is spec.scope ?? manifest.scope ?? 'tenant' (registerManifest in service-settings). No server change was needed, and packages/** is untouched.
  • Locked values: held, unchanged.
  • The org and user pages: unchanged. The existing Overrides and Inherited pins in the same file pass unmodified, and the new describe adds a scope: 'tenant' specifier on a global manifest as a control.

Tests

New top-level describe a value set on a deployment-level page (objectstack#30329) in SettingsView.unsetAndReset-13145.test.tsx, the existing reset harness: the whole page over a stubbed fetch and the real ../api, so the PUT body is read as it leaves the client.

  • A global number value: no Inherited from, reads Modified and Default: 8, Reset empties the box and dirties the page, Save sends exactly {"password_min_length":null}, and after the re-read the row shows 8 with no badge and no Reset.
  • A global toggle names Default: No, and a global select names its option label Default: Lax, each with Reset.
  • CONTROL: an env-locked value, a value at its default and a scope: 'tenant' key on the global manifest offer no Reset; the tenant key still reads Inherited from; the page carries exactly three Resets.
Readings
  • Red first, on test-only commit 753defd (unfixed source): Tests 3 failed | 6 passed (9). The first case failed on Inherited from being present, the second on Modified missing, the third on the Reset count (0 instead of 3); every existing case passed.
  • After the badge change alone, the first case failed on the number box still reading 12 after Reset (expected '12' to be ''), which is the number-control fix above. Then Tests 9 passed (9).
  • pnpm --dir ui exec vitest run apps/console/src/pages/settings/ packages/i18n/ (every settings test, the timezone prompt that also renders SettingsField included, and the i18n pack parity tests), on b001f22 after merging origin/main: Test Files 128 passed (128), Tests 1720 passed | 13 skipped (1733).
  • pnpm exec turbo run type-check --filter=@object-ui/console --concurrency=2: Tasks: 74 successful, 74 total.
  • eslint on the changed ui files: 0 errors; 4 no-explicit-any warnings, all on lines this PR does not add (one fewer in SettingsField.tsx than on main).
  • pnpm check:new-line-citations: 0 new citations.
  • node scripts/pm/dispatch-gates.mjs --ran: 35 derived families, 35 run, 0 NOT-MEASURED, every exit 0 (check-sdui-manifest.mjs and its self-test included).

Acceptance notes

  • The organization and user pages keep Overrides Default for a value set there, while the deployment page now reads Modified · Default: VALUE. That is what the dispatch asked (keep their badges); bringing the other pages to the same wording is a separate choice.
  • A tenant or user key whose default is null and whose own value is set shows no badge and no Reset (no upper layer carries a value). Unchanged here, noted only.

Verification

pnpm --dir ui exec vitest run apps/console/src/pages/settings/__tests__/SettingsView.unsetAndReset-13145.test.tsx


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b001f222b34b36f60367de83adfa77500797c6e1
Local-runs: none

Reviewed 2026-11-05T11:01Z.

Face. This review covers the Clause-②: yes (widening) declaration only: the changeset line and the PR body. The diff touches no packages/spec/src/**, no governed rule text, and no packages/** at all. Nothing is narrowed.

① Derived judgments

  • Two new @object-ui/i18n keys. They are console.settingsView.sourceBadgeModified and console.settingsView.defaultValueHint (with {{value}}). Both are added to all ten built-in packs, and no existing key is renamed or removed. The bundle's published key set gets wider, nothing more. ✔
  • SettingsField gains an optional writeScope prop. It is internal to @object-ui/console, an app and not a library export. A host that omits it gets the badges it had before. The timezone prompt is such a host and is unchanged. ✔
  • The page now sends writeScope = spec.scope ?? manifest.scope ?? 'tenant'. The server resolves the scope the same way, at packages/services/service-settings/src/settings-service.ts:1241-1244 (manifest.scope ?? 'tenant', then spec.scope ?? defaultScope). This is a reading of the server rule, not a second copy of it. ✔
  • sourceBadgeOf returns modified only when the effective layer is global/env and equals writeScope. In practice that means global on a global page, because env is never a page's write scope. An env value still reads as inherited, and it is locked anyway, since resolved.locked suppresses the badge. Org and user pages keep overrides, and a control test pins this. ✔
  • Reset reuses the existing draft null path, and Save sends it. No new write path is added. The default text never names a password/encrypted value or an object. ✔
  • The number box's value now maps null/undefined to ''. This is a display-only fix in the same file, on the same row the card measured. ✔

② Semver level

The changeset sets @object-ui/console: patch and @object-ui/i18n: patch. Both changes are additive with no removal, which matches the repo precedent for Clause-②: yes (widening). Metadata-protocol: none is right: no server or protocol path is touched. ✔

③ Boundary flags

  • os-dev-report 6656289302 names one deviation: the claim's conditional no (yes (widening) if a published i18n key is added) became yes (widening) because two keys were added. That is the condition the claim already named, so no claim correction is owed.
  • The PR author is the relay (objectstack-fleet[bot]).

Implemented-by: claude/project-thread-z0ygsj
Reviewed-by: session_01Utp6Cb5R6JDdfyvtj3dPR2

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2

维护者速读

  • 改了什么: 在 Setup 的部署级设置页(例如「认证」)上,本页改过的值,徽标从「继承自全局」改为显示「已修改」,旁边写明默认值(例如「默认:8」),并提供「恢复默认」。恢复后按「保存」确认,和其他改动一样。另外顺带修了数字框:恢复后不再残留旧数字。
  • 为什么改: 原来管理员改过的值看起来像是从别处继承来的,想回到默认值只能自己记得默认是多少,或者把框清空(Setup settings: a deployment-level value has no Reset to default, and reads as inherited although the administrator set it here #30329)。
  • 风险与回滚: 只改 console 的设置页,外加两个新语言包键。spec 和服务端都不动。被环境变量锁定的值、组织页和用户页的徽标、时区提示都保持不变。回滚即撤销本 PR。
  • 先看: SettingsField.tsx 的 sourceBadgeOf(看 writeScope 的判断)→ SettingsView.tsx 传入 writeScope 的那一行。
  • 两分钟验证: pnpm --dir ui exec vitest run apps/console/src/pages/settings/__tests__/SettingsView.unsetAndReset-13145.test.tsx,预期全部通过。
  • 需要您做的: 无。本 PR 不在受管面,共 297 行;两个新键已过 TIER_DEFAULT 契约复核,结果 PASS(6656318693)。席位会经合并队列落地。
  • 席位意见: ACCEPT。

席位核对 — ACCEPT · domain:ui#2 · head b001f222b34b36f60367de83adfa77500797c6e1

  • 形态: draft,作者 objectstack-fleet[bot](经中继 pr_create),没有 assignee,也没有请求 review。14 个文件,+282 −15。check-governed-merges --pr 30428 判定为 NOT governed,297 行,未超过 3000。
  • 契约复核: 现 head 上已有同形的 TIER_DEFAULT PASS 记录(6656318693),复核面是 Clause-②: yes (widening) 的申报,涉及两个新键 console.settingsView.sourceBadgeModified 和 defaultValueHint,十个语言包都已加上。
  • 前提实测:
    • writeScope 的解析规则是 spec.scope ?? manifest.scope ?? 'tenant',与服务端 settings-service.ts:1241-1244 一致。
    • 只有当生效层恰好是本页写入的 scope 时,才显示 modified。env 生效时仍显示继承,而且锁定时不显示徽标。
    • 恢复走的是现有的草稿置 null 路径。
    • 测试:在 main 上 3 条红,修复后 9/9;settings 加 i18n 共 128 个文件全绿。
  • 门禁 check-runs: b001f222 上 55 个 run:44 success,11 skipped,0 失败。
  • 申报: Clause-②: yes (widening),Metadata-protocol: none;changeset 为 @object-ui/console 和 @object-ui/i18n 的 patch。认领时已写明「加键即 yes (widening)」,所以不需要更正认领。
  • 接受的偏差: 数字框恢复后残留旧值的问题是同一文件、卡片实测的同一行,就地一起修了。
  • 范围外去向: 无。
  • 落地条款: Fixes Setup settings: a deployment-level value has no Reset to default, and reads as inherited although the administrator set it here #30329。由本席位按普通队列在本 head 上执行 pr_ready + automerge_enable,但要先等维护者在席位线程里同意。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 11:31
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 11:31
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit ac56acf Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-z0ygsj branch November 5, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup settings: a deployment-level value has no Reset to default, and reads as inherited although the administrator set it here

1 participant