Repository navigation
Commit a10987a
feat(studio): the object Settings tab speaks business language, keys as small print, developer options last (#36540)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9GNMYnbm5cgRkMqUGpXobrR)_
Fixes #36512
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用 Studio 改对象的人,在对象的「设置」页签上会看到:标题改成了业务说法,页面上不再出现 ADR
编号;设置项旁边用灰色小字标出键名,可以选中复制;内部名称、默认谁能访问、额外需要的权限移到页面最下面的「开发者选项」,默认展开。
- 属于「Studio 的保存方式和用词」专题,是其中「设置页说业务话」这一张卡,解决管理员看不懂设置页的问题。
- 改的只是文字和摆放位置,每个设置的含义和保存的内容都没有变;如果有措辞不妥,只影响显示,可以直接撤回。
- 无。
## What changes
The object Settings tab in Studio is now in two parts, and its wording
is written for people who do not know the platform's internals.
- **Business settings first.** Basics (label, plural label, icon and
colour, description), who can see which records, how records are shown
(record name field, stage field, highlight fields, record page tabs),
and features.
- **"Developer options" last.** Expanded, with no switch. It holds the
internal name (read-only once the object exists), who can open the
object by default (`access.default`) and the extra permissions it
requires (`requiredPermissions`). Both parts are the one object
inspector, mounted twice through a new optional `split` prop on
`MetadataDefaultInspectorProps`. Without `split`, every other host of
that inspector draws the whole panel, as before, with no key small
print.
- **Keys as small print.** Each setting's title has lost its
parenthesised key (`(nameField)`, `(enable.*)`, …). The key it writes is
drawn beside the title as small grey monospace text, and one click
selects all of it. The key sits outside the control's `label`, so
selecting it neither opens a picker nor flips a switch, and each
control's accessible name is its title alone. Pickers are now named
through `label htmlFor`.
- **No ADR numbers or rule codes.** `ADR-0085`, `ADR-0056/0090`,
`ADR-0090 D1`, `security-owd-unset` and `(master-detail)` are gone from
the tab's strings, in both `en` and `zh`. The studio namespace ships
only those two catalogues (`STUDIO_LANGUAGE_CODES`); every other
language falls back to `en`, so there is no other language file to sync.
- Saved content and what each setting means are unchanged. The other
tabs (Validations, Hooks, Actions, API) are untouched.
### The three rewrites (card item 4)
| Row | Before (en / zh) | After (en / zh) |
|---|---|---|
| Internal name: title | Name / 名称 | Internal name / 内部名称 |
| Internal name: hint | snake_case unique identifier (cannot change
after create) / snake_case 唯一标识符(创建后不可修改) | The name code and the API
use: lowercase letters, digits and underscores only. It cannot be
changed once the object is created. /
代码和接口里使用的名称,只能用小写字母、数字和下划线;对象建好后不能修改。 |
| Default access: title | Exposure posture / 暴露姿态 | Who can open it by
default / 默认谁能访问 |
| Default access: options | Public — covered by wildcard grants
(default) · Private — needs an explicit grant / 公开 — 被通配授权覆盖(默认) · 私有 —
需要显式授权 | Standard — anyone with access to all objects (default) ·
Restricted — only people granted this object by name / 标准 ——
能访问全部对象的人都能访问(默认) · 受限 —— 只有被单独授权访问本对象的人 |
| Default access: hints | Covered by a permission set's "*" wildcard
grant — the platform default for business objects. · Not covered by "*"
wildcard grants: only an explicit grant on this object (or View/Modify
All Records) reaches it. … | Anyone whose permission set grants access
to all objects can open this one — the usual choice for business
objects. · A permission set that grants all objects does not include
this one: only a permission set that names this object (or one that can
view or modify all records) reaches it. … |
| Extra permissions: title | Required capabilities / 必需能力 | Extra
permissions required / 额外需要的权限 |
| Extra permissions: hint | AND-gate: callers must hold every listed
capability IN ADDITION to their CRUD grants. Comma-separated capability
names (e.g. manage_platform_settings). A name no permission set grants
fails closed at runtime. / AND 门:调用者除 CRUD 授权外,还必须持有列出的每个能力。… | On top
of their permission to view, create, edit or delete this object, a user
must hold every permission listed here. Enter permission names separated
by commas, such as manage_billing. A name no permission set grants turns
everyone away. /
除了对象本身的查看、新建、编辑、删除权限,用户还必须具备这里列出的每一项权限才能使用这个对象。填写权限名,多个用逗号分隔,如
manage_billing。没有任何权限集授予的权限名会让所有人都被拒绝。 |
| Access section hint | Exposure posture and capability requirements.
Enforced server-side by the security engine. / 暴露姿态与能力要求,由安全引擎在服务端强制。 |
Who can open this object by default, and which extra permissions they
need. Enforced on the server. / 谁默认能访问这个对象,以及还需要哪些额外权限;由服务端强制执行。 |
### Other section titles and hints
| Before (en / zh) | After (en / zh) |
|---|---|
| Semantic roles — Applied consistently across forms, lists and detail
pages (ADR-0085) / 语义角色 — 跨表单 / 列表 / 详情统一生效(ADR-0085) | How records are
shown — Forms, lists and record pages all show records this way /
记录的显示方式 — 表单、列表和记录页都按这里的设置显示记录 |
| Who can see which records — Baseline record visibility applied before
positions and sharing rules (ADR-0056/0090) | … — The starting point for
who sees records; positions and sharing rules can open access further /
记录可见范围的起点;岗位和共享规则在此基础上再放宽 |
| Sharing model (sharingModel) — … / 共享模型(sharingModel)—— … | Sharing —
who can see and edit records someone else owns / 共享方式 —— 谁能查看和编辑别人负责的记录
|
| Not set — publishing this object is REFUSED (security-owd-unset). The
runtime does fall back to "Only the owner can see" (ADR-0090 D1), … |
Not set — publishing this object is refused. Left unset, it behaves as
"Only the owner can see", but this has to be a deliberate choice, not a
blank. … |
| Record visibility is inherited from the parent (master) record through
its master-detail relationship. / …通过主从(master-detail)关系继承自父级(主)记录。 |
Who can see a record follows the parent record it belongs to, through
its master-detail relationship. / 谁能看到这条记录,跟随它所属的主记录(经主从关系)。 |
| Record name field (nameField), Lifecycle field (stageField), Highlight
fields (highlightFields), Record page tabs (relatedLists) | Record name
field, Stage field, Highlight fields, Record page tabs (key as small
print) |
| Capabilities (enable.*) — Record-page features — every switch here is
enforced by the runtime | Features — Turn record-page features on or off
for this object; every switch really takes effect / 功能开关 —
为本对象打开或关闭记录页上的功能;每个开关都会真正生效 |
| Field change history (trackHistory), Attachments (files), Comments &
feed (feeds), Activity timeline (activities), Global search
(searchable), Cloning (clone) | the same without the key; Cloning
becomes "Duplicate records" / 复制记录, matching the record page's Duplicate
/ 复制 action |
| (new) | Developer options / 开发者选项 — The name code and the API use, and
who can open this object / 代码和接口使用的内部名称,以及谁能访问这个对象 |
"tenant" in the sharing descriptions now reads "organization" / 组织. "Not
declared" now reads "Not set" / 未设置.
### Keys changed (studio namespace, `en.ts` and `zh.ts`)
- `engine.studio.settings.`: `semanticRoles`, `semanticHint`,
`nameField`, `stageField`, `highlightFields`, `undeclared`,
`relatedLists`, `relatedListsUndeclared`, `sharingHint`, `sharingModel`,
`sharingDescUnset`, `sharingDescPrivate`, `sharingDescPublicRead`,
`sharingDescPublicReadWrite`, `sharingDescControlledByParent`,
`capabilities`, `capabilitiesHint`, `capTrackHistory`, `capFiles`,
`capFeeds`, `capActivities`, `capSearchable`, `capSearchableDesc`,
`capClone`, `capCloneDesc`; added `developer`, `developerHint`.
- `designer.object.`: `name`, `nameHint`, `section.accessHint`,
`posture`, `posture.public`, `posture.private`, `posture.publicHint`,
`posture.privateHint`, `reqPerms`, `reqPerms.hint`. The object inspector
draws these wherever it is mounted, so the Studio create-object and
bundle-item editors read the new wording too.
### Everything the tab draws (card item 5)
- **The tab's own catalogue** (`engine.studio.settings.*`, including
HighlightFieldsEditor and RelatedListsEditor: add pickers,
unlisted/undeclared notes, the preview, badges and column editor):
cleaned as above. The two sub-editors needed no code change. Their only
same-class text was `undeclared` and `relatedListsUndeclared` ("Not
declared"), now "Not set".
- **The object inspector** (`designer.object.*`): cleaned as above.
- **Runtime-assembled, kept on purpose:** picker options drawn as `Label
(field_name)` and related-list add options as `Label (entry)`, and the
mono names on highlight and related-list rows. These are field and
relationship VALUES that tell same-labelled entries apart, not titles.
- **Runtime-assembled, out of this PR:** the spec's controlled_by_parent
refusal (see Acceptance notes).
## Tests
- New pin `ObjectSettingsPanel.businessWording-36512.test.tsx` (14
cases; the real object inspector is registered).
- The en and zh catalogues carry no ADR number, rule code, "snake_case",
"AND-gate", "wildcard" or parenthesised key in the tab's keys (floor: 60
keys).
- The rendered tab shows no ADR text in en-US or zh-CN.
- All 19 keys are drawn as select-all mono small print, outside any
label.
- Each picker, switch and the internal-name input is named by its title
alone.
- A click on a key writes nothing.
- Developer options is the last section, has no disclosure control, and
holds the read-only name, posture and required permissions. The business
rows are not in it, and each row is drawn once.
- A posture pick writes the same patch as before.
- Without `split`, the inspector draws the whole panel and no key small
print.
- Updated pins:
- `ObjectSettingsPanel.test.tsx`: the unset-sharing warning now asserts
the rule code is absent; it used to assert it was present.
- `ObjectDefaultInspector.test.tsx` and
`ObjectDefaultInspector.sharedSelect-11865.test.tsx`: the new label and
option text. The latter also gained the collection-time CEL imports
`check:test-source-alias` asks of an edited pin.
- Ablations, each run once after committing, mutation and restore
checked on disk with `scripts/ablation-replace.mjs` (restore: blob
equals HEAD, `git diff HEAD` empty):
- Key moved inside the capability title label: 2 of 9 cases red.
- Developer mount given `part: 'business'`: 5 of 14 cases red.
<details><summary>Readings (head e735eb1, origin/main
316f757)</summary>
- `pnpm --dir ui exec vitest run --maxWorkers=2` over
ObjectSettingsPanel*, ObjectPanels*, DataPillar*, StudioDesignSurface*,
the metadata-admin inspectors and the i18n studio-namespace suite, then
`type-check` of `@object-ui/app-shell` and `@object-ui/i18n`, at
add42cd: Test Files 421 passed (421), Tests 4494 passed, 1 skipped;
lock VERDICT command-exit 0. Rerun at e735eb1 for the two pins it
touched: 2 files, 25 tests passed.
- Clause-② measured on the build declaration closure:
`@object-ui/app-shell` `dist/index.d.ts` exports nothing from
`default-inspector-registry` (the only mention among entry-exported
modules is a doc comment in `preview-registry.d.ts`), so the new `split`
prop is not on the published face. The studio catalogues are declared as
a string-to-string record in `dist/namespaces/studio/en.d.ts`, so the
two added keys move no type.
- eslint on the touched files: 0 errors; 1 warning, which was already on
main (`no-explicit-any` in the inspector's spec feature-detect).
</details>
## Acceptance notes
- The `controlled_by_parent` refusal from the spec still cites `ADR-0055
§1` in this one state: sharing set to "Follows its parent record" on an
object with no usable master-detail field. The tab shows the save door's
words verbatim, by design (objectui#12326), and the text lives in
`packages/spec`. carrier: #36526
- A host that registers its own object default inspector, one that does
not read `split`, would have its whole panel drawn on both mounts of
this tab. No such registration exists in this repository. The built-in
one is the only object inspector here.
- Screenshots: before and after, full page, en and zh, on the showcase
`showcase_account` object, which is read-only there as a code-installed
package. They are at `/mnt/project-files/objectstack-seat2/36512-shots/`
(`36512-settings-{before,after}-{en,zh-CN}.png`). A page-text scan
counted 2 "ADR" hits before and 0 after, in both languages.
## Verification
**Read first** (by risk):
1.
`ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectDefaultInspector.tsx`
— the split: `KeyedTextField` and `RowTitle` must draw exactly what they
drew before when no key is passed.
2.
`ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx`
— the second mount and the `SettingKey` placement outside labels.
3. `ui/packages/i18n/src/namespaces/studio/zh.ts` — the Chinese wording.
**Two-minute check:** `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/ObjectSettingsPanel.businessWording-36512.test.tsx`
should report 14 passed. Or open any object's Settings tab in Studio:
"Developer options" is the last section, and every title has its key in
small grey text beside it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmQD4KwKe5BckFpeiuB
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 96b7975 commit a10987a
10 files changed
Lines changed: 626 additions & 181 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- metadata-admin
- inspectors
- studio-design
- i18n/src/namespaces/studio
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
45 | | - | |
| 49 | + | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
| 316 | + | |
| 317 | + | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
0 commit comments