Skip to content

Commit 00e524f

Browse files
committed
Merge origin/main into claude/issue-36897-list-objectgrid: the 修改时间 column on the grid table
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
2 parents 4a15359 + 8c29b81 commit 00e524f

70 files changed

Lines changed: 3916 additions & 317 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/rest': patch
4+
'@objectstack/runtime': patch
5+
'@objectstack/platform-objects': patch
6+
'@object-ui/app-shell': patch
7+
---
8+
9+
feat(spec): Studio list columns for 27 metadata types, served in the reader's language on both doors
10+
11+
Clause-②: yes (widening: `/meta/types` serves `list` on 26 more entries, and the runtime dispatcher's listing is now translated)
12+
Metadata-protocol: none
13+
14+
`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.
15+
16+
- **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.
17+
- **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.
18+
- **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.

‎.changeset/36897-list-objectgrid.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Clause-②: no
99
Metadata-protocol: none
1010

1111
- `@object-ui/plugin-grid`: `ObjectGrid` takes two generic host props for its table view — `hostCells` (a host draws a column's cells) and `rowTint` (a palette name per row, over `rowColor`).
12-
- `@object-ui/app-shell`: the metadata list (Setup and Studio's All metadata area) is an `ObjectGrid` fed a declared schema and the page's rows in the list's own order; diagnostics tint, lock, the Active switch, Clone and the served columns are the page's cells; sort, search and page live in the address. The grid's personal columns, export, selection and inline edit are off for it.
12+
- `@object-ui/app-shell`: the metadata list (Setup and Studio's All metadata area) is an `ObjectGrid` fed a declared schema and the page's rows in the list's own order; diagnostics tint, lock, the Active switch, Clone, the served columns and the 「修改时间」 column (its time, its unpublished-changes mark and its `changed` sort, objectstack#36898) are the page's cells; sort, search and page live in the address. The grid's personal columns, export, selection and inline edit are off for it.
1313
- On a read-only base in Studio, the list's New creates in the paired `.custom` package (ADR-0146 D3): an object (with its organization-wide sharing default) and a flow (from a starting point) open the list's create dialog; another type opens the area's create in the pair. Under the customization wall no New is offered.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@object-ui/data-objectstack': patch
3+
'@object-ui/app-shell': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(console): the metadata list shows when each item last changed and marks items with unpublished changes
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: none
11+
12+
The generic metadata list (Setup's catalog lists and Studio's "All metadata" area) gains a 「修改时间」 / "Modified" column, read off the list answer's `changedAt` sibling. Only an item served from a stored row has a time; a code-shipped item shows an empty cell. The sort control gains "Modified (newest first)" and "Modified (oldest first)", which ride the address as `sort=-changed` / `sort=changed`; items without a time sort last either way, and the item page's ‹ › follow the same order.
13+
14+
Beneath the time, an item with a pending draft on the existing `GET /api/v1/meta/_drafts` ledger is marked 「有未发布的改动」 / "Unpublished changes", including drafts that existed before this change. A draft the AI assistant wrote (any of its recorded changes made by the AI copilot or through the MCP build door, the rule the item page's AI line uses) is marked 「AI 的改动未发布」 / "Unpublished AI changes" instead. A publish removes the mark.
15+
16+
`MetadataClient.listResponse` now returns the list's `changedAt` beside the items (each entry read with the spec's own rule; an entry that does not parse is dropped, and absence stays absence). `list` is unchanged.
17+
18+
New locale keys in the studio catalogue (en, zh): `engine.list.sort.changed.asc`, `engine.list.sort.changed.desc`, `engine.list.col.changedAt`, `engine.list.draftMark.human`, `engine.list.draftMark.humanTitle`, `engine.list.draftMark.ai`, `engine.list.draftMark.aiTitle`.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/i18n': patch
3+
'@object-ui/app-shell': patch
4+
---
5+
6+
fix(i18n): the full search page names component, doc and link results in every language
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The console's full search page (opened from the command palette's "Open Full Search Page") titles each result group and badges each result by the navigation item's type. Component items, doc items and link items printed raw keys (`search.typeComponents`, `search.badgeDoc`, `search.typeUrls`, …) because no locale pack defined them, English included. Every shipped console locale pack now carries a heading and a badge for the three types, and the search placeholder and its accessible label also name components and docs. A new test in `@object-ui/app-shell` renders the page with one navigation item of every spec type and fails when any heading or badge key the page asks for is missing from a pack.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): the profile Language card says it is the same setting as the globe menu
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
The Language card on the profile page described itself as the language for notifications and messages only, and said the interface language was chosen separately from the globe menu. Both controls write the same `sys_user.locale` column and the console applies it as the interface language, so saving the card switched the whole console. The card's description (`profile.language.description`, in all ten built-in packs and in the console's own fallback text) now says it is one setting for the interface and for what is sent to the user, the same one as the globe menu. The zh-Hans text uses full-width punctuation. Nothing to migrate.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@object-ui/auth': patch
3+
'@object-ui/console': patch
4+
---
5+
6+
fix(auth, console): saving your name on the profile page keeps the page on screen and shows "Profile updated successfully."; a language save that changes the interface language still confirms
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`useAuth().updateUser` (`@object-ui/auth`) installed the answer of better-auth's `POST /update-user` as the session user. That endpoint answers `{ status: true }`, not the user, so for a moment the signed-in user had no `id`, `name` or `email`: the header showed "?" and "User", and every consumer keyed on the identity dropped its children and mounted them again. In the console the page went blank, its data was read again, and the profile card's success alert, which is local state, was lost. `updateUser` now keeps the same user and applies the fields it wrote to it, the way better-auth builds the stored row. The page is not remounted, and the alert stays. The avatar upload and remove, which call `updateUser` too, no longer blank the page either.
12+
13+
The profile page's Language card (`@object-ui/console`) also confirms a save with a toast. A save that changes the interface language remounts the page under the console shell's language key, by design, and that remount took the card's inline alert with it. The console's toaster sits above that key, so the toast stays. A save that does not change the interface language shows the inline alert as before, and the toast beside it.
14+
15+
Nothing to migrate.

‎content/docs/protocol/kernel/i18n-standard.mdx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,14 @@ through the one the renderer reads for that node:
574574
|:---|:---|:---|
575575
| a form field, a composite's child | `FormFieldSpec.label` / `helpText` / `placeholder` | `resolveMetadataFormLabels(form, type, bundle, opts)` |
576576
| a property of a repeater row (a table column header) | the JSON Schema `items.properties[k].title` | `resolveMetadataFormSchemaTitles(schema, type, bundle, opts)` |
577+
| a column of the type's Studio list (`METADATA_LIST_REGISTRY`) | the served `list.columns[].label` | `resolveMetadataListLabels(list, type, bundle, opts)` |
577578

578-
Both run in `GET /api/v1/meta`, which serves every type's `form` and `schema`
579-
already localised for the request's locale; a client deriving the schema itself
579+
A list column reads the field slot of its own path, so a column and the form
580+
field of the same key read the same words. `os i18n extract` emits that slot for
581+
a column path the form does not declare, with the column's header as the source.
582+
583+
All three run in `GET /api/v1/meta`, which serves every type's `form`, `list`
584+
and `schema` already localised for the request's locale; a client deriving the schema itself
580585
with `z.toJSONSchema` applies the second one to its own copy, over a bundle it
581586
carries itself. Only `label` crosses over to the schema (as `title`); `helpText`
582587
and `placeholder` stay on the form.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* objectstack#36860 — `walkMetadataForms` emits the form field slot
5+
* `metadataForms.<type>.fields.<path>.label` for every Studio list column
6+
* (`METADATA_LIST_REGISTRY`), so the server can translate each header.
7+
*
8+
* - a column whose path the type's form does not label (a type with no form,
9+
* or a path the form leaves out) gets its own entry, seeded with the
10+
* column's header;
11+
* - a column the form already labels keeps the form's entry, so the slot
12+
* holds one English source;
13+
* - every column of every type has an entry, so no header reaches a reader
14+
* untranslatable.
15+
*/
16+
import { describe, it, expect } from 'vitest';
17+
import { METADATA_LIST_REGISTRY } from '@objectstack/spec/system';
18+
import { collectExpectedEntries } from './i18n-walk.js';
19+
20+
const entries = collectExpectedEntries({}, { warnedGroups: new Set() });
21+
const slot = (type: string, path: string) =>
22+
entries.filter((e) => e.path.join('\u0000') === ['metadataForms', type, 'fields', path, 'label'].join('\u0000'));
23+
24+
describe('list column headers are walked into the form field slot (objectstack#36860)', () => {
25+
it('a column on a type with no form gets its own entry, seeded with the header', () => {
26+
const [entry] = slot('job', 'schedule');
27+
expect(entry).toBeDefined();
28+
expect(entry.sourceValue).toBe('Schedule');
29+
});
30+
31+
it('a dotted column path the form does not label gets its own entry', () => {
32+
const [entry] = slot('agent', 'model.model');
33+
expect(entry).toBeDefined();
34+
expect(entry.sourceValue).toBe('Model');
35+
});
36+
37+
it('a column the form already labels keeps one entry, the form field\'s', () => {
38+
const found = slot('hook', 'events');
39+
expect(found).toHaveLength(1);
40+
expect(found[0].source).toBe('metadataFormField');
41+
});
42+
43+
it('every column of every declared list has an entry at its slot', () => {
44+
const missing: string[] = [];
45+
for (const [type, list] of Object.entries(METADATA_LIST_REGISTRY)) {
46+
for (const column of list.columns) {
47+
if (slot(type, column.field).length !== 1) missing.push(`${type}.${column.field}`);
48+
}
49+
}
50+
expect(missing).toEqual([]);
51+
});
52+
});

0 commit comments

Comments
 (0)