Skip to content

Commit 377ee2e

Browse files
committed
fix(app-shell): the list-view inspector labels live in the studio i18n namespace
Main moved the engine.inspector.pageBlock rows into @object-ui/i18n's lazy studio namespace. Move the three list-view rows there, and load the zh catalogue before the inspector test reads a zh label. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTqu1ZbUqjnAJufZ8m
1 parent a06f1d9 commit 377ee2e

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎.changeset/26703-list-view-row-cap-inspector.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
34
---
45

56
feat(app-shell): the page designer can set a list block's object, view and row cap
@@ -10,5 +11,5 @@ Metadata-protocol: none
1011
Selecting a `list-view` block in the page designer used to open an inspector with no typed fields. Its row cap, the number of rows a list block in a wide page region draws (5 when none is stated), could be set only by editing the page's JSON, because the "Advanced" section lists only keys the block already has.
1112

1213
- **Three controls.** Object, View and Row limit. They write the block's `dataSource` binding (`dataSource.object`, `dataSource.view`, `dataSource.limit`), the keys the list block already reads. The Row limit box hints `5` when empty.
13-
- **Labels in both designer locales**, English and Chinese.
14+
- **Labels in both designer locales**, English and Chinese, in the `studio` namespace of `@object-ui/i18n` where the page inspector's rows live.
1415
- No new key is declared anywhere, and nothing an author already wrote changes. The palette still does not offer `list-view`: the controls edit list blocks a page already carries.

‎ui/packages/app-shell/src/views/metadata-admin/inspectors/PageBlockInspector.listViewRowCap-26703.test.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ vi.mock('../useMetadata', () => ({
2727
useMetadataClient: () => ({ get: vi.fn(async () => undefined), list: vi.fn(async () => [] as unknown[]) }),
2828
}));
2929

30+
// The inspector's `engine.inspector.*` rows live in `@object-ui/i18n`'s `studio`
31+
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
32+
// Resident before any case, so the zh rows below read synchronously.
33+
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
34+
await loadStudioCatalogue('zh');
35+
3036
afterEach(cleanup);
3137

3238
const BLOCK_PATH = 'regions[0].components[0]';

‎ui/packages/i18n/src/namespaces/studio/en.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,9 @@ const STUDIO_EN: Record<string, string> = {
727727
'engine.inspector.pageBlock.field.object-kanban.titleField': 'Title field',
728728
'engine.inspector.pageBlock.field.object-kanban.cardFields': 'Card fields',
729729
'engine.inspector.pageBlock.field.object-kanban.limit': 'Limit',
730+
'engine.inspector.pageBlock.field.list-view.object': 'Object',
731+
'engine.inspector.pageBlock.field.list-view.view': 'View',
732+
'engine.inspector.pageBlock.field.list-view.limit': 'Row limit',
730733
'engine.inspector.pageBlock.field.grid.columns': 'Columns',
731734
'engine.inspector.pageBlock.field.grid.gap': 'Gap',
732735
'engine.inspector.pageBlock.field.element:text.content': 'Content',

‎ui/packages/i18n/src/namespaces/studio/zh.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,9 @@ const STUDIO_ZH: Record<string, string> = {
621621
'engine.inspector.pageBlock.field.object-kanban.titleField': '标题字段',
622622
'engine.inspector.pageBlock.field.object-kanban.cardFields': '卡片字段',
623623
'engine.inspector.pageBlock.field.object-kanban.limit': '条数上限',
624+
'engine.inspector.pageBlock.field.list-view.object': '对象',
625+
'engine.inspector.pageBlock.field.list-view.view': '视图',
626+
'engine.inspector.pageBlock.field.list-view.limit': '条数上限',
624627
'engine.inspector.pageBlock.field.grid.columns': '列数',
625628
'engine.inspector.pageBlock.field.grid.gap': '间距',
626629
'engine.inspector.pageBlock.field.element:text.content': '内容',

0 commit comments

Comments
 (0)