Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/36860-metadata-list-columns-batch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@objectstack/spec': patch
'@objectstack/rest': patch
'@objectstack/runtime': patch
'@objectstack/platform-objects': patch
'@object-ui/app-shell': patch
---

feat(spec): Studio list columns for 27 metadata types, served in the reader's language on both doors

Clause-②: yes (widening: `/meta/types` serves `list` on 26 more entries, and the runtime dispatcher's listing is now translated)
Metadata-protocol: none

`METADATA_LIST_REGISTRY` now declares the Studio list columns of 27 metadata 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 types the console used to declare itself (`object`, `field`, `view`, `page`, `dashboard`, `permission`, `position`, `book`). Every column names a key the type's schema declares, checked by the reconciliation test. Nothing an author writes changes: the registry is the spec's own constant.

- **Headers in every shipped language.** The 52 headers no form field already labels get their own `metadataForms.<type>.fields.<path>.label` leaf in the 11 platform bundles (`@objectstack/platform-objects`), translated in all ten non-English locales. A column the form labels reads the form's words.
- **Both doors translate the listing.** The runtime dispatcher's `GET /meta` and `GET /meta/types` now answer the types listing in the request's language, as `RestServer`'s `GET /meta` does: type labels, form labels, list headers and schema titles. Both run one function, `translateMetaTypesListing` (`@objectstack/rest`). Before this, a host served through the dispatcher answered all of it in English.
- **The console's own declarations move into the spec.** Studio's lists of objects, fields, views, pages, dashboards, permission sets, positions and books read the served columns. The console keeps only what the schema cannot say: a field row's server-stamped `object`, a position's holder count and granted permission sets, a view's derived display type, a book's audience and a sharing rule's `sharedWith` rendering. The console declared `object`'s columns twice, in two registrations that disagreed (the later one won); both declarations are gone, so one remains, in the spec. A page's former `route` column named no `PageSchema` key and is dropped. What an admin sees in Studio (`@object-ui/app-shell`): the metadata lists of all 27 types show the spec's columns, in the declared order, with headers in the reader's language. The moved lists lose the console's fixed column widths (the view list's display type and the book list's audience keep theirs), the Fields list reads name, type, label, then object, the sharing-rule list's header reads "Access Level" where it read "Access", and the Pages list shows type and description in place of the dropped route column. A summary cell reads an expression member as its source, so the Jobs list's schedule shows a cron job's expression (`cron · 0 2 * * * · UTC`), not only its kind and time zone.
9 changes: 7 additions & 2 deletions content/docs/protocol/kernel/i18n-standard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,14 @@ through the one the renderer reads for that node:
|:---|:---|:---|
| a form field, a composite's child | `FormFieldSpec.label` / `helpText` / `placeholder` | `resolveMetadataFormLabels(form, type, bundle, opts)` |
| a property of a repeater row (a table column header) | the JSON Schema `items.properties[k].title` | `resolveMetadataFormSchemaTitles(schema, type, bundle, opts)` |
| a column of the type's Studio list (`METADATA_LIST_REGISTRY`) | the served `list.columns[].label` | `resolveMetadataListLabels(list, type, bundle, opts)` |

Both run in `GET /api/v1/meta`, which serves every type's `form` and `schema`
already localised for the request's locale; a client deriving the schema itself
A list column reads the field slot of its own path, so a column and the form
field of the same key read the same words. `os i18n extract` emits that slot for
a column path the form does not declare, with the column's header as the source.

All three run in `GET /api/v1/meta`, which serves every type's `form`, `list`
and `schema` already localised for the request's locale; a client deriving the schema itself
with `z.toJSONSchema` applies the second one to its own copy, over a bundle it
carries itself. Only `label` crosses over to the schema (as `title`); `helpText`
and `placeholder` stay on the form.
Expand Down
52 changes: 52 additions & 0 deletions packages/lint/src/i18n-walk.metadata-list-columns.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* objectstack#36860 — `walkMetadataForms` emits the form field slot
* `metadataForms.<type>.fields.<path>.label` for every Studio list column
* (`METADATA_LIST_REGISTRY`), so the server can translate each header.
*
* - a column whose path the type's form does not label (a type with no form,
* or a path the form leaves out) gets its own entry, seeded with the
* column's header;
* - a column the form already labels keeps the form's entry, so the slot
* holds one English source;
* - every column of every type has an entry, so no header reaches a reader
* untranslatable.
*/
import { describe, it, expect } from 'vitest';
import { METADATA_LIST_REGISTRY } from '@objectstack/spec/system';
import { collectExpectedEntries } from './i18n-walk.js';

const entries = collectExpectedEntries({}, { warnedGroups: new Set() });
const slot = (type: string, path: string) =>
entries.filter((e) => e.path.join('\u0000') === ['metadataForms', type, 'fields', path, 'label'].join('\u0000'));

describe('list column headers are walked into the form field slot (objectstack#36860)', () => {
it('a column on a type with no form gets its own entry, seeded with the header', () => {
const [entry] = slot('job', 'schedule');
expect(entry).toBeDefined();
expect(entry.sourceValue).toBe('Schedule');
});

it('a dotted column path the form does not label gets its own entry', () => {
const [entry] = slot('agent', 'model.model');
expect(entry).toBeDefined();
expect(entry.sourceValue).toBe('Model');
});

it('a column the form already labels keeps one entry, the form field\'s', () => {
const found = slot('hook', 'events');
expect(found).toHaveLength(1);
expect(found[0].source).toBe('metadataFormField');
});

it('every column of every declared list has an entry at its slot', () => {
const missing: string[] = [];
for (const [type, list] of Object.entries(METADATA_LIST_REGISTRY)) {
for (const column of list.columns) {
if (slot(type, column.field).length !== 1) missing.push(`${type}.${column.field}`);
}
}
expect(missing).toEqual([]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1088,15 +1088,54 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
seed: {
label: "البيانات الأولية",
description: "بيانات تجهيز / تهيئة تُطبَّق عند النشر"
description: "بيانات تجهيز / تهيئة تُطبَّق عند النشر",
fields: {
object: {
label: "الكائن"
},
mode: {
label: "الوضع"
}
}
},
picklist: {
label: "قائمة الاختيار",
description: "قائمة خيارات مشتركة تشير إليها حقول الاختيار بالاسم"
description: "قائمة خيارات مشتركة تشير إليها حقول الاختيار بالاسم",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
options: {
label: "الخيارات"
},
description: {
label: "الوصف"
}
}
},
mapping: {
label: "تعيين الاستيراد",
description: "تعيين حقول قابل لإعادة الاستخدام للاستيراد/التصدير (إعادة تسمية + تحويلات)، يُشار إليه بالاسم عند الاستيراد"
description: "تعيين حقول قابل لإعادة الاستخدام للاستيراد/التصدير (إعادة تسمية + تحويلات)، يُشار إليه بالاسم عند الاستيراد",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
targetObject: {
label: "الكائن الهدف"
},
mode: {
label: "الوضع"
},
sourceFormat: {
label: "تنسيق المصدر"
}
}
},
view: {
label: "طريقة العرض",
Expand Down Expand Up @@ -1420,6 +1459,9 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
"sharing.lockedBy": {
label: "مقفل بواسطة",
helpText: "المستخدم الذي قفل تهيئة طريقة العرض"
},
object: {
label: "الكائن"
}
}
},
Expand Down Expand Up @@ -2576,7 +2618,24 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
}
},
job: {
label: "مهمة خلفية"
label: "مهمة خلفية",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
schedule: {
label: "الجدول الزمني"
},
enabled: {
label: "مُفعَّل"
},
description: {
label: "الوصف"
}
}
},
datasource: {
label: "مصدر البيانات"
Expand All @@ -2586,10 +2645,41 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
api: {
label: "نقطة نهاية API",
description: "عنوان HTTP ثابت تستدعيه الأنظمة الأخرى لتشغيل تدفق أو للعمل مع السجلات في التطبيق"
description: "عنوان HTTP ثابت تستدعيه الأنظمة الأخرى لتشغيل تدفق أو للعمل مع السجلات في التطبيق",
fields: {
name: {
label: "الاسم"
},
method: {
label: "الأسلوب"
},
path: {
label: "المسار"
},
type: {
label: "النوع"
},
"objectParams.object": {
label: "الكائن"
},
"objectParams.operation": {
label: "العملية"
}
}
},
translation: {
label: "الترجمة"
label: "الترجمة",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
locale: {
label: "اللغة"
}
}
},
email_template: {
label: "قالب البريد الإلكتروني",
Expand Down Expand Up @@ -2666,11 +2756,45 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
doc: {
label: "الوثائق",
description: "صفحة مساعدة مكتوبة بصيغة Markdown تشحنها حزمة أو تكتبها بنفسك"
description: "صفحة مساعدة مكتوبة بصيغة Markdown تشحنها حزمة أو تكتبها بنفسك",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
group: {
label: "المجموعة"
},
tags: {
label: "الوسوم"
},
description: {
label: "الوصف"
}
}
},
book: {
label: "كتاب الوثائق",
description: "جدول محتويات يجمّع صفحات المساعدة في أقسام مرتبة"
description: "جدول محتويات يجمّع صفحات المساعدة في أقسام مرتبة",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
audience: {
label: "الجمهور"
},
groups: {
label: "المجموعات"
},
description: {
label: "الوصف"
}
}
},
permission: {
label: "مجموعة الأذونات",
Expand Down Expand Up @@ -2774,15 +2898,66 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
sharing_rule: {
label: "قاعدة المشاركة",
description: "قاعدة تعلنها حزمة لمشاركة السجلات؛ وتؤلّف المؤسسات قواعدها الخاصة في الإعداد"
description: "قاعدة تعلنها حزمة لمشاركة السجلات؛ وتؤلّف المؤسسات قواعدها الخاصة في الإعداد",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
object: {
label: "الكائن"
},
sharedWith: {
label: "مُشارَك مع"
},
accessLevel: {
label: "مستوى الوصول"
}
}
},
queue: {
label: "قائمة الانتظار",
description: "مجموعة مُسمّاة من الأشخاص يمكن أن تبقى السجلات فيها حتى يتولّى أحدهم السجل؛ وتزوّد المؤسسات قوائمها بالأشخاص في الإعداد"
description: "مجموعة مُسمّاة من الأشخاص يمكن أن تبقى السجلات فيها حتى يتولّى أحدهم السجل؛ وتزوّد المؤسسات قوائمها بالأشخاص في الإعداد",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
members: {
label: "الأعضاء"
},
description: {
label: "الوصف"
}
}
},
assignment_rule: {
label: "قاعدة الإسناد",
description: "قاعدة تعلنها حزمة لتوجيه السجلات الجديدة إلى قائمة انتظار أو إلى شخص"
description: "قاعدة تعلنها حزمة لتوجيه السجلات الجديدة إلى قائمة انتظار أو إلى شخص",
fields: {
name: {
label: "الاسم"
},
label: {
label: "التسمية"
},
object: {
label: "الكائن"
},
entries: {
label: "الإدخالات"
},
active: {
label: "نشط"
},
description: {
label: "الوصف"
}
}
},
agent: {
label: "وكيل الذكاء الاصطناعي",
Expand Down Expand Up @@ -2864,6 +3039,9 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
guardrails: {
label: "حواجز الحماية",
helpText: "قواعد السلامة وسياسات المحتوى"
},
"model.model": {
label: "النموذج"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,10 @@ function carriesToken(text: string, token: string): boolean {
*/
function isBare(type: string): boolean {
const entry = (enMetadataForms as Record<string, any>)[type];
return !!entry && entry.fields === undefined && entry.sections === undefined;
// A form panel is what carries `sections`. Since #36860 a type with no form
// may still carry `fields` — the headers of its Studio list columns
// (`METADATA_LIST_REGISTRY`) — and stays bare: it has no panel.
return !!entry && entry.sections === undefined;
}

interface BareLeaf {
Expand Down
Loading
Loading