Repository navigation
fix(console): a deployment-level settings value set here reads Modified and offers Reset to default - #30428
Conversation
…lue (red first) Claude-Session: https://claude.ai/code/session_01Utp6CaTSNwaf1AMz4qR7Fs Co-authored-by: Claude <noreply@anthropic.com>
…ed and offers Reset to default Claude-Session: https://claude.ai/code/session_01Utp6CaTSNwaf1AMz4qR7Fs Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CaTSNwaf1AMz4qR7Fs Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CaTSNwaf1AMz4qR7Fs Co-authored-by: Claude <noreply@anthropic.com>
|
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2 Contract reviewServed-tier: Reviewed 2026-11-05T11:01Z. Face. This review covers the ① Derived judgments
② Semver levelThe changeset sets ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:ui#2 · os-bill · session_01Utp6Cb5R6JDdfyvtj3dPR2 维护者速读
席位核对 — ACCEPT · domain:ui#2 · head
|
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.sourceBadgeModifiedandconsole.settingsView.defaultValueHint(with{{value}}).Metadata-protocol: none
维护者速读
scope: 'global',如 Setup 的认证页)上管理员自己改过的值,徽标从「继承自全局」改为「已修改」,旁边写出默认值(如「默认:8」,选项显示选项名、开关显示是/否、密码从不显示),并提供「恢复默认」;点了以后照常要按保存才生效。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:
SettingsViewpasses each rowwriteScope, the scope its Save writes, resolved exactly as the server resolves it inregisterManifest: the specifier'sscope, else the manifest's, else the spec defaulttenant(SettingsManifestSchemadeclaresscope: SpecifierScopeSchema.default('tenant')). The served manifest is the registered one unparsed, so an absentscopeis the server'stenanttoo.sourceBadgeOfreturns a newmodifiedbadge when the effective layer isglobaland the row'swriteScopeisglobal; any otherglobalorenvvalue still readsInherited from …. Thetenantanduserarms are unchanged, so the organization and user pages keep theirOverrides …badges.modifiedrow showsModified(已修改), the default layer's value from the server'scascadeChainasDefault: 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.nullpath: Save sendsnulland the badge follows the server's answer.resolved.locked) gets no badge and no Reset, as before.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/main6fa842a:sourceBadgeOfreturnedinheritedfor every effective scope other thandefault,userandtenant.badge.kind === 'overrides'.GET /api/settings/:namespaceserves the manifest withscopeon it and on each specifier, and the server's write scope per key isspec.scope ?? manifest.scope ?? 'tenant'(registerManifestinservice-settings). No server change was needed, andpackages/**is untouched.OverridesandInheritedpins in the same file pass unmodified, and the new describe adds ascope: 'tenant'specifier on a global manifest as a control.Tests
New top-level describe
a value set on a deployment-level page (objectstack#30329)inSettingsView.unsetAndReset-13145.test.tsx, the existing reset harness: the whole page over a stubbedfetchand the real../api, so the PUT body is read as it leaves the client.Inherited from, readsModifiedandDefault: 8, Reset empties the box and dirties the page, Save sends exactly{"password_min_length":null}, and after the re-read the row shows8with no badge and no Reset.Default: No, and a global select names its option labelDefault: Lax, each with Reset.scope: 'tenant'key on the global manifest offer no Reset; the tenant key still readsInherited from; the page carries exactly three Resets.Readings
Tests 3 failed | 6 passed (9). The first case failed onInherited frombeing present, the second onModifiedmissing, the third on the Reset count (0 instead of 3); every existing case passed.12after Reset (expected '12' to be ''), which is the number-control fix above. ThenTests 9 passed (9).pnpm --dir ui exec vitest run apps/console/src/pages/settings/ packages/i18n/(every settings test, the timezone prompt that also rendersSettingsFieldincluded, and the i18n pack parity tests), on b001f22 after mergingorigin/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.no-explicit-anywarnings, all on lines this PR does not add (one fewer inSettingsField.tsxthan 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.mjsand its self-test included).Acceptance notes
Overrides Defaultfor a value set there, while the deployment page now readsModified · Default: VALUE. That is what the dispatch asked (keep their badges); bringing the other pages to the same wording is a separate choice.nulland 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.tsxGenerated by Claude Code