From 8df05bb67b49100e56e9e8f00aec7af9b671b41f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 20:59:56 +0000 Subject: [PATCH] fix(app-shell): the curated page, report and dashboard inspectors name a select's options in Chinese under zh-CN The console's metadataForms overlay named a select's row but not its options, so under zh-CN the page Type and Record action selects and the report and dashboard Default Period selects listed English choices beside Chinese labels. The overlay now carries those four rows' option names in the options slot resolveMetadataFormLabels reads, copied from the platform's zh-CN pack and pinned byte-equal to it (metadata-form-option-names.test.ts). The console-side Default Period renaming (default-period-labels.ts) is retired; #36835's pin now also holds the zh names to the period chip's rows. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- .../37607-curated-inspector-option-names.md | 10 ++ .../metadata-admin/default-period-labels.ts | 83 ------------ .../inspectors/DashboardDefaultInspector.tsx | 15 +-- ...spector.defaultPeriodLabels-36835.test.tsx | 51 +++++-- .../inspectors/ReportDefaultInspector.tsx | 35 +++-- .../metadata-admin/metadata-form-i18n.ts | 10 +- .../metadata-form-option-names.test.ts | 126 ++++++++++++++++++ .../metadata-admin/metadata-form-zh-cn.ts | 27 +++- 8 files changed, 222 insertions(+), 135 deletions(-) create mode 100644 .changeset/37607-curated-inspector-option-names.md delete mode 100644 ui/packages/app-shell/src/views/metadata-admin/default-period-labels.ts create mode 100644 ui/packages/app-shell/src/views/metadata-admin/metadata-form-option-names.test.ts diff --git a/.changeset/37607-curated-inspector-option-names.md b/.changeset/37607-curated-inspector-option-names.md new file mode 100644 index 00000000000..30dfea15fed --- /dev/null +++ b/.changeset/37607-curated-inspector-option-names.md @@ -0,0 +1,10 @@ +--- +'@object-ui/app-shell': patch +--- + +fix(app-shell): the curated page, report and dashboard inspectors name a select's options in Chinese under zh-CN + +Clause-②: no +Metadata-protocol: none + +Under zh-CN the page Type and Record action selects and the report and dashboard Default Period selects listed English choices beside Chinese labels. The console's `metadataForms` overlay now carries those four rows' option names in the `options` slot `resolveMetadataFormLabels` reads, copied from the platform's zh-CN pack (`zh-CN.metadata-forms.generated.ts`, the one `/api/v1/meta/types` localizes the same forms with) and pinned byte-equal to it. The console-side Default Period renaming (`default-period-labels.ts`) is retired: the overlay names those options now, in the same words the report and dashboard period chip shows. Every other designer locale keeps the spec's English, as before. diff --git a/ui/packages/app-shell/src/views/metadata-admin/default-period-labels.ts b/ui/packages/app-shell/src/views/metadata-admin/default-period-labels.ts deleted file mode 100644 index 770ba759092..00000000000 --- a/ui/packages/app-shell/src/views/metadata-admin/default-period-labels.ts +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. - -/** - * The Default Period select (`dateRange.defaultRange`) of the report and - * dashboard authoring forms, named in the builder's language. Both forms - * declare the same English-named options in the spec; both inspectors rename - * them here, so the two selects read one set of words. - */ - -import type { FormViewSpec } from './SchemaForm.js'; -import type { FormFieldSpec } from './form-spec.js'; -import type { SupportedLocale } from './i18n.js'; -import { isZhLocale } from './schema-field-label.js'; - -/** - * The console row the report and dashboard period chip reads for a Default - * Period value (`ReportDateRange` in `@object-ui/plugin-report`): a preset's - * `dashboard.filters.range.`, and `dashboard.filters.custom` for the - * `custom` sentinel, which names no window. - */ -export function defaultPeriodLabelKey(value: string): string { - return value === 'custom' ? 'dashboard.filters.custom' : `dashboard.filters.range.${value}`; -} - -/** - * The form with each Default Period option (`dateRange.defaultRange`) renamed - * by `label(value, authored)`, where `authored` is the spec's English name. - * - * The spec form names the options in English; the `metadataForms` overlay - * ({@link localizeMetadataForm}) translates a row's label and hint and has no - * slot for option names. The words exist in the console's locale packs, where - * the period chip reads them, so the builder picks a period in - * the words a viewer sees it in. Returns the SAME form when it declares no such - * options; otherwise copies only the spine it changes. - */ -export function withDefaultPeriodLabels( - form: FormViewSpec | undefined, - label: (value: string, authored: string) => string, -): FormViewSpec | undefined { - if (!form?.sections) return form; - const relabelChild = (child: string | FormFieldSpec): string | FormFieldSpec => { - if (typeof child === 'string' || child.field !== 'defaultRange' || !Array.isArray(child.options)) return child; - return { - ...child, - options: child.options.map((opt) => ({ ...opt, label: label(String(opt.value), String(opt.label ?? opt.value)) })), - }; - }; - let changed = false; - const sections = form.sections.map((section) => { - if (!Array.isArray(section.fields)) return section; - let sectionChanged = false; - const fields = section.fields.map((field) => { - if (typeof field === 'string' || field.field !== 'dateRange' || !Array.isArray(field.fields)) return field; - const declared = field.fields; - const children = declared.map(relabelChild); - if (children.every((c, i) => c === declared[i])) return field; - sectionChanged = true; - return { ...field, fields: children }; - }); - if (!sectionChanged) return section; - changed = true; - return { ...section, fields }; - }); - return changed ? { ...form, sections } : form; -} - -/** - * The form a curated inspector renders, its Default Period options named for - * `locale`. A zh designer reads the names from the console's locale packs - * through `translate` (the app translator); every other designer locale keeps - * the producer's English, like the rest of the panel. Returns the SAME form - * when there is nothing to rename. - */ -export function localizeDefaultPeriods( - form: FormViewSpec | undefined, - locale: SupportedLocale | string | undefined, - translate: (key: string, options: { defaultValue: string }) => string, -): FormViewSpec | undefined { - if (!isZhLocale(locale)) return form; - return withDefaultPeriodLabels(form, (value, authored) => - translate(defaultPeriodLabelKey(value), { defaultValue: authored }), - ); -} diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/DashboardDefaultInspector.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/DashboardDefaultInspector.tsx index 6757d414cda..f054cf4e57d 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/DashboardDefaultInspector.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/DashboardDefaultInspector.tsx @@ -45,9 +45,7 @@ import { SchemaForm } from '../SchemaForm.js'; import { fallbackFormPatch } from './fallbackFormPatch.js'; import type { FormViewSpec } from '../SchemaForm.js'; import { getDashboardForm, getDashboardSchema } from '../dashboard-schema.js'; -import { localizeDefaultPeriods } from '../default-period-labels.js'; import { mergeServerFields } from '../mergeServerFields.js'; -import { useObjectTranslation } from '@object-ui/i18n'; import { t, tFormat } from '../i18n.js'; // `DashboardWidget.title` is the spec's `I18nLabel`, which @objectstack/spec // 17.0.0-rc.6 widened from plain `string` to `string | Record` @@ -175,7 +173,6 @@ export function DashboardDefaultInspector({ // Graft any server-only top-level dashboard fields onto the bundled-spec // form so they are editable even when the bundled spec lags the server. - const { t: appT } = useObjectTranslation(); const { schema, form } = React.useMemo(() => { const merged = mergeServerFields({ bundledSchema: getDashboardSchema(), @@ -187,16 +184,8 @@ export function DashboardDefaultInspector({ sectionTitle: t('engine.inspector.moreFields', locale), }); // After the graft, so a server-only section stacks too (objectui#11796). - // The Default Period options are named the way the report inspector names - // them (`localizeDefaultPeriods`): the console's locale packs for a zh - // designer, the producer's English otherwise. - return { - schema: merged.schema, - form: stackSectionsForNarrowPanel(localizeDefaultPeriods(merged.form, locale, (key, options) => appT(key, options))), - }; - // `appT` changes with the app's language and when a locale pack lands, so - // the names follow both. - }, [serverSchema, locale, appT]); + return { schema: merged.schema, form: stackSectionsForNarrowPanel(merged.form) }; + }, [serverSchema, locale]); return ( o.value); +/** The console row the period chip reads for a Default Period value. */ +const chipKey = (value: string) => + value === 'custom' ? 'dashboard.filters.custom' : `dashboard.filters.range.${value}`; + +/** The Default Period options of the report form as `getReportForm` names them for `locale`. */ +function namedOptions(locale: string): Array<{ label: string; value: string }> { + for (const section of getReportForm(locale)?.sections ?? []) { + for (const field of (section.fields ?? []) as any[]) { + if (field?.field !== 'dateRange') continue; + const child = (field.fields ?? []).find((c: any) => c?.field === 'defaultRange'); + if (child?.options) return child.options; + } + } + throw new Error('the report form names no dateRange.defaultRange options'); +} + +const readPack = (pack: unknown, key: string) => + key.split('.').reduce((node: any, seg) => node?.[seg], pack as Record); + describe('#36835 — the Default Period select names its periods', () => { it('the spec English names are the en locale pack rows the period chip reads', () => { - const pack = en as unknown as Record; - const read = (key: string) => key.split('.').reduce((node, seg) => node?.[seg], pack); for (const { value, label } of specOptions()) { - expect(read(defaultPeriodLabelKey(value)), value).toBe(label); + expect(readPack(en, chipKey(value)), value).toBe(label); + } + }); + + it('the zh names are the zh locale pack rows the period chip reads', () => { + for (const { value, label } of namedOptions('zh-CN')) { + expect(readPack(zh, chipKey(value)), value).toBe(label); } }); @@ -116,7 +141,7 @@ describe('#36835 — the Default Period select names its periods', () => { for (const value of VALUES) expect(offered, value).not.toContain(value); }); - it('zh: every option reads the locale pack name', async () => { + it('zh: every option reads its Chinese name', async () => { renderIn('zh', 'zh-CN'); // POSITIVE CONTROL: the row label comes through the zh overlay. const offered = await openDefaultPeriod('时间段与导出', '默认时间段'); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ReportDefaultInspector.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ReportDefaultInspector.tsx index 33121659521..f9d28330fdb 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ReportDefaultInspector.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ReportDefaultInspector.tsx @@ -55,13 +55,12 @@ import { } from '../previews/useDatasetCatalog.js'; import { useStudioDatasetAuthoring } from '../../studio-design/datasetCreate.js'; import { getReportForm, getReportSchema } from '../report-schema.js'; -import { localizeDefaultPeriods } from '../default-period-labels.js'; import { mergeServerFields } from '../mergeServerFields.js'; import { t, tFormat } from '../i18n.js'; import { mapLoaded } from '../loadState.js'; import type { WidgetContext } from '../widgets.js'; import { datasetPickerOptions, datasetLabelOptions } from './dataset-picker-options.js'; -import { pickLocalized, setLocalized, clearLocalized, useObjectTranslation } from '@object-ui/i18n'; +import { pickLocalized, setLocalized, clearLocalized } from '@object-ui/i18n'; import { WIDGET_TYPE_META } from '../previews/widget-types.js'; import { shownLabel, writtenLabel, servedLabelNote, useLabelLanguage } from './servedLabel.js'; import { useServedReportText } from '../../studio-design/servedReportText.js'; @@ -555,24 +554,20 @@ export function ReportDefaultInspector({ // Graft any server-only top-level fields onto the bundled-spec form so they // are directly editable here even when the bundled `@objectstack/spec` lags - // the running server (skew root-cure). - // The Default Period options carry the spec's English names; a zh designer - // reads them from the console's locale packs, the rows the report page's - // period chip shows (`localizeDefaultPeriods`). Every other designer locale - // keeps the producer's English, like the rest of this panel. - const { t: appT } = useObjectTranslation(); - const { schema, form } = React.useMemo(() => { - const merged = mergeServerFields({ - bundledSchema: getReportSchema(), - bundledForm: getReportForm(locale), - serverSchema, - excludeFields: REPORT_CURATED_FIELDS, - sectionTitle: t('engine.inspector.moreFields', locale), - }); - return { ...merged, form: localizeDefaultPeriods(merged.form, locale, (key, options) => appT(key, options)) }; - // `appT` changes with the app's language and when a locale pack lands, so - // the names follow both. - }, [serverSchema, locale, appT]); + // the running server (skew root-cure). `getReportForm(locale)` names the + // options of a select too (the Default Period presets among them), from the + // same overlay that names the rows. + const { schema, form } = React.useMemo( + () => + mergeServerFields({ + bundledSchema: getReportSchema(), + bundledForm: getReportForm(locale), + serverSchema, + excludeFields: REPORT_CURATED_FIELDS, + sectionTitle: t('engine.inspector.moreFields', locale), + }), + [serverSchema, locale], + ); return ( .{label,description}`, * `.sections.
.{label,description}`, - * `.fields..{label,helpText,placeholder}` — resolved by + * `.fields..{label,helpText,placeholder,options}` — resolved by * `resolveMetadataFormLabels` from `@objectstack/spec/system`, which the * framework's own `/meta/types` handler calls to localize the very same forms * before serving them. This module supplies a bundle to THAT function rather @@ -135,7 +135,13 @@ const METADATA_FORM_BUNDLE: TranslationBundle = { dateRange: { label: '日期范围', helpText: '打开仪表盘时默认的时间段,以及查看者能否自选日期。' }, // All three children of the `dateRange` composite — see the ⛔ note above. 'dateRange.field': { label: '日期字段', helpText: '时间段筛选所依据的日期字段。留空则按创建日期筛选。' }, - 'dateRange.defaultRange': { label: '默认时间段', helpText: '打开仪表盘时显示的时间段。' }, + 'dateRange.defaultRange': { + label: '默认时间段', + helpText: '打开仪表盘时显示的时间段。', + // Option names: the platform pack's map, pinned byte-equal by + // `metadata-form-option-names.test.ts`. + options: { today: '今天', yesterday: '昨天', this_week: '本周', last_week: '上周', this_month: '本月', last_month: '上月', next_month: '下月', this_quarter: '本季度', last_quarter: '上季度', next_quarter: '下季度', this_year: '今年', last_year: '去年', last_7_days: '近 7 天', last_30_days: '近 30 天', last_90_days: '近 90 天', next_30_days: '未来 30 天', custom: '自定义…' }, + }, 'dateRange.allowCustomRange': { label: '允许自定义范围', helpText: '允许查看者自己选择开始和结束日期。' }, globalFilters: { label: '全局筛选', helpText: '查看者可用来一次筛选全部组件,或只筛选你指定组件的筛选条件。' }, }, diff --git a/ui/packages/app-shell/src/views/metadata-admin/metadata-form-option-names.test.ts b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-option-names.test.ts new file mode 100644 index 00000000000..a6dec466ae2 --- /dev/null +++ b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-option-names.test.ts @@ -0,0 +1,126 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#37607 — the curated page, report and dashboard inspectors render + * the bundled spec form through this console's `metadataForms` overlay, and + * that overlay named a select's rows but not its options: under zh-CN the page + * Type, the page Record action and the report and dashboard Default Period + * selects listed English choices beside Chinese labels. + * + * The option names now ride in the same overlay (`options: { : … }`, + * the slot `resolveMetadataFormLabels` reads). They are copied from the + * platform's canonical zh-CN pack, the one `/api/v1/meta/types` localizes the + * same forms with, so this file pins: + * + * 1. the copies cannot drift from the pack: each option map in + * `ZH_CN_SPEC_FORMS` equals the pack's map byte for byte, and every option + * each of the four selects renders under zh-CN reads the pack's name (the + * dashboard's map lives in `./metadata-form-i18n.ts`, so it is pinned + * through the form it renders); + * 2. the pack names options on no fifth row of these forms, so a new one is + * copied here rather than missed; + * 3. per form, one zh-CN option name reaches the form the inspector renders; + * 4. CONTROL: under en the same option keeps the spec's English. + */ + +import { describe, it, expect } from 'vitest'; +import type { TranslationData } from '@objectstack/spec/system'; +import type { FormViewSpec } from './SchemaForm.js'; +import { getPageForm } from './page-schema.js'; +import { getReportForm } from './report-schema.js'; +import { getDashboardForm } from './dashboard-schema.js'; +import { ZH_CN_SPEC_FORMS } from './metadata-form-zh-cn.js'; + +type FormsTable = NonNullable; + +// The platform pack, read from the checkout's source (a data-only module whose +// one import is type-only). The specifier is built at run time so neither the +// type checker nor the bundler treats it as a dependency of this package. +const PLATFORM_PACK = new URL( + '../../../../../../packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts', + import.meta.url, +).href; +const { zhCNMetadataForms: platform } = (await import(/* @vite-ignore */ PLATFORM_PACK)) as { + zhCNMetadataForms: FormsTable; +}; + +/** Every `[type, fieldPath, options]` row of a forms table that names options. */ +function optionRows(table: FormsTable): Array<[string, string, Record]> { + const rows: Array<[string, string, Record]> = []; + for (const [type, entry] of Object.entries(table)) { + for (const [path, field] of Object.entries((entry as any)?.fields ?? {})) { + const options = (field as any)?.options; + if (options && typeof options === 'object') rows.push([type, path, options]); + } + } + return rows; +} + +/** The option list of the field at `path` (dot path from the form root). */ +function optionsAt(form: FormViewSpec | undefined, path: string): Array<{ value: unknown; label?: unknown }> { + const [head, ...rest] = path.split('.'); + for (const section of form?.sections ?? []) { + for (const field of (section.fields ?? []) as any[]) { + if (typeof field === 'string' || field?.field !== head) continue; + let node = field; + for (const seg of rest) node = (node?.fields ?? []).find((c: any) => typeof c !== 'string' && c?.field === seg); + if (Array.isArray(node?.options)) return node.options; + } + } + throw new Error(`no options at ${path}`); +} + +const labelOf = (form: FormViewSpec | undefined, path: string, value: string) => + optionsAt(form, path).find((o) => o.value === value)?.label; + +/** The four selects the platform pack names options for, on these forms. */ +const ROWS: Array<[type: string, path: string, form: (locale: string) => FormViewSpec | undefined]> = [ + ['page', 'type', getPageForm], + ['page', 'interfaceConfig.recordAction', getPageForm], + ['report', 'dateRange.defaultRange', getReportForm], + ['dashboard', 'dateRange.defaultRange', getDashboardForm], +]; + +describe('#37607 — curated inspectors name a select’s options under zh-CN', () => { + it('the spec-forms table copies exactly the platform pack’s option maps, byte for byte', () => { + const rows = optionRows(ZH_CN_SPEC_FORMS); + expect(rows.map(([type, path]) => `${type}:${path}`).sort()).toEqual( + ['page:type', 'page:interfaceConfig.recordAction', 'report:dateRange.defaultRange'].sort(), + ); + for (const [type, path, options] of rows) { + const source = (platform as any)[type]?.fields?.[path]?.options; + expect(source, `${type}.${path} has no options in the platform pack`).toBeDefined(); + expect(JSON.stringify(options), `${type}.${path}`).toBe(JSON.stringify(source)); + } + }); + + it('the platform pack names options on no other row of these forms', () => { + const named = ['page', 'report', 'dashboard', 'view'].flatMap((type) => + optionRows({ [type]: (platform as any)[type] } as FormsTable).map(([t, path]) => `${t}:${path}`), + ); + expect(named.sort()).toEqual(ROWS.map(([type, path]) => `${type}:${path}`).sort()); + }); + + it.each(ROWS)('%s %s: every zh-CN option reads the platform pack’s name', (type, path, form) => { + const source = (platform as any)[type].fields[path].options as Record; + const offered = optionsAt(form('zh-CN'), path); + expect(offered.length).toBeGreaterThan(0); + for (const option of offered) { + expect(source[String(option.value)], `${type}.${path} option ${String(option.value)}`).toBeDefined(); + expect(option.label, `${type}.${path} option ${String(option.value)}`).toBe(source[String(option.value)]); + } + }); + + it('one named zh-CN option per form', () => { + expect(labelOf(getPageForm('zh-CN'), 'type', 'record')).toBe('记录页'); + expect(labelOf(getPageForm('zh-CN'), 'interfaceConfig.recordAction', 'drawer')).toBe('抽屉(右侧预览)'); + expect(labelOf(getReportForm('zh-CN'), 'dateRange.defaultRange', 'this_quarter')).toBe('本季度'); + expect(labelOf(getDashboardForm('zh-CN'), 'dateRange.defaultRange', 'last_30_days')).toBe('近 30 天'); + }); + + it('CONTROL — under en the same options keep the spec’s English', () => { + expect(labelOf(getPageForm('en-US'), 'type', 'record')).toBe('Record page'); + expect(labelOf(getReportForm('en-US'), 'dateRange.defaultRange', 'this_quarter')).toBe('This quarter'); + expect(labelOf(getDashboardForm('en-US'), 'dateRange.defaultRange', 'last_30_days')).toBe('Last 30 days'); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts index 8f5e47c084e..530d18f8675 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/metadata-form-zh-cn.ts @@ -25,7 +25,10 @@ * * - `view`, `page`, `report` — the curated inspectors render these forms * from the bundled spec, so every section and field string is here: label, - * description, help text, placeholder. (`dashboard` is the fourth such + * description, help text, placeholder, and a select's option names + * (`options: { : … }`, objectstack#37607 — each map copied from the + * platform pack and pinned byte-equal to it by + * `./metadata-form-option-names.test.ts`). (`dashboard` is the fourth such * form; its hand-worded entries live in `./metadata-form-i18n.ts`.) * - every other `METADATA_FORM_REGISTRY` type — its inspector renders the * form the server served, already localized. The one reader of these forms @@ -354,7 +357,13 @@ export const ZH_CN_SPEC_FORMS: NonNullable = { // The children `report.form.ts` declares for both composites (objectstack#36447), // copied from the platform zh-CN bundle like every unmarked row here. 'dateRange.dimension': { label: '日期字段', helpText: '时间段按数据来源里的哪个日期分组筛选;只有一个日期分组时可留空' }, - 'dateRange.defaultRange': { label: '默认时间段', helpText: '打开报表时显示的时间段' }, + 'dateRange.defaultRange': { + label: '默认时间段', + helpText: '打开报表时显示的时间段', + // Option names: the platform pack's map, pinned byte-equal by + // `metadata-form-option-names.test.ts`. + options: { today: '今天', yesterday: '昨天', this_week: '本周', last_week: '上周', this_month: '本月', last_month: '上月', next_month: '下月', this_quarter: '本季度', last_quarter: '上季度', next_quarter: '下季度', this_year: '今年', last_year: '去年', last_7_days: '近 7 天', last_30_days: '近 30 天', last_90_days: '近 90 天', next_30_days: '未来 30 天', custom: '自定义…' }, + }, 'dateRange.allowCustomRange': { label: '允许自定义范围', helpText: '允许使用者自己选择开始和结束日期' }, 'exportOptions.formats': { label: '格式', helpText: '可下载的格式。不设置时提供 csv 与 xlsx;空列表则关闭下载' }, 'exportOptions.includeHeaders': { label: '包含表头', helpText: '在下载文件的第一行写入列名' }, @@ -619,7 +628,12 @@ export const ZH_CN_SPEC_FORMS: NonNullable = { name: { label: '名称', helpText: 'snake_case 唯一标识符' }, label: { label: '显示名称', helpText: '展示给用户的页面标题' }, icon: { label: '图标', helpText: '导航菜单中显示的图标' }, - type: { label: '类型', helpText: '页面种类。"List / Interface" 把来源视图绑定为经过编排的界面——它的展现形式(grid / kanban / calendar / …)是在 Interface 中设置的可视化,不是页面类型。' }, + type: { + label: '类型', + helpText: '页面种类。"List / Interface" 把来源视图绑定为经过编排的界面——它的展现形式(grid / kanban / calendar / …)是在 Interface 中设置的可视化,不是页面类型。', + // Pinned byte-equal to the platform pack, as above. + options: { list: '列表 / 界面页', record: '记录页', home: '首页', app: '应用页', utility: '工具面板' }, + }, template: { label: '模板', helpText: '布局模板(如 "header-sidebar-main")' }, description: { label: '描述', helpText: '用于导航的页面描述' }, source: { label: '页面源码', helpText: '页面源码文本。kind 为 \'html\' 时,它是受约束的 JSX,在保存时被编译成组件树——只解析,绝不执行。kind 为 \'react\' 时,它是真正的 React,由受信任运行时在渲染时执行。' }, @@ -649,7 +663,12 @@ export const ZH_CN_SPEC_FORMS: NonNullable = { 'interfaceConfig.addRecord.position': { label: '位置' }, 'interfaceConfig.emptyState': { label: '空状态', helpText: '列表没有记录时页面显示的内容:标题、说明、图标和一个链接。在此设置后,它将替换源视图的空状态。' }, 'interfaceConfig.buttons': { label: '按钮', helpText: '工具栏按钮——从该对象的操作中选择' }, - 'interfaceConfig.recordAction': { label: '记录操作', helpText: '点击记录时如何打开其详情' }, + 'interfaceConfig.recordAction': { + label: '记录操作', + helpText: '点击记录时如何打开其详情', + // Pinned byte-equal to the platform pack, as above. + options: { drawer: '抽屉(右侧预览)', page: '整页', none: '不可点击' }, + }, 'interfaceConfig.showRecordCount': { label: '显示记录数', helpText: '显示记录数栏' }, 'interfaceConfig.allowPrinting': { label: '允许打印', helpText: '允许用户打印此页面' }, isDefault: { label: '默认', helpText: '打开该对象的记录时使用此记录页。每个对象只能有一个默认记录页:第二个会被拒绝。' },