Repository navigation
Commit 0bf7aaf
fix(platform-objects): the Users identity source reads "Local Account" instead of "Env-Native" (#28543)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X13YDEfngeSnxKczzPZGBXm)_
domain:server#1 · os-project-manager · session_01FEkQ5m3nbb6XEM5CRtHn7i
Refs #27855
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:用户的「身份来源」字段中,本地注册用户(存储值 `env_native`)原来显示 "Env-Native",现在显示
"Local Account",与联合登录的 "IdP-Provisioned"
并列;中文显示「本地账号」,日文「ローカルアカウント」,西班牙文「Cuenta local」。
- 为什么改:管理员在 Setup → Users 看到的是设计文档里的术语,看不懂(#27855 第三条)。
- 风险与回滚:只改选项标签,存储值 `env_native`、默认值和所有读取它的代码都不变。回滚即 revert 本 PR。
-
先看:`packages/platform-objects/src/identity/sys-user.object.ts`(`source`
字段),`packages/platform-objects/src/identity/sys-user-identity-source-label.test.ts`。
- 两分钟验证:`pnpm --filter @objectstack/platform-objects exec vitest run
src/identity/sys-user-identity-source-label.test.ts`,预期 6 passed(在 main
上 5 个红)。
- 需要你做的:通知主题(topic)可读化需要你拍板,平台没有不改字段类型、不改 ui 的纯显示途径,选项和分析见下方 Acceptance
notes;#27855 保持打开。
## What changes
- `identity/sys-user.object.ts`: the `source` (Identity Source) option
`env_native` is labelled **"Local Account"** (was "Env-Native"). Why
this word: the field answers "where does this identity live", and its
other option is "IdP-Provisioned" (held by an identity provider). An
`env_native` user signed up with email and password in this environment,
or is an app end-user, so the identity is a local account of this
environment. The zh-CN object description already calls a user a 用户账号,
so 本地账号 sits beside it. The stored value, the default and the
description are unchanged.
- Translations: `zh-CN` 本地账号 (was 环境本地), `ja-JP` ローカルアカウント (was
環境ネイティブ), `es-ES` Cuenta local (was Nativa del entorno), re-translated
in place in the generated bundles as their header asks.
`en.objects.generated.ts` was regenerated by `node
scripts/check-i18n-bundles.mjs --write --filter=platform-objects`; that
run moved no other line, and none of these leaves has a `source-hashes`
entry to refresh.
- Pin: `identity/sys-user-identity-source-label.test.ts`: the field
stays a `select` over `idp_provisioned` / `env_native` with default
`env_native`; the `env_native` label is "Local Account"; each of the
four bundles carries its word.
- Changeset: `@objectstack/platform-objects` patch.
## Why
Every administrator on Setup → Users read "Env-Native" as a user's
identity source, a term from the provenance design (ADR-0135 D4), not a
business word.
## Acceptance notes
**Not in this PR: the readable notification topic (the card's other
remaining part). It needs a maintainer decision; #27855 stays open.**
The dispatch ruled out a `select` that refuses unknown topics, any type,
storage or value change, and `packages/spec/**` / `ui/**`. Measured at
`origin/main` `35b178bd`, no display-only route reaches the face the
card names (the Notifications list's Topic column):
- `options` parse on any field type, and two readers already honour them
on a text field: the analytics dimension resolver
(`service-analytics/src/dimension-labels.ts`, "never the field's
`type`") and the grid's group header
(`ui/packages/plugin-grid/src/objectGridGrouping.ts`). The list cell
does not: `TextCellRenderer` (`ui/packages/fields/src/index.tsx`) prints
the stored text, and the record title is `titleFormat: '{topic}'`.
- The read-face `widget` hints a text field can promote to are a closed
set of four reference faces (`object-ref`, `recipient-picker`,
`position-ref`, `permission-ref`); none names a topic, and adding one is
`ui/**`.
- A `select` would label known topics and, for an unknown one, the
select cell falls back to `humanizeLabel` (`lead_routing` reads "Lead
Routing"). It would not refuse anything if the field were `readonly`, as
`sys_activity.type` is (the open-vocabulary ruling executed at commit
88b9d74). But it is a type change: a `text` field is a TEXT column and
a `select` falls to the SQL driver's `table.string(name)` (varchar 255),
which the drift differ reports as `narrow_varchar` on existing tables.
The vocabulary, measured: 11 distinct topic literals in this repo (10
`approval.*` in plugin-approvals, plus `collab.mention`), plus the flow
notify node's default `notify` (`io-node-config.zod.ts`, `topic:
z.string()`); hotcrm `a598256` emits 19 more of its own (`lead_routing`,
`deal_stalled`, …). The same key is what administrators type into
`sys_notification_template.topic` and
`sys_notification_preference.topic`, both free text matched against
`sys_notification.topic`.
Options, for the decision record:
- **A.** Make `topic` a readonly `select` over the platform's built-in
topics, following the `sys_activity.type` open-vocabulary pattern. Known
topics read through translatable labels. Unknown topics are stored as
written and drawn humanized. Costs: a type and column change (TEXT to
varchar 255, a destructive drift finding on existing PostgreSQL and
MySQL tables), and a census of the built-in topics that every new
platform topic must extend in four locales.
- **B.** Keep `Field.text` and declare display-only `options` for the
built-in topics. Group headers and analytics would read labels, but the
list cell, the detail and the title stay raw until a ui card teaches the
text cell to read `options`. Until then the declaration is honoured in
only some places.
- **C.** Leave the topic as its key and close the rest of #27855. The
key is what an administrator types into notification templates and
preferences, so on this admin event log it is the value they need to
see.
Recommendation: **C**. Along the four axes:
- Business need: the reach is real (every administrator on
Notifications), but the raw key is the value the admin later types into
templates and preferences.
- Long-term soundness: A buys a p3 label with a storage type change.
- Preventing AI mistakes: A's option list reads as closed to an AI
author, which is exactly what the `sys_activity` ruling had to undo with
a long description. B declares something the main face ignores.
- Startup focus: C adds no catalog, no census and no ui card.
If the maintainer wants the label anyway, A is the honest route, as its
own card with the drift finding handled.
## Verification
Red first on `main` (test commit `cf9f9991` before the fix):
`sys-user-identity-source-label.test.ts` 5 failed, 1 passed. The
stored-value case stayed green, and the red ones received "Env-Native",
环境本地, 環境ネイティブ, Nativa del entorno. Green on this head: 6 passed.
Suites: `@objectstack/platform-objects` 105 files / 1480 tests pass; its
typecheck (tsc, scripts, test-typecheck) passes; `eslint
--no-inline-config packages/platform-objects` exit 0.
Gates at head `7164bb2a`: `dispatch-gates --commands` derived 59
families; all 59 ran and exit 0, and `--ran` reconciles 59 derived / 59
run / 0 NOT-MEASURED. `check-plugin-teardown-shape --self-test` first
answered exit 3 (the shallow clone lacked its fixture commit); after
`git fetch --depth=1` of that commit it exits 0. These include
`check:i18n`, `check:i18n-stale-fill`, `check:dual-build-cjs-loads`
(after a full non-ui workspace build) and `check:type-check-debt`.
`git merge-tree` against the one open PR touching these bundles or this
object file (#28525, head `b0284131`) merges clean.
Skills-docs: none — labels only; no published skill names the
"Env-Native" label.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (scoped to
`packages/platform-objects`; the repo-wide run is CI's).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FEkQ5m3nbb6XEM5CRtHn7i
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 76b4ae4 commit 0bf7aaf
7 files changed
Lines changed: 71 additions & 5 deletions
File tree
- .changeset
- packages/platform-objects/src
- apps/translations
- identity
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1174 | 1174 | | |
1175 | 1175 | | |
1176 | 1176 | | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
1177 | 1180 | | |
1178 | 1181 | | |
1179 | 1182 | | |
| |||
1182 | 1185 | | |
1183 | 1186 | | |
1184 | 1187 | | |
1185 | | - | |
| 1188 | + | |
1186 | 1189 | | |
1187 | 1190 | | |
1188 | 1191 | | |
| |||
0 commit comments