Repository navigation
Commit 84b1e0c
feat(spec): Studio list columns for 27 metadata types, translated on both doors (#36926)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBDErTg6aA1Xze24mDcUfseY)_
Fixes #36860
> **Held for the maintainer's own review.** This is part (b) of the
card's two-PR split. The whole card measured about 3,530 changed lines,
over the 3,000-line human-review line, so the maintainer ruled that
every part goes to their own review whatever its size: splitting must
not route around it. This PR stays a draft and out of the merge queue
until the maintainer has read it. Part (a), #36881, merged on L1 + L2
before that ruling and is handed to the maintainer with this one.
This part closes the card: the other 26 types, their header translations
in all 11 bundles, the console's own declarations moved into the spec,
and the runtime dispatcher translating the types listing, which folds in
#36886 (the dispatcher answered `/meta/types` in English).
Clause-②: yes (widening: `/meta/types` serves `list` on 26 more entries,
and the runtime dispatcher's listing is now translated)
Metadata-protocol: none
## 维护者速读
- 工作室里 27 类元数据(对象、字段、视图、页面、流程、报表、智能体等)的列表列改由平台规范统一声明,列头按界面语言显示(11
种语言都有译文);经运行时分发器访问的主机,类型列表也不再一律显示英文。
- 属于工作室元数据列表标准化(#36860 的第二部分,第一部分是 #36881):控制台、命令行和 AI 客户端读同一份列定义。
- 影响打开这些列表的管理员;列名和顺序有变化(例如页面列表去掉了不存在的 route 列)。出错时页面退回默认列,合并后可直接撤回。
- 需要你亲自审阅后再决定合并:这一卡总量超过 3,000 行,按你的要求分拆后的每一部分都交你审,本 PR 不进合并队列。
## What changes
- **Registry (`@objectstack/spec`).** `METADATA_LIST_REGISTRY` declares
27 types: the first batch (`hook`, `flow`, `job`, `api`, `action`,
`report`, `dataset`, `email_template`, `assignment_rule`,
`sharing_rule`, `queue`, `agent`, `tool`, `skill`, `doc`, `seed`,
`mapping`, `picklist`, `translation`) and the eight the console declared
itself (`object`, `field`, `view`, `page`, `dashboard`, `permission`,
`position`, `book`). Every column is a key the type's schema declares,
checked by the reconciliation test, whose roster now asserts all 27.
Keys the card proposed that no schema declares were dropped or
corrected, as reported in the card's thread.
- **Headers in every language (`@objectstack/platform-objects`).** The
52 headers no form field already labels get their own
`metadataForms.<type>.fields.<path>.label` leaf, regenerated with `node
scripts/check-i18n-bundles.mjs --write` and translated in all ten
non-English locales. No zh-CN, ja-JP or es-ES leaf echoes the English. A
column the form labels reads the form's words.
- **Both doors translate the listing (`@objectstack/rest`,
`@objectstack/runtime`), #36886.** `translateMetaTypesListing`
(`meta-item-read-gate.ts`) is the one translation of the types listing:
type labels and descriptions, form labels, list headers and schema
titles. `RestServer`'s `GET /meta` now delegates to it, and the runtime
dispatcher's `GET /meta` and `GET /meta/types` call it with the
request's locale and answer through `successWithHeaders` with `Vary:
Accept-Language`, as `RestServer` and the rest of the meta domain do.
Before, the dispatcher served `getMetaTypes()` untranslated, so a zh-CN
reader of a dispatcher-served host got English for all of it.
- **Console (`@object-ui/app-shell`).** `builtinComponents.tsx` and
`anchors.ts` drop their `listColumns` and keep only what the schema
cannot say: a field row's server-stamped `object` (`listExtraColumns`),
a position's holder count and granted permission sets, a view's derived
display type and a book's audience (`listCells`), and a sharing rule's
`sharedWith` rendering plus its `_packageId`. `object` was registered
twice with disagreeing columns (the later won); both declarations are
gone, so the spec's is the only one. A page's former `route` column
named no `PageSchema` key and is dropped.
- **Changelog for what admins see (`@object-ui/app-shell`).** The
changeset names the private console package, which
`.changeset/config.json` versions (`privatePackages.version: true`), and
says what changes on screen: no fixed column widths on the moved lists
(except the view list's display type and the book list's audience), the
Fields list reads name, type, label, then object, the sharing-rule
header reads "Access Level", and the Pages list shows type and
description in place of the dropped route column.
- **Summary cells read an expression's source
(`@object-ui/app-shell`).** The `summary` renderer joined only an
object's scalar members, so a cron schedule, whose `expression` is
served as the `{ dialect, source }` envelope, read `cron · UTC`. An
expression envelope member now contributes its `source`, so a cron job
reads `cron · <expression> · UTC` (the showcase job: `cron · 0 1 * * * ·
UTC`). Any other object member stays out, as before.
- **Echo ledgers (`@objectstack/platform-objects` tests).** The
bare-type ledger reads a type as bare when its catalog entry has no form
`sections`, since a type with no form now carries `fields` for its
column headers; the metadata-form catalog count grows by the 52 header
rows (771 → 823).
- **Docs.** `content/docs/protocol/kernel/i18n-standard.mdx` adds the
list columns row (`resolveMetadataListLabels`), the slot paragraph, and
says all three resolvers run in `GET /meta` on both doors.
## Tests
- `packages/spec/src/system/metadata-list-zod-reconciliation.test.ts`:
the roster assertion grows from `['hook']` to the 27 types (111 passed).
- `packages/lint/src/i18n-walk.metadata-list-columns.test.ts` (new, the
L2 N2 pin on #36881): a column on a type with no form gets its own slot
entry seeded with the header (`job.schedule` → `Schedule`), a dotted
path the form leaves out gets one (`agent` `model.model` → `Model`), a
column the form labels keeps exactly one entry, the form's
(`hook.events`), and every registry column has exactly one entry (4
passed).
-
`packages/runtime/src/domains/meta-types-translation-parity-36886.test.ts`
(new): both dispatcher doors answer zh-CN with the same label, form
label and headers as `RestServer` (`{ label: '钩子', form: '事件', headers:
['名称', '事件'] }`), and both carry `Vary: Accept-Language`, as
`RestServer` does. Controls: an en request, and a host with no i18n
service, answer as declared. Ablations: putting back
`deps.success(result)` reds the zh-CN case (1 failed, 2 passed);
answering the translated body without the header reds the Vary case (1
failed, 3 passed).
- `ui/.../ResourceListPage.servedListColumns-36860.test.tsx`: mounts
each moved list under setup (`?scope=environment`) and checks the served
headers, plus the view list keeping its derived display type through its
console cell override.
## Screenshots (card acceptance, zh-CN)
Taken on a booted `examples/app-showcase`: hooks and flows built from
`9ce7a6d0` (the commits after it until `f2edd9de` change only the
changeset and tests), the Jobs list re-taken on `f2edd9de`, console at
`/apps/setup/metadata/<type>?scope=environment`, browser locale zh-CN.
Stored in the project's shared files under
`objectstack-seat3-ux/36860-shots/`:
- `hook-list-zh.png`: 钩子 (8). Headers 名称 · 显示名称 · 对象 · 事件 · 优先级 · 异步 ·
描述 · 来源. Events read as a list (`beforeInsert, beforeUpdate`), async as
✓ / ×.
- `flow-list-zh.png`: 流程 (33). Headers 名称 · 显示名称 · 类型 · 描述 · 来源. Type
reads as a badge (`autolaunched`, `record_change`, `schedule`,
`screen`).
- `job-list-zh.png`: 后台任务 (1). Headers 名称 · 显示名称 · 调度计划 · 已启用 · 描述 · 来源.
The schedule reads `cron · 0 1 * * * · UTC` (it read `cron · UTC` before
`f2edd9de`, L1 S4), enabled ✓.
Every `GET /api/v1/meta` the console made answered 200 with `Vary:
Accept-Language`. Item labels and descriptions stay in English: they are
the example app's own text, which has no zh translation.
## Acceptance notes
- L2 nits on #36881 carried here: N1 (headers marked localized while the
dispatcher served them untranslated) is closed by the #36886 fold; N2
pin added (above); N3 (`listInclude` prose true only after the position
move) is now true; the reconciliation roster grows.
`@object-ui/app-shell` was first left out of the changeset on that
review's advice, and is back in on this PR's L1 (S3), because
`.changeset/config.json` versions private packages. N7 (the
reconciliation test copies `humanizeFieldPath`) is unchanged.
- #36887 (`GetMetaTypesResponseSchema` declares neither `schema` nor
`form`) is not in this PR; it follows as its own small PR.
- #36886 is folded in without a closing keyword; it is closed by hand
when this lands.
- `report`'s `dataset` header reads `Data Source`, the report form's
label on current `main`.
- Overlap: `node scripts/pm/overlap-check.mjs` against `main` and the
two open PRs sharing files: #36869 (`rest-server.ts`) merges cleanly;
#36802 conflicts in `object-lifecycle-panel-echo-decisions.test.ts`,
where both PRs move the catalog count and add a receipt line. Whichever
lands second resolves it to the sum of both receipts.
## Verification
Read first, by risk:
1. `packages/runtime/src/domains/meta.ts`: the two `getMetaTypes` sites
now translated, and the locale they read.
2. `packages/rest/src/meta-item-read-gate.ts` with `rest-server.ts`:
`translateMetaTypesListing` must answer exactly what
`translateMetaTypesResponse` answered before.
3. `ui/packages/app-shell/src/services/builtinComponents.tsx` and
`anchors.ts`: what the console keeps after the move.
4. Spot-read a bundle, e.g. `zh-CN.metadata-forms.generated.ts`, for the
52 new leaves.
Two-minute check: `pnpm --filter @objectstack/runtime exec vitest run
src/domains/meta-types-translation-parity-36886.test.ts`. Expect 4
passed.
<details><summary>Gates on 2fe89a7 (first round; the rework commits
9ce7a6d, 137ae10, 06064a1 and f2edd9d re-ran the gates they touch,
listed last)</summary>
- `node scripts/pm/dispatch-gates.mjs --ran`: 125 derived, 125 run, 0
NOT-MEASURED, all exit 0. Fixed in this PR along the way:
`check:test-source-alias` (module-top imports in the new tests),
`check:spec-parsed-alias` (`MetadataListCellTypeParsed`) and
`check:engine-double-contract` (ledger rewritten with `--write`). Three
gates first exited 3 on prerequisites and were re-run green after
fetching the plugin-teardown fixture commit and building the packages
that had no dist.
- `check-governed-merges --branch HEAD`: not governed, 2,834 changed
lines (+2,591 / −243), 2,220 of them the 11 generated bundles.
- `tsc --noEmit` is clean for `@objectstack/rest` and
`@objectstack/runtime`. `@object-ui/app-shell` type-check was not
measured locally (the ui workspace deps have no dist); CI's type-check
lane is the verdict.
- Tests: runtime `domains/meta` 2,756 passed; rest meta 2,263; app-shell
`metadata-admin` 222; spec reconciliation 111; lint pin 4; rest list
headers + schema titles 6.
- Rework round 2: `servedListColumns.test.tsx` +
`ResourceListPage.servedListColumns-36860.test.tsx` 17 passed, with a
new case for a served cron envelope and a control for an object member
with no `source`; ablation (back to scalar members only) reds it (1
failed, 10 passed). ESLint clean on both files.
- Rework round: runtime parity test 4 passed; platform-objects
`bare-type-display-echo-decisions` +
`object-lifecycle-panel-echo-decisions` 73 passed (the two files CI's
Test Core (6/10) failed on 99dc6d0); `check-changeset-fixed`,
`check-empty-changeset` and `check-changeset-no-major` (with this body)
exit 0.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufzg7mFFG5b13DcQ93kf
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzg7mFFG5b13DcQ93kf -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 305fe60 commit 84b1e0c
30 files changed
Lines changed: 2641 additions & 246 deletions
File tree
- .changeset
- content/docs/protocol/kernel
- packages
- lint/src
- platform-objects/src/apps/translations
- rest/src
- runtime/src/domains
- spec/src/system
- ui/packages/app-shell/src
- services
- views/metadata-admin
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
577 | 578 | | |
578 | | - | |
579 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
580 | 585 | | |
581 | 586 | | |
582 | 587 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
1088 | 1088 | | |
1089 | 1089 | | |
1090 | 1090 | | |
1091 | | - | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1092 | 1100 | | |
1093 | 1101 | | |
1094 | 1102 | | |
1095 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1096 | 1118 | | |
1097 | 1119 | | |
1098 | 1120 | | |
1099 | | - | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1100 | 1139 | | |
1101 | 1140 | | |
1102 | 1141 | | |
| |||
1420 | 1459 | | |
1421 | 1460 | | |
1422 | 1461 | | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
1423 | 1465 | | |
1424 | 1466 | | |
1425 | 1467 | | |
| |||
2576 | 2618 | | |
2577 | 2619 | | |
2578 | 2620 | | |
2579 | | - | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
2580 | 2639 | | |
2581 | 2640 | | |
2582 | 2641 | | |
| |||
2586 | 2645 | | |
2587 | 2646 | | |
2588 | 2647 | | |
2589 | | - | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
2590 | 2669 | | |
2591 | 2670 | | |
2592 | | - | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
2593 | 2683 | | |
2594 | 2684 | | |
2595 | 2685 | | |
| |||
2666 | 2756 | | |
2667 | 2757 | | |
2668 | 2758 | | |
2669 | | - | |
| 2759 | + | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
2670 | 2777 | | |
2671 | 2778 | | |
2672 | 2779 | | |
2673 | | - | |
| 2780 | + | |
| 2781 | + | |
| 2782 | + | |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
| 2787 | + | |
| 2788 | + | |
| 2789 | + | |
| 2790 | + | |
| 2791 | + | |
| 2792 | + | |
| 2793 | + | |
| 2794 | + | |
| 2795 | + | |
| 2796 | + | |
| 2797 | + | |
2674 | 2798 | | |
2675 | 2799 | | |
2676 | 2800 | | |
| |||
2774 | 2898 | | |
2775 | 2899 | | |
2776 | 2900 | | |
2777 | | - | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
2778 | 2919 | | |
2779 | 2920 | | |
2780 | 2921 | | |
2781 | | - | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
| 2932 | + | |
| 2933 | + | |
| 2934 | + | |
| 2935 | + | |
| 2936 | + | |
2782 | 2937 | | |
2783 | 2938 | | |
2784 | 2939 | | |
2785 | | - | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
2786 | 2961 | | |
2787 | 2962 | | |
2788 | 2963 | | |
| |||
2864 | 3039 | | |
2865 | 3040 | | |
2866 | 3041 | | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
2867 | 3045 | | |
2868 | 3046 | | |
2869 | 3047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
0 commit comments