diff --git a/.changeset/34796-studio-label-first-panels.md b/.changeset/34796-studio-label-first-panels.md new file mode 100644 index 00000000000..cc12d20095f --- /dev/null +++ b/.changeset/34796-studio-label-first-panels.md @@ -0,0 +1,21 @@ +--- +'@object-ui/app-shell': patch +'@object-ui/i18n': patch +'@object-ui/console': patch +--- + +feat(studio): flow node and list-view panels lead with labels, node delete moves to the header menu, navigation kinds read in words + +Clause-②: no +Metadata-protocol: none + +Studio's Automations and Interfaces panels name things the way the author named them and keep machine names out of the way: + +- **Flow node panel.** The first field is the node's Label. The node id moves into a "Developer info" section that starts collapsed. "Remove node" moves from the full-width footer button into the header's "···" menu; in Studio that menu sits in the automation panel's title bar. The removal itself is unchanged: neither the menu item nor the canvas Delete key asks to confirm, and both still refuse while a boundary event or an expression names the node. +- **Objects by label.** In the node panel, the sentences that name an object ("Targets the … record that started this flow", "Fields of …") use the object's label. The object picker shows the label and keeps the machine name on its hover title. +- **"Formula", not "CEL expression".** The node panel's value toggle, its placeholders and the blank-formula notice and the zh help rows of the trigger, Decision, record, loop, map, HTTP, action, screen, subflow and notify nodes say 公式 / "formula". The Update Records filter help no longer names `recordId`. The zh panel also gains the Update Records "update every matching record" row, which used to show in English. +- **New automation dialog.** The first field is "Automation name" (自动化名称), matching the dialog title and the Automations list. +- **List-view panel.** No `object.view` machine name under the title. The not-yet-created notice is one sentence: "Changes save as a draft first." Column rows show the field label, with the field name on hover. The Setup designers' column rows are unchanged. +- **Navigation edit mode.** Each entry's kind badge reads the kind the navigation list shows (对象 / 视图 / 仪表盘 / 页面 …). An object entry that opens a named view, such as a kanban, reads 视图. The Setup designer keeps the raw type. + +`@object-ui/i18n`: two new `studio` namespace keys (`engine.inspector.flowNode.moreActions`, `engine.inspector.flowNode.developerInfo`). Some existing `studio` values are reworded in en and zh. diff --git a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx index 599e0c2dd3d..1465709512a 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx @@ -18,6 +18,8 @@ * node inspector are real. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'; @@ -177,8 +179,8 @@ async function openAndSelect(type: string, name: string, host: MetadataAreaHost /** The node inspector's reason, as its accessible description resolves. */ async function nodeInspectorReason(): Promise { - // The inspector is mounted once its Remove-node control is. - await screen.findByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') }); + // The inspector is mounted once its "···" menu (it holds Remove node) is. + await screen.findByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }); const group = document.querySelector('[data-testid="flow-node-readonly-reason"]'); if (!group) return null; const id = group.getAttribute('aria-describedby'); @@ -189,7 +191,7 @@ describe('the metadata editor page names the read-only cause to the scoped inspe it('a writable flow: the node inspector is editable and carries no reason', async () => { await openAndSelect('flow', 'close_case'); expect(await nodeInspectorReason()).toBeNull(); - expect(screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') })).toBeEnabled(); + expect(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') })).toBeEnabled(); }); it("a read-only package's area: the package is the reason, as Studio's Automations pillar says it", async () => { diff --git a/ui/packages/app-shell/src/views/metadata-admin/i18n.ts b/ui/packages/app-shell/src/views/metadata-admin/i18n.ts index d2aa99cef88..0f9fbdfd4a7 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/i18n.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/i18n.ts @@ -311,7 +311,7 @@ const FLOW_FIELD_ZH: Record> = { objectName: { label: '对象', help: '其记录变更会启动此流程的对象。' }, condition: { label: '进入条件', - help: 'CEL 表达式 —— 仅当其为 true 时流程才运行(相对时间扫描时对每条匹配记录做门控)。留空则每次事件都运行。', + help: '公式 —— 仅当其为 true 时流程才运行(相对时间扫描时对每条匹配记录做门控)。留空则每次事件都运行。', }, 'schedule.expression': { label: 'Cron 表达式', @@ -350,18 +350,18 @@ const FLOW_FIELD_ZH: Record> = { decision: { conditions: { label: '分支', - help: '每个分支包含标签、CEL 表达式和目标节点。表达式为 “true” 的分支即默认 / else 路径。选择目标会接线该分支的出边(创建或更新),清空则断开该边。', + help: '每个分支包含标签、公式和目标节点。公式为 “true” 的分支即默认 / else 路径。选择目标会接线该分支的出边(创建或更新),清空则断开该边。', cols: { label: { label: '标签', help: '分支的标签;成立的分支沿同名标签的出边继续(都不成立时走标为默认、或标签为 default 的出边)。', placeholder: '如 有商机', }, - expression: { label: '表达式', help: '决定是否走这个分支的 CEL 条件(不加 {{ }})。' }, + expression: { label: '公式', help: '决定是否走这个分支的公式(不加 {{ }})。' }, target: { label: '目标节点', placeholder: '下一个节点' }, }, }, - condition: { label: '单一条件', help: '旧的单分支条件(CEL)。建议使用上方“分支”;每条边的条件也可写在出边上。' }, + condition: { label: '单一条件', help: '旧的单分支条件(公式)。建议使用上方“分支”;每条边的条件也可写在出边上。' }, // objectstack#34818 — was English in the zh panel. mode: { label: '分支方式', @@ -370,19 +370,19 @@ const FLOW_FIELD_ZH: Record> = { }, }, assignment: { - assignments: { label: '赋值', help: '设置变量:每个键为一个变量,值为表达式或字面量。' }, + assignments: { label: '赋值', help: '设置变量:每个键为一个变量,值为公式或字面量。' }, }, loop: { collection: { label: '集合', - help: '要遍历的列表:求值为列表的 CEL 表达式(如 leadList),或以 JSON 数组写出的各项。没有循环体区域的循环改为读取列表变量的裸名称。', + help: '要遍历的列表:求值为列表的公式(如 leadList),或以 JSON 数组写出的各项。没有循环体区域的循环改为读取列表变量的裸名称。', }, iteratorVariable: { label: '当前项变量', help: '存放当前项的循环变量。' }, indexVariable: { label: '索引变量', help: '存放当前索引的可选循环变量。' }, maxIterations: { label: '最大迭代次数' }, }, map: { - collection: { label: '集合', help: '要逐项处理的列表:求值为列表的 CEL 表达式(如 items),或以 JSON 数组写出的各项。' }, + collection: { label: '集合', help: '要逐项处理的列表:求值为列表的公式(如 items),或以 JSON 数组写出的各项。' }, flowName: { label: '每项子流程', help: '为每一项运行的子流程 —— 它可以暂停(如审批)。' }, iteratorVariable: { label: '当前项变量' }, itemObject: { label: '项对象', help: '当项为记录时,它们所属的对象(将每项暴露为子流程的记录)。' }, @@ -395,16 +395,20 @@ const FLOW_FIELD_ZH: Record> = { }, update_record: { objectName: { label: '对象' }, - filter: { label: '筛选', help: '标识待更新记录的字段 / 值对。每个值是字面量,或 CEL 表达式(如 id → 以表达式写的 recordId)。' }, + filter: { label: '筛选', help: '标识待更新记录的字段 / 值对。每个值是字面量,或公式(如 id 一栏用公式指向触发记录)。' }, fields: { label: '字段值', help: '要写入的字段值。' }, + multi: { + label: '更新所有匹配的记录', + help: '声明批量更新:更新筛选匹配到的每一条记录。关闭(默认)时,筛选必须按 id 指向一条记录 —— 没有开启这一项的按条件更新会被数据引擎拒绝。', + }, }, delete_record: { objectName: { label: '对象' }, - filter: { label: '筛选', help: '标识待删除记录的字段 / 值对。每个值是字面量,或 CEL 表达式。' }, + filter: { label: '筛选', help: '标识待删除记录的字段 / 值对。每个值是字面量,或公式。' }, }, get_record: { objectName: { label: '对象' }, - filter: { label: '筛选', help: '待匹配的字段 / 值对(如 status → active)。每个值是字面量,或 CEL 表达式。像 {"$ne": null} 这样的运算符值会被保留。' }, + filter: { label: '筛选', help: '待匹配的字段 / 值对(如 status → active)。每个值是字面量,或公式。像 {"$ne": null} 这样的运算符值会被保留。' }, limit: { label: '数量上限' }, outputVariable: { label: '输出变量' }, }, @@ -412,7 +416,7 @@ const FLOW_FIELD_ZH: Record> = { method: { label: '方法' }, url: { label: 'URL', help: '请求 URL。会渲染 {{ }} 占位。' }, headers: { label: '请求头', help: '请求头(如 Authorization、Content-Type)。每个值都会渲染 {{ }} 占位。' }, - body: { label: '请求体', help: '请求负载:按原样发送的 JSON,或求值为负载的 CEL 表达式。' }, + body: { label: '请求体', help: '请求负载:按原样发送的 JSON,或求值为负载的公式。' }, // objectui#11968 — no `outputVariable` overlay: the `http` contract declares // no such key, so neither form offers a field for it. durable: { label: '持久化(异步)', help: '通过持久化队列即发即忘(异步投递)。' }, @@ -426,7 +430,7 @@ const FLOW_FIELD_ZH: Record> = { opts: { invoke_function: '调用函数', email: '邮件', slack: 'Slack' }, }, function: { label: '函数', help: '要调用的已注册函数 —— 经 defineStack({ functions }) 声明。优先于动作类型。' }, - inputs: { label: '输入', help: '传给函数的值。每个值是字面量,或按流程变量求值的 CEL 表达式。' }, + inputs: { label: '输入', help: '传给函数的值。每个值是字面量,或按流程变量求值的公式。' }, outputVariable: { label: '输出变量', help: '绑定函数返回值的流程变量,供后续步骤使用。' }, template: { label: '模板', help: '消息模板 id。' }, recipients: { label: '收件人', help: '每行一个收件人(用户 id、字段引用或地址)。' }, @@ -458,7 +462,7 @@ const FLOW_FIELD_ZH: Record> = { objectName: { label: '对象表单', help: '渲染该对象完整的新建 / 编辑表单(含主从),而非扁平字段列表。' }, idVariable: { label: '保存记录变量', help: '仅对象表单:绑定到已保存记录 id 的变量,供后续步骤使用。' }, mode: { label: '表单模式', help: '仅对象表单。', opts: { create: '新建', edit: '编辑' } }, - defaults: { label: '表单默认值', help: '仅对象表单:预填值。每个值是字面量,或 CEL 表达式(如 account → 以表达式写的 account_id)。' }, + defaults: { label: '表单默认值', help: '仅对象表单:预填值。每个值是字面量,或公式(如 account → 以公式写的 account_id)。' }, }, approval: { approvers: { @@ -538,7 +542,7 @@ const FLOW_FIELD_ZH: Record> = { }, subflow: { flowName: { label: '流程' }, - input: { label: '输入映射', help: '传给子流程输入变量的值。每个值是字面量,或在本流程中求值的 CEL 表达式。' }, + input: { label: '输入映射', help: '传给子流程输入变量的值。每个值是字面量,或在本流程中求值的公式。' }, outputVariable: { label: '输出变量' }, timeoutMs: { label: '超时(毫秒)' }, }, @@ -567,7 +571,7 @@ const FLOW_FIELD_ZH: Record> = { topic: { label: '主题', help: '事件主题(默认 "notify")。' }, severity: { label: '级别', help: 'info | warning | critical' }, sourceObject: { label: '来源对象', help: '通知所关联记录的对象名。' }, - sourceId: { label: '来源记录', help: '通知链接到的记录 id(需配合来源对象):以文本写出的 id,或 CEL 表达式(如 record.id)。' }, + sourceId: { label: '来源记录', help: '通知链接到的记录 id(需配合来源对象):以文本写出的 id,或公式(如 record.id)。' }, actorId: { label: '触发用户', help: '引发该事件的用户 id。' }, // objectui#11968 — keyed `actionUrl`, the key the contract declares and both // forms now write; the `url` spelling is the converted alias. @@ -582,7 +586,7 @@ const FLOW_FIELD_ZH: Record> = { }, templateData: { label: '模板数据', - help: '填入模板 {{变量}} 占位的值:每个值是字面量,或每次运行时求值的 CEL 表达式。只能与邮件模板一起使用。', + help: '填入模板 {{变量}} 占位的值:每个值是字面量,或每次运行时求值的公式。只能与邮件模板一起使用。', }, }, // The engine-published `save_notice` descriptor's one field. diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx index 63979621063..7d1f86b3feb 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.stackedRows-27356.test.tsx @@ -15,6 +15,8 @@ * second case, a map with no value toggle. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import { describe, it, expect, afterEach, vi } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; @@ -27,7 +29,7 @@ import type { FlowConfigField } from './flow-node-config'; afterEach(cleanup); -const TOGGLE = 'Write as a CEL expression'; +const TOGGLE = 'Write as a formula'; const REMOVE = /remove/i; const LONG_FIELD = 'customer_satisfaction_score'; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.valueEnvelope.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.valueEnvelope.test.tsx index 38c4b3d323d..d55076ab31a 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.valueEnvelope.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowKeyValueField.valueEnvelope.test.tsx @@ -7,6 +7,8 @@ * field path read against the spec's expression ledger. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import { describe, it, expect, afterEach, vi } from 'vitest'; import { render, screen, cleanup, fireEvent } from '@testing-library/react'; import { @@ -20,7 +22,7 @@ import { t } from '../i18n'; afterEach(cleanup); -const TOGGLE = 'Write as a CEL expression'; +const TOGGLE = 'Write as a formula'; const ASSIGNMENTS: FlowConfigField = { id: 'assignments', diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx index 2c03d7d651a..848d6970afb 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeConfigField.tsx @@ -11,6 +11,7 @@ import { isUnsetFieldValue, unsetNoticeApplies } from './flow-node-config.js'; import type { FlowConfigField, InactiveRetainedKind } from './flow-node-config.js'; import { t, tFormat } from '../i18n.js'; import { useObjectFields } from '../previews/useObjectFields.js'; +import { useObjectDisplayName } from './ObjectPicker.js'; import { WIDGETS, OBJECTUI_SECRET_MASK } from '../widgets.js'; import { InspectorNumberField, @@ -124,6 +125,8 @@ function FieldValueMapField({ }: FlowKeyValueFieldProps & { objectName: string; byLabel: boolean; locale?: string }) { // The same field source the reference picker's `object-field` kind reads. const { fields } = useObjectFields(objectName || undefined); + // The hint names the object by its label, not its machine name. + const objectLabel = useObjectDisplayName(objectName || undefined); const keyOptions = React.useMemo( () => fields.map((f) => ({ @@ -141,7 +144,7 @@ function FieldValueMapField({ keysByLabel={byLabel} keyHint={ objectName - ? tFormat('engine.inspector.reference.fieldsOf', locale, { object: objectName }) + ? tFormat('engine.inspector.reference.fieldsOf', locale, { object: objectLabel }) : t('engine.inspector.fieldMap.chooseObject', locale) } /> @@ -214,10 +217,12 @@ function TriggeringRecordTarget({ disabled?: boolean; locale?: string; }) { + // The sentence names the object by its label, not its machine name. + const objectLabel = useObjectDisplayName(objectName); if (isTriggeringRecordFilter(value)) { return (

- {tFormat('engine.inspector.flowNode.triggeringRecord.active', locale, { object: objectName })} + {tFormat('engine.inspector.flowNode.triggeringRecord.active', locale, { object: objectLabel })}

); } @@ -235,7 +240,7 @@ function TriggeringRecordTarget({ {t('engine.inspector.flowNode.triggeringRecord.use', locale)}

- {tFormat('engine.inspector.flowNode.triggeringRecord.hint', locale, { object: objectName })} + {tFormat('engine.inspector.flowNode.triggeringRecord.hint', locale, { object: objectLabel })}

); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.connectorInputEnvelope-28164.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.connectorInputEnvelope-28164.test.tsx index 1e6a5efb1b0..5e23daf975c 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.connectorInputEnvelope-28164.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.connectorInputEnvelope-28164.test.tsx @@ -14,6 +14,8 @@ * declares none). */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent, waitFor, within } from '@testing-library/react'; @@ -36,7 +38,7 @@ afterEach(() => { vi.unstubAllGlobals(); }); -const TOGGLE = 'Write as a CEL expression'; +const TOGGLE = 'Write as a formula'; const SLACK_POST_MESSAGE = { type: 'object', diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.fieldValueMap-11788.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.fieldValueMap-11788.test.tsx index b9d1f5474f8..f54235885e7 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.fieldValueMap-11788.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.fieldValueMap-11788.test.tsx @@ -20,6 +20,8 @@ * `FlowNodeInspector.updateRecordTarget-27834.test.tsx`. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent, within } from '@testing-library/react'; @@ -146,7 +148,7 @@ describe('objectui#11788 — record field-value keys are picked from the target fireEvent.click(within(fields).getByRole('button', { name: 'Add entry' })); const key = within(fields).getByPlaceholderText('Key'); expect(keySuggestions(key)).toEqual(['status', 'owner']); - expect(within(fields).getByText('Fields of ticket.')).toBeInTheDocument(); + expect(within(fields).getByText('Fields of “ticket”.')).toBeInTheDocument(); fireEvent.change(key, { target: { value: 'status' } }); fireEvent.blur(key); const val = within(fields).getByPlaceholderText('Value'); @@ -154,7 +156,7 @@ describe('objectui#11788 — record field-value keys are picked from the target fireEvent.blur(val); expect(config().fields).toEqual({ status: 'done' }); // The value cell keeps the slot's own dialect: the text / CEL toggle. - expect(within(fields).getByRole('button', { name: 'Write as a CEL expression' })).toBeInTheDocument(); + expect(within(fields).getByRole('button', { name: 'Write as a formula' })).toBeInTheDocument(); }); } diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.labelFirst-34796.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.labelFirst-34796.test.tsx new file mode 100644 index 00000000000..52074874a05 --- /dev/null +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.labelFirst-34796.test.tsx @@ -0,0 +1,214 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#34796 — the flow node panel leads with what the author named the + * node, keeps machine names out of its text, and puts "Remove node" in the + * header's "···" menu. + * + * - The first labelled control is the node's Label; its id is in a "Developer + * info" section that starts collapsed. + * - The object a CRUD node writes is named by its label in every sentence, and + * the object picker keeps the machine name on its hover title. + * - There is no footer remove button; the header menu's item makes the same + * removal the footer button made, and the canvas's Delete key still makes it. + * - Under a host that frames the inspector (Studio's automation aside), the + * menu is drawn into the element the host names in its own title bar. + */ + +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; +import * as React from 'react'; +import { describe, it, expect, vi, afterEach, beforeAll } from 'vitest'; +import { render, screen, cleanup, fireEvent, waitFor } from '@testing-library/react'; + +vi.mock('../previews/useFlowNodePalette', () => ({ + useActionConfigSchemas: () => ({}), + useFlowNodePalette: () => [], +})); + +const h = vi.hoisted(() => { + const NAME = 'repairs_repair_ticket'; + const CATALOG: Array> = [ + { name: NAME, label: 'Repair Ticket', _packageId: 'com.example.repairs' }, + ]; + const get = vi.fn(async (_type: string, name: string) => + name === NAME ? { name, label: 'Repair Ticket', fields: { status: { type: 'text', label: 'Status' } } } : null, + ); + const previewList = vi.fn(async (_type: string) => CATALOG); + const client = { + get, + withPreviewDrafts: vi.fn((_on: boolean) => ({ list: previewList, get })), + list: vi.fn(async (type: string) => (type === 'object' ? CATALOG : [])), + listDrafts: vi.fn(async () => [] as unknown[]), + }; + return { NAME, client }; +}); + +vi.mock('../useMetadata', () => ({ useMetadataClient: () => h.client })); + +import { FlowNodeInspector } from './FlowNodeInspector'; +import { InspectorShellHostProvider } from './_shared'; +import { FlowCanvas } from '../previews/FlowCanvas'; +import { edgesAfterNodeRemoval } from '../previews/flow-problems'; +import { t } from '../i18n'; + +afterEach(cleanup); +beforeAll(() => { + for (const m of ['hasPointerCapture', 'setPointerCapture', 'releasePointerCapture', 'scrollIntoView'] as const) { + if (!Element.prototype[m]) { + // @ts-expect-error test shim + Element.prototype[m] = m === 'hasPointerCapture' ? () => false : () => {}; + } + } +}); + +const EN = 'en-US'; +const NODE_ID = 'node_1'; + +type Node = { id: string; type: string; label?: string; config?: Record }; + +/** A record-triggered flow: start → update the triggering ticket → end. */ +function flow(): { nodes: Node[]; edges: Array<{ id: string; source: string; target: string }> } { + return { + nodes: [ + { id: 'start', type: 'start', label: 'Start', config: { triggerType: 'record-after-create', objectName: h.NAME } }, + { id: NODE_ID, type: 'update_record', label: 'Update ticket', config: { objectName: h.NAME } }, + { id: 'end', type: 'end', label: 'End' }, + ], + edges: [ + { id: 'e1', source: 'start', target: NODE_ID }, + { id: 'e2', source: NODE_ID, target: 'end' }, + ], + }; +} + +function renderInspector(opts: { onPatch?: (p: Record) => void; onClear?: () => void; readOnly?: boolean } = {}) { + return render( + } + selection={{ kind: 'node', id: NODE_ID }} + onPatch={opts.onPatch ?? vi.fn()} + onClearSelection={opts.onClear ?? vi.fn()} + readOnly={opts.readOnly ?? false} + locale={EN} + />, + ); +} + +/** Open the header's "···" menu and press its remove item. */ +function pressMenuRemove() { + fireEvent.pointerDown(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', EN) }), { + button: 0, + ctrlKey: false, + }); + fireEvent.click(screen.getByRole('menuitem', { name: t('engine.inspector.flowNode.remove', EN) })); +} + +describe('the node panel leads with its label (objectstack#34796)', () => { + it('draws Label as the first labelled control and the id only inside a collapsed Developer info', () => { + const { container } = renderInspector(); + const labels = [...container.querySelectorAll('label')].map((l) => l.textContent?.trim()); + expect(labels[0]).toBe(t('engine.inspector.flowNode.label', EN)); + + const idInput = screen.getByDisplayValue(NODE_ID); + const section = screen.getByTestId('flow-node-developer-info') as HTMLDetailsElement; + expect(section.tagName).toBe('DETAILS'); + expect(section.open).toBe(false); + expect(section.contains(idInput)).toBe(true); + expect(section.querySelector('summary')?.textContent).toBe(t('engine.inspector.flowNode.developerInfo', EN)); + // Nothing outside that section names the id. + const outside = [...container.querySelectorAll('input')].filter((i) => !section.contains(i)).map((i) => i.value); + expect(outside).not.toContain(NODE_ID); + }); + + it('names the object by its label and keeps the machine name on the picker hover title only', async () => { + const { container } = renderInspector(); + await waitFor(() => + expect(screen.getByTestId('flow-triggering-record-target').textContent).toContain('“Repair Ticket”'), + ); + expect(container.textContent).not.toContain(h.NAME); + expect(container.querySelector('[data-object-name-line]')).toBeNull(); + const picker = screen.getByRole('combobox', { name: /object/i }); + expect(picker).toHaveValue('Repair Ticket'); + expect(picker).toHaveAttribute('title', h.NAME); + }); +}); + +describe('Remove node lives in the header menu (objectstack#34796)', () => { + it('draws no remove button in the panel; the menu item makes the removal the footer made', () => { + const onPatch = vi.fn(); + const onClear = vi.fn(); + renderInspector({ onPatch, onClear }); + expect(screen.queryByRole('button', { name: t('engine.inspector.flowNode.remove', EN) })).toBeNull(); + + pressMenuRemove(); + expect(onPatch).toHaveBeenCalledTimes(1); + const patch = onPatch.mock.calls[0][0] as { nodes: Node[]; edges: unknown[] }; + const draft = flow(); + expect(patch.nodes.map((n) => n.id)).toEqual(['start', 'end']); + expect(patch.edges).toEqual(edgesAfterNodeRemoval(draft.edges as never, NODE_ID, new Set(['start', 'end']))); + expect(onClear).toHaveBeenCalledTimes(1); + }); + + it('disables the menu on a read-only panel, so nothing can be removed', () => { + const onPatch = vi.fn(); + renderInspector({ onPatch, readOnly: true }); + const trigger = screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', EN) }); + expect(trigger).toBeDisabled(); + fireEvent.pointerDown(trigger, { button: 0, ctrlKey: false }); + expect(screen.queryByRole('menuitem', { name: t('engine.inspector.flowNode.remove', EN) })).toBeNull(); + expect(onPatch).not.toHaveBeenCalled(); + }); + + it('control: the canvas Delete key still removes the selected node, as the menu item does', () => { + const onPatch = vi.fn(); + const draft = flow(); + render( + {}} + onPatch={onPatch} + />, + ); + fireEvent.keyDown(screen.getByRole('application', { name: t('engine.flowCanvas.canvas', EN) }), { key: 'Delete' }); + expect(onPatch).toHaveBeenCalledTimes(1); + const patch = onPatch.mock.calls[0][0] as { nodes: Node[]; edges: unknown[] }; + expect(patch.nodes.map((n) => n.id)).toEqual(['start', 'end']); + expect(patch.edges).toEqual(edgesAfterNodeRemoval(draft.edges as never, NODE_ID, new Set(['start', 'end']))); + }); + + it('draws the menu into the title-bar element a framing host names', () => { + function Host() { + const [slot, setSlot] = React.useState(null); + return ( +
+
+ +
+ + } + selection={{ kind: 'node', id: NODE_ID }} + onPatch={vi.fn()} + onClearSelection={vi.fn()} + readOnly={false} + locale={EN} + /> + +
+ ); + } + render(); + const trigger = screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', EN) }); + expect(screen.getByTestId('host-title-bar').contains(trigger)).toBe(true); + expect(screen.getByTestId('inspector-shell-hosted').contains(trigger)).toBe(false); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.readOnlyReason-28985.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.readOnlyReason-28985.test.tsx index 35592d514f3..b1869c02f19 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.readOnlyReason-28985.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.readOnlyReason-28985.test.tsx @@ -18,6 +18,8 @@ * `StudioDesignSurface.automationsReadOnly-11124.test.tsx`. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; @@ -79,10 +81,10 @@ function mount({ readOnly, readOnlyReason }: { readOnly: boolean; readOnlyReason ); } -/** The panel's form controls, Remove node included — the ones the reason is about. */ +/** The panel's form controls, the "···" menu that holds Remove node included — the ones the reason is about. */ const controls = (root: HTMLElement) => [ ...root.querySelectorAll('input, select, textarea, button[role="combobox"]'), - screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') }), + screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }), ]; describe('Flow node inspector, read-only with a reason from its host (objectstack#28985)', () => { @@ -95,7 +97,7 @@ describe('Flow node inspector, read-only with a reason from its host (objectstac expect(body).toHaveAccessibleName('Set status'); const all = controls(body); - // ID, Label, Node Type and Remove node alone are four; a vacuous pass is not one. + // ID, Label, Node Type and the "···" menu alone are four; a vacuous pass is not one. expect(all.length).toBeGreaterThanOrEqual(4); for (const el of all) { expect(body).toContainElement(el); @@ -103,10 +105,10 @@ describe('Flow node inspector, read-only with a reason from its host (objectstac } }); - it('hovering the disabled "Remove node" opens a tooltip with the reason', async () => { + it('hovering the disabled "···" menu (it holds Remove node) opens a tooltip with the reason', async () => { const user = userEvent.setup(); mount({ readOnly: true, readOnlyReason: REASON }); - const remove = screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') }); + const remove = screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }); expect(remove).toBeDisabled(); await user.hover(remove); expect(await screen.findByRole('tooltip')).toHaveTextContent(REASON); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeEdges-11772.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeEdges-11772.test.tsx index 65dd79ef688..03da67c36ca 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeEdges-11772.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeEdges-11772.test.tsx @@ -11,6 +11,8 @@ * here and requires the two patches' edges to be equal. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent } from '@testing-library/react'; @@ -60,7 +62,8 @@ function removeWithInspector(draft: Fixture, id: string): { nodes: Node[]; edges locale="en-US" />, ); - fireEvent.click(screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') })); + fireEvent.pointerDown(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }), { button: 0, ctrlKey: false }); + fireEvent.click(screen.getByRole('menuitem', { name: t('engine.inspector.flowNode.remove', 'en-US') })); expect(onPatch).toHaveBeenCalledTimes(1); cleanup(); return onPatch.mock.calls[0][0]; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeRefusal-11838.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeRefusal-11838.test.tsx index d9892f18f24..55509999cfe 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeRefusal-11838.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.removeRefusal-11838.test.tsx @@ -10,6 +10,8 @@ * shallowly, as `FlowNodeInspector.renameExprRefs-11838.test.tsx` drives it. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent, act } from '@testing-library/react'; @@ -69,8 +71,14 @@ function mount(initial: Draft, select: MetadataSelection, locale: SupportedLocal return out; } -const clickRemove = (locale: SupportedLocale = 'en-US') => - fireEvent.click(screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', locale) })); +/** Remove sits in the header's "···" menu (objectstack#34796). */ +const clickRemove = (locale: SupportedLocale = 'en-US') => { + fireEvent.pointerDown(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', locale) }), { + button: 0, + ctrlKey: false, + }); + fireEvent.click(screen.getByRole('menuitem', { name: t('engine.inspector.flowNode.remove', locale) })); +}; const refusal = () => screen.queryByRole('alert')?.textContent ?? null; /** Approval `x`, read by a branch and attached to by a boundary event. */ diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.test.tsx index a0fea4480ef..6346f8b99dd 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.test.tsx @@ -9,6 +9,8 @@ * drops the virtual Target column + never mirrors top-level edges. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent } from '@testing-library/react'; @@ -94,7 +96,8 @@ const lastPatch = (onPatch: ReturnType) => onPatch.mock.calls.at(- describe('FlowNodeInspector — top-level regression', () => { it('edits a top-level node and offers delete', () => { const { onPatch } = renderInspector({ kind: 'node', id: 'each' }); - expect(screen.getByRole('button', { name: /remove node/i })).toBeInTheDocument(); + // Remove node sits in the header's "···" menu (objectstack#34796). + expect(screen.getByRole('button', { name: /more actions/i })).toBeInTheDocument(); fireEvent.change(screen.getByDisplayValue('For each'), { target: { value: 'Each order' } }); expect(lastPatch(onPatch).nodes[1].label).toBe('Each order'); }); @@ -139,6 +142,7 @@ describe('FlowNodeInspector — nested node editing', () => { it('locks the id and hides delete for a nested node, with a hint', () => { renderInspector({ kind: NESTED_NODE_KIND, id: bodyChargeId }); expect(screen.queryByRole('button', { name: /remove node/i })).toBeNull(); + expect(screen.queryByRole('button', { name: /more actions/i })).toBeNull(); expect(screen.getByDisplayValue('charge')).toBeDisabled(); // the id field expect(screen.getByText(/rename it in the container/i)).toBeInTheDocument(); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.tsx index 885d5da6c40..fb5a31ee90d 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.tsx @@ -10,6 +10,11 @@ * `draft.nodes[i]`; nested nodes rebuild the container's * `config..nodes[i]` with explicit spreads. * + * The panel leads with what the author named the node (its label); the node's + * id — the handle edges and expressions use — sits in a "Developer info" + * section that starts collapsed, and "Remove node" lives in the header's "···" + * menu rather than a footer button. + * * Both share the SAME schema-driven form. Beyond id / label / type, each node * type exposes a set of typed form fields (see * `flow-node-config`, or the engine-published configSchema) that edit scalar @@ -20,16 +25,22 @@ */ import * as React from 'react'; -import { Plus } from 'lucide-react'; +import { MoreHorizontal, Plus, Trash2 } from 'lucide-react'; import { resolveFlowTriggerKind } from '@objectstack/spec/automation'; -import { Input, Label } from '@object-ui/components'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, + Input, + Label, +} from '@object-ui/components'; import type { MetadataInspectorProps } from '../inspector-registry.js'; import { t, tFormat } from '../i18n.js'; import { InspectorShell, InspectorTextField, InspectorSelectField, - InspectorRemoveButton, InspectorEmptyState, InspectorReadOnlyReason, } from './_shared.js'; @@ -71,6 +82,7 @@ import { NESTED_NODE_KIND, parseNestedNodeId, locateFlowNode, type InspectorFlow import { displayRegionLabel } from '../previews/flow-region-label.js'; import type { FlowDesignerEdge } from '../previews/flow-canvas-layout.js'; import { ScreenPreview } from '../previews/ScreenPreview.js'; +import { ObjectLabelsProvider } from './ObjectPicker.js'; import { boundaryRefsAfterNodeRename, describeNodeRemovalRefusal, @@ -676,8 +688,8 @@ export function FlowNodeInspector({ // objectui#11838 — and it is refused, writing nothing, while a boundary // event's host or an expression root still names the node: a removal has no // new id for those to follow. `nodeRemovalRefusal` is the one rule the - // canvas's Delete key applies too; the refusal names each site under the - // button, and the node stays selected. + // canvas's Delete key applies too; the refusal names each site at the top of + // the panel, and the node stays selected. Neither path asks to confirm. const removalSites = removeRefusedId === node.id ? nodeRemovalRefusal(draft as Record, node.id) : null; const remove = () => { if (nodeRemovalRefusal(draft as Record, node.id)) { @@ -778,19 +790,40 @@ export function FlowNodeInspector({ title={node.label || node.id} onClose={onClearSelection} closeLabel={t('engine.inspector.flowNode.close', locale)} - footer={ + headerActions={ nested ? undefined : ( -
- {removalSites && ( -

- {describeNodeRemovalRefusal(node.id, removalSites, locale)} -

- )} - -
+ + + + + + + + {t('engine.inspector.flowNode.remove', locale)} + + + ) } > + {removalSites && ( +

+ {describeNodeRemovalRefusal(node.id, removalSites, locale)} +

+ )} {nested && (
{loc?.container ? flowNodeDisplayName(loc.container, locale) : null} @@ -806,16 +839,6 @@ export function FlowNodeInspector({ {flowNodeDisplayName(node, locale)}
)} - - {nested && ( -

{t('engine.inspector.flowNode.nestedIdHint', locale)}

- )} patchNode({ label: v })} disabled={readOnly} /> } + {/* The node's id is a handle, not a name: it stays reachable for renaming + but out of the way until the author opens it. */} +
+ + {t('engine.inspector.flowNode.developerInfo', locale)} + +
+ + {nested && ( +

{t('engine.inspector.flowNode.nestedIdHint', locale)}

+ )} +
+
+ {hasExtras || advReveal ? (
- {shell} - + + + {shell} + + ); } diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.updateRecordTarget-27834.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.updateRecordTarget-27834.test.tsx index 226bfd3159e..2fe2a9f26c6 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.updateRecordTarget-27834.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowNodeInspector.updateRecordTarget-27834.test.tsx @@ -143,11 +143,11 @@ describe('objectstack#27834 — the triggering record as the Update Records targ it('one press writes the id match, the line says so, and the saved flow passes the publish verdict', () => { const { config, flow } = mount({ id: 'write', type: 'update_record', label: 'Write', config: { objectName: 'ticket' } }); const filter = block('Filter'); - expect(within(filter.parentElement!).getByText('Targets the ticket record that started this flow.')).toBeInTheDocument(); + expect(within(filter.parentElement!).getByText('Targets the “ticket” record that started this flow.')).toBeInTheDocument(); fireEvent.click(screen.getByRole('button', { name: TARGET })); expect(config()).toEqual({ objectName: 'ticket', filter: TRIGGERING_FILTER }); expect(screen.queryByRole('button', { name: TARGET })).toBeNull(); - expect(screen.getByText('Updates the ticket record that started this flow.')).toBeInTheDocument(); + expect(screen.getByText('Updates the “ticket” record that started this flow.')).toBeInTheDocument(); // The row is an ordinary filter row: the key `id`, the value a CEL expression. expect(within(block('Filter')).getByDisplayValue('record.id')).toBeInTheDocument(); @@ -181,7 +181,7 @@ describe('objectstack#27834 — the triggering record as the Update Records targ config: { objectName: 'ticket', filter: { status: 'open' } }, }); expect(screen.queryByRole('button', { name: TARGET })).toBeNull(); - expect(screen.queryByText('Updates the ticket record that started this flow.')).toBeNull(); + expect(screen.queryByText('Updates the “ticket” record that started this flow.')).toBeNull(); expect(onPatch).not.toHaveBeenCalled(); expect(config()).toEqual({ objectName: 'ticket', filter: { status: 'open' } }); }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowRecipientsField.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowRecipientsField.test.tsx index 795ca1fd859..f975c0216ce 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowRecipientsField.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowRecipientsField.test.tsx @@ -24,6 +24,8 @@ * the object it was bound to and picks a fixed row. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach, beforeAll } from 'vitest'; import { render, screen, cleanup, fireEvent, within } from '@testing-library/react'; @@ -259,7 +261,7 @@ describe('objectui#11788 — the picker', () => { fireEvent.click(screen.getByRole('button', { name: 'Add recipient' })); await userEvent.click(within(row(0)).getByRole('combobox', { name: 'Recipient type' })); await userEvent.click(await screen.findByRole('option', { name: 'Expression' })); - const box = within(row(0)).getByPlaceholderText('CEL, e.g. ownerId'); + const box = within(row(0)).getByPlaceholderText('Formula, e.g. ownerId'); fireEvent.change(box, { target: { value: '{ownerId}' } }); expect(within(row(0)).getByRole('alert')).toBeInTheDocument(); fireEvent.change(box, { target: { value: 'ownerId' } }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx index ccb6dd4b629..f174cafcba0 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx @@ -59,7 +59,7 @@ import { useMetadataClient } from '../useMetadata.js'; import { useObjectFields } from '../previews/useObjectFields.js'; import { t, tFormat, useMetadataLocale, type SupportedLocale } from '../i18n.js'; import { flagUnknownValue, RequiredMarker } from './_shared.js'; -import { ObjectPicker } from './ObjectPicker.js'; +import { ObjectPicker, useObjectDisplayName } from './ObjectPicker.js'; import { APPROVER_REGISTRY_TYPES, APPROVER_TWO_SOURCE_BINDINGS, @@ -991,6 +991,16 @@ export interface ReferenceComboboxProps { * Hooks are called unconditionally (kind-gated args) so the * component is safe to use in a repeater where the kind changes per row. */ +/** "Fields of …", naming the object by its label (mounted only while the hint shows). */ +function ObjectFieldsOfHint({ objectName, locale }: { objectName: string; locale?: SupportedLocale }) { + const objectLabel = useObjectDisplayName(objectName); + return ( +

+ {tFormat('engine.inspector.reference.fieldsOf', locale, { object: objectLabel })} +

+ ); +} + export function ReferenceCombobox({ resolved, value, onCommit, onBlur, onSelect, disabled, placeholder, context, showHint = true, ariaLabel }: ReferenceComboboxProps) { const listId = React.useId(); // No `locale` prop here: the out-of-enum tier flag reads the designer's @@ -1212,6 +1222,8 @@ export function ReferenceCombobox({ resolved, value, onCommit, onBlur, onSelect, disabled={disabled} placeholder={placeholder} locale={locale} + // The flow node panel shows an object by its label; the machine name is on hover. + nameOnHover /> ); } @@ -1237,7 +1249,7 @@ export function ReferenceCombobox({ resolved, value, onCommit, onBlur, onSelect, )} {showHint && kind === 'object-field' && objectName && ( -

{tFormat('engine.inspector.reference.fieldsOf', locale, { object: objectName })}

+ )} {showHint && unresolvedObject && (

diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx index e2118e0a887..8d7f0caccd7 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectPicker.tsx @@ -151,6 +151,65 @@ export function useObjectCatalog() { return usePickerLoad(load); } +interface ObjectLabels { + labels: ReadonlyMap; + /** A sentence below names an object: read the catalog (once). */ + want: () => void; +} + +const ObjectLabelsContext = React.createContext(null); +const NO_LABELS: ReadonlyMap = new Map(); + +/** Reads the catalog and hands its labels up; mounted only once a label is wanted. */ +function ObjectLabelsReader({ onLabels }: { onLabels: (labels: ReadonlyMap) => void }) { + const catalog = useObjectCatalog(); + const data = catalog.status === 'loaded' ? catalog.data : undefined; + React.useEffect(() => { + if (!data) return; + const out = new Map(); + for (const e of data) if (e.label) out.set(e.name, e.label); + onLabels(out); + }, [data, onLabels]); + return null; +} + +/** + * Lends object labels to {@link useObjectDisplayName} for the panel below it. + * The catalog is read once for the whole panel, and only after a sentence + * that names an object mounts, so the sentences of one panel (the flow node + * panel's "Fields of …") cost one read between them and a panel that names + * no object reads nothing. + */ +export function ObjectLabelsProvider({ children }: { children?: React.ReactNode }) { + const [wanted, setWanted] = React.useState(false); + const [labels, setLabels] = React.useState>(NO_LABELS); + const want = React.useCallback(() => setWanted(true), []); + const value = React.useMemo(() => ({ labels, want }), [labels, want]); + return ( + + {wanted && } + {children} + + ); +} + +/** + * An object's label from the nearest {@link ObjectLabelsProvider}, else the + * name itself — for sentences that name an object, which read as the author's + * label and keep the machine name out of the text. A name the catalog does not + * know (an expression, a name not served), or a sentence with no provider + * above it, reads the name as it is. + */ +export function useObjectDisplayName(name: string | undefined): string { + const ctx = React.useContext(ObjectLabelsContext); + const want = ctx?.want; + React.useEffect(() => { + if (name && want) want(); + }, [name, want]); + if (!name) return ''; + return ctx?.labels.get(name) ?? name; +} + /** * The package the author is editing in: Studio's `/studio/:packageId/...` * route, else the `?package=` an editor URL carries (ADR-0048), where `all` is @@ -219,6 +278,12 @@ export interface ObjectPickerProps { * be resolved and the typed text is committed as before. */ objectsOnly?: boolean; + /** + * Keep the machine name off the panel: at rest the label alone shows, and + * the name rides on the input's hover title instead of the secondary line + * beneath it. Off by default; the flow node panel turns it on. + */ + nameOnHover?: boolean; } export function ObjectPicker({ @@ -230,6 +295,7 @@ export function ObjectPicker({ placeholder, locale: localeProp, objectsOnly = false, + nameOnHover = false, }: ObjectPickerProps) { const contextLocale = useMetadataLocale(); const locale = localeProp ?? contextLocale; @@ -437,7 +503,8 @@ export function ObjectPicker({ aria-expanded={open} aria-controls={open ? listId : undefined} aria-activedescendant={open && activeRow ? activeRow.id : undefined} - aria-describedby={restingLabel ? nameLineId : undefined} + aria-describedby={restingLabel && !nameOnHover ? nameLineId : undefined} + title={restingLabel && nameOnHover ? value : undefined} autoComplete="off" spellCheck={false} value={shown} @@ -623,7 +690,7 @@ export function ObjectPicker({ )} - {restingLabel && ( + {restingLabel && !nameOnHover && (

{value}

diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/_shared.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/_shared.tsx index f17544e16f7..ce7abd08dcd 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/_shared.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/_shared.tsx @@ -28,6 +28,7 @@ */ import * as React from 'react'; +import { createPortal } from 'react-dom'; import { ArrowDown, ArrowUp, Trash2, X } from 'lucide-react'; import { cn } from '@object-ui/components'; import { @@ -83,9 +84,15 @@ export interface InspectorShellProps { * * `onSelectionChange` lets a field inside move the host's selection — the * decision's branch cards use it to open a connection's own inspector. + * + * `headerActionsTarget` is an element inside the host's own header. When it is + * set, the shell draws its header actions there, so a selection's menu (the + * flow node's "···") sits in the one title bar the author sees instead of at + * the top of the body. */ export interface InspectorShellHost { onSelectionChange?: (selection: { kind: string; id: string; label?: string }) => void; + headerActionsTarget?: HTMLElement | null; } const InspectorShellHostContext = React.createContext(null); @@ -108,7 +115,12 @@ export function InspectorShell({ kindLabel, title, onClose, closeLabel: closeLab return (
- {headerActions &&
{headerActions}
} + {headerActions && + (host.headerActionsTarget ? ( + createPortal(headerActions, host.headerActionsTarget) + ) : ( +
{headerActions}
+ ))} {children}
{footer &&
{footer}
} diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12101.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12101.test.tsx index 03fe3adef46..c812c9dca5f 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12101.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12101.test.tsx @@ -47,7 +47,7 @@ import '@objectstack/lint'; afterEach(cleanup); const PICK = 'Insert a reference'; -const TOGGLE = 'Write as a CEL expression'; +const TOGGLE = 'Write as a formula'; const env = (source: string) => ({ dialect: 'cel', source }); diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12372.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12372.test.tsx index bfc5207a6d7..e6b794470e9 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12372.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/flowValueSlots-12372.test.tsx @@ -24,6 +24,8 @@ * `{var}` token. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import { describe, it, expect, afterEach, vi } from 'vitest'; import { render, screen, cleanup, fireEvent } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; @@ -53,7 +55,7 @@ import type { ScopeGroup } from './useFlowScope'; afterEach(cleanup); const PICK = 'Insert a reference'; -const TOGGLE = 'Write as a CEL expression'; +const TOGGLE = 'Write as a formula'; const env = (source: string) => ({ dialect: 'cel', source }); const BODY = { nodes: [{ id: 'inner', type: 'assignment', label: 'Inner' }], edges: [] }; diff --git a/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.i18n-10586.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.i18n-10586.test.tsx index ee483548d01..80968b5cd43 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.i18n-10586.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.i18n-10586.test.tsx @@ -33,6 +33,9 @@ * two read) — the membership-tier flag and the raw CEL editor's label. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/formula'; +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, cleanup, fireEvent, act } from '@testing-library/react'; @@ -384,7 +387,7 @@ const REFERENCE_EN = [ "Resolved at runtime from the submitter's manager — no value needed.", // ADR-0142 D6 replaced the "not supported" warning with what the value names. "The queue's machine name. Its members when the step opens are the approvers; an empty queue adds nobody.", - 'Fields of account.', + 'Fields of “account”.', 'Set the flow’s trigger object (on the Start node) to list fields.', 'Actions of slack.', 'Choose a Connector above to list its actions.', diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.tsx index ce614315ecd..871f4c0230c 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/AppNavCanvas.tsx @@ -85,6 +85,13 @@ function navKind(it: RawNav): string { return typeof it.type === 'string' && it.type ? it.type : 'untyped'; } +/** + * The host's name for an entry's kind, drawn on its badge in place of the raw + * `type` (Studio passes the name its navigation list shows). `null` — no host + * name — keeps the raw kind. + */ +const NavKindLabelContext = React.createContext<((item: RawNav) => string) | null>(null); + /** * Per-kind color tone — keeps nav kinds scannable at a glance and * mirrors the field-type category tinting used elsewhere in Studio. @@ -466,6 +473,11 @@ export interface AppNavCanvasProps { * no departure guard leaves it out. */ onRenamePendingChange?: (label: string | null) => void; + /** + * The name each entry's kind badge shows, in place of the raw `type`; an + * empty answer keeps the raw kind. Omitted, every badge shows the raw kind. + */ + kindLabel?: (item: { type?: string; viewName?: unknown }) => string; } export function AppNavCanvas({ @@ -475,6 +487,7 @@ export function AppNavCanvas({ selection, onSelectionChange, onRenamePendingChange, + kindLabel, }: AppNavCanvasProps) { const locale = useMetadataLocale(); const targetLabel = useNavTargetLabel(); @@ -594,6 +607,7 @@ export function AppNavCanvas({ ); return ( +
{/* objectui#12519 — in the Studio's 240 px rail the add button takes a line of its own rather than folding its words. */} @@ -667,6 +681,7 @@ export function AppNavCanvas({ )}
+ ); } @@ -784,6 +799,8 @@ function NavCard({ }) { const kind = navKind(item); const tone = kindTone(kind); + const hostKindLabel = React.useContext(NavKindLabelContext); + const kindText = hostKindLabel?.(item) || kind; const target = navTarget(item); const label = navLabel(item, index, locale, targetLabel); // The rename edits the AUTHORED label: `''` for an entry that has none, whose @@ -905,7 +922,7 @@ function NavCard({ )} - {kind} + {kindText} {/* An entry with no target yet: kept in the editor, left out of the save (`isIncompleteNavEntry`). */} diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.nodeIdPositions-11838.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.nodeIdPositions-11838.test.tsx index 666cd56d942..6a3388ca76b 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.nodeIdPositions-11838.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.nodeIdPositions-11838.test.tsx @@ -24,6 +24,8 @@ * write that copies a node — so `WRITES` holds none. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent, within } from '@testing-library/react'; @@ -162,7 +164,10 @@ function pickCreateRecord() { const alerts = () => screen.queryAllByRole('alert').map((el) => el.textContent ?? ''); const pressDelete = () => fireEvent.keyDown(screen.getByRole('application', { name: 'Flow canvas' }), { key: 'Delete' }); -const clickRemove = () => fireEvent.click(screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') })); +const clickRemove = () => { + fireEvent.pointerDown(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }), { button: 0, ctrlKey: false }); + fireEvent.click(screen.getByRole('menuitem', { name: t('engine.inspector.flowNode.remove', 'en-US') })); +}; /** * `applied` — the write changed the draft and carried every position; diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.removeNode-11772.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.removeNode-11772.test.tsx index 1889bce38a9..5f10f024553 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.removeNode-11772.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/FlowPreview.removeNode-11772.test.tsx @@ -20,6 +20,8 @@ * re-attached to the new node: the published flow then ran it once per edge. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent, act, within } from '@testing-library/react'; @@ -149,7 +151,8 @@ function insertOnTheOnlyEdge() { } function removeSelectedNode() { - fireEvent.click(screen.getByRole('button', { name: t('engine.inspector.flowNode.remove', 'en-US') })); + fireEvent.pointerDown(screen.getByRole('button', { name: t('engine.inspector.flowNode.moreActions', 'en-US') }), { button: 0, ctrlKey: false }); + fireEvent.click(screen.getByRole('menuitem', { name: t('engine.inspector.flowNode.remove', 'en-US') })); } /** The "+" under a node card — select-then-append, as in the card's step 4. */ diff --git a/ui/packages/app-shell/src/views/metadata-admin/previews/ViewColumnPanes.tsx b/ui/packages/app-shell/src/views/metadata-admin/previews/ViewColumnPanes.tsx index c09412560d4..fe31c53d3e0 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/previews/ViewColumnPanes.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/previews/ViewColumnPanes.tsx @@ -146,6 +146,14 @@ export function ColumnChip({ /* ───────────────────────── Field list row (vertical) ──────────────────── */ +/** + * The default of {@link FieldListRow}'s `nameOnHover` for the rows below it. + * Studio's list-view panel provides `true` around the list it hosts, so its + * rows keep the machine name on hover only; nothing else provides it, so the + * Setup designers' rows are unchanged. + */ +export const FieldListRowNameOnHover = React.createContext(false); + /** * FieldListRow — a full-width, vertically-stacked variant of {@link ColumnChip} * for the right-panel Fields list. Same HTML5 drag-and-drop contract (click to @@ -169,6 +177,7 @@ export function FieldListRow({ onDragOverRow, onDropRow, copilotAdded, + nameOnHover: nameOnHoverProp, }: { index: number; label: string; @@ -189,7 +198,14 @@ export function FieldListRow({ * the row carries the copilot's draft chip. Absent, the row is unchanged. */ copilotAdded?: boolean; + /** + * Show the machine name only on hover (the label's title), not as the + * secondary text beside it. Omitted, {@link FieldListRowNameOnHover} decides. + */ + nameOnHover?: boolean; }) { + const nameOnHoverDefault = React.useContext(FieldListRowNameOnHover); + const nameOnHover = nameOnHoverProp ?? nameOnHoverDefault; // The designer locale, read as this file's `AddFieldPopover` reads it // (objectui#10862): both hosts (`FieldsListEditor`, `ReportDefaultInspector`) // render the popover beside these rows. @@ -253,7 +269,7 @@ export function FieldListRow({ {copilotAdded && ( )} - {fieldName && fieldName !== label && ( + {fieldName && fieldName !== label && !nameOnHover && ( {fieldName} diff --git a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.problemsAgree-27799.test.tsx b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.problemsAgree-27799.test.tsx index fe194370370..920a185c466 100644 --- a/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.problemsAgree-27799.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/AutomationsPillar.problemsAgree-27799.test.tsx @@ -188,7 +188,7 @@ async function writeBlankExpression() { const key = within(map).getByPlaceholderText('Key'); fireEvent.change(key, { target: { value: 'id' } }); fireEvent.blur(key); - fireEvent.click(within(map).getByRole('button', { name: 'Write as a CEL expression' })); + fireEvent.click(within(map).getByRole('button', { name: 'Write as a formula' })); return { map, readsBefore }; } @@ -232,7 +232,7 @@ describe('Automations page — Problems and the node agree on a blank expression await screen.findByTestId('flow-problem-target', {}, { timeout: 6000 }); const saves = mockClient.save.mock.calls.length; - const source = within(map).getByPlaceholderText('CEL expression, e.g. joinNonEmpty(…)'); + const source = within(map).getByPlaceholderText('Formula, e.g. joinNonEmpty(…)'); fireEvent.change(source, { target: { value: 'record.id' } }); fireEvent.blur(source); diff --git a/ui/packages/app-shell/src/views/studio-design/InterfacesNavRail.editKinds-34796.test.tsx b/ui/packages/app-shell/src/views/studio-design/InterfacesNavRail.editKinds-34796.test.tsx new file mode 100644 index 00000000000..9b0bc1d383a --- /dev/null +++ b/ui/packages/app-shell/src/views/studio-design/InterfacesNavRail.editKinds-34796.test.tsx @@ -0,0 +1,106 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#34796 — in Studio's navigation edit mode each entry's kind badge + * reads the kind the navigation list tags it with (`navKindName`), not the raw + * `type`: an object, a view (an object entry naming a kanban view), a + * dashboard and a page. The Setup designer passes no kind names, so its badges + * keep the raw type (the CONTROL). + */ + +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; +import '@testing-library/jest-dom/vitest'; +import * as React from 'react'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { cleanup, render, screen } from '@testing-library/react'; +import { I18nProvider } from '@object-ui/i18n'; +import { MetadataCtx } from '@object-ui/react'; + +import { AppNavCanvas } from '../metadata-admin/previews/AppNavCanvas'; +import { navKindName } from './InterfacesNavRail'; +// The zh rows live in the lazy `studio` namespace; resident before any case. +import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio'; +await loadStudioCatalogue('zh'); + +afterEach(cleanup); + +const METADATA = { + apps: [], + objects: [{ name: 'meeting', label: 'Meeting' }], + dashboards: [], + reports: [], + pages: [], + loading: false, + error: null, + refresh: async () => {}, + invalidate: () => {}, + ensureType: async () => [], + getItem: async () => null, + getItemsByType: () => [], + getTypeStatus: () => 'ready' as const, +}; + +const NAV = [ + { id: 'nav_meeting', type: 'object', label: 'Meetings', objectName: 'meeting' }, + { id: 'nav_board', type: 'object', label: 'Todo board', objectName: 'meeting', viewName: 'kanban' }, + { id: 'nav_dash', type: 'dashboard', label: 'Overview', dashboardName: 'overview' }, + { id: 'nav_home', type: 'page', label: 'Home', pageName: 'home' }, +]; + +function renderCanvas(language: 'en' | 'zh', locale: string, withKindNames: boolean) { + render( + + + navKindName({ type: item.type, viewName: typeof item.viewName === 'string' ? item.viewName : undefined }, locale) + : undefined + } + /> + + , + ); +} + +/** The kind badge on the card whose label is `label`. */ +function badgeOf(label: string): string { + const card = screen.getByText(label).closest('[draggable], [role="button"], li, div[class*="rounded"]') as HTMLElement; + const badge = [...card.querySelectorAll('div, span')].find((el) => el.className.includes('h-5') && el.className.includes('px-1.5')); + return badge?.textContent ?? ''; +} + +describe("Studio's navigation edit mode names each kind as the navigation list does (objectstack#34796)", () => { + it('zh: object, view (a kanban entry), dashboard and page read 对象 / 视图 / 仪表盘 / 页面, and no badge reads `object`', () => { + renderCanvas('zh', 'zh-CN', true); + expect(badgeOf('Meetings')).toBe(navKindName(NAV[0], 'zh-CN')); + expect(badgeOf('Todo board')).toBe(navKindName(NAV[1], 'zh-CN')); + expect(badgeOf('Overview')).toBe(navKindName(NAV[2], 'zh-CN')); + expect(badgeOf('Home')).toBe(navKindName(NAV[3], 'zh-CN')); + expect([badgeOf('Meetings'), badgeOf('Todo board'), badgeOf('Overview'), badgeOf('Home')]).toEqual([ + '对象', + '视图', + '仪表盘', + '页面', + ]); + expect(screen.queryByText('object', { exact: true })).toBeNull(); + }); + + it('en reads the same kinds in English words', () => { + renderCanvas('en', 'en-US', true); + expect(badgeOf('Todo board')).toBe(navKindName(NAV[1], 'en-US')); + expect(badgeOf('Todo board')).not.toBe('object'); + }); + + it('CONTROL: without kind names (the Setup designer) the badge keeps the raw type', () => { + renderCanvas('en', 'en-US', false); + expect(badgeOf('Meetings')).toBe('object'); + expect(badgeOf('Todo board')).toBe('object'); + }); +}); diff --git a/ui/packages/app-shell/src/views/studio-design/InterfacesPillar.offNavListViews-30046.test.tsx b/ui/packages/app-shell/src/views/studio-design/InterfacesPillar.offNavListViews-30046.test.tsx index 2eea4088132..dc0bfc4cc58 100644 --- a/ui/packages/app-shell/src/views/studio-design/InterfacesPillar.offNavListViews-30046.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/InterfacesPillar.offNavListViews-30046.test.tsx @@ -28,6 +28,8 @@ * opens as itself. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -273,7 +275,7 @@ function rowTexts(group: HTMLElement): string[] { } /** The view item name the object page's panel shows beneath its title. */ -const shownView = () => screen.queryByTestId('list-view-name')?.textContent ?? null; +const shownView = () => screen.queryByTestId('studio-list-view-inspector')?.getAttribute('data-view-id') ?? null; /** Every view row's read settled: the drafts headers and the draft-overlaid list. */ async function viewsRead() { diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.addView-27836.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.addView-27836.test.tsx index e641557e142..251f8f751a4 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.addView-27836.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.addView-27836.test.tsx @@ -22,6 +22,8 @@ * stays open, and the panel says why. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -183,7 +185,7 @@ async function openSwitcher(): Promise { } /** The view item name the panel shows beneath its title. */ -const shownView = () => screen.getByTestId('list-view-name').textContent; +const shownView = () => screen.getByTestId('studio-list-view-inspector').getAttribute('data-view-id'); const typeCard = (type: string) => Array.from(document.querySelectorAll('button[data-testid^="create-view-type-"]')).find( diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.displayTitle-13151.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.displayTitle-13151.test.tsx index 61f1f9ae269..ad28ef8449f 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.displayTitle-13151.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.displayTitle-13151.test.tsx @@ -20,6 +20,8 @@ * - CONTROL: a view with a label is headed by that label, as before. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -140,10 +142,11 @@ describe('the list-view panel names the view by its display name (objectui#13151 const notice = await loaded('list-view-not-created'); expect(headerTitle()).toBe('Default view'); - expect(notice).toHaveTextContent('There is no list view “Default view” yet.'); - expect(notice).not.toHaveTextContent('acme_loan.default'); - // The machine name stays, as the secondary line. - expect(screen.getByTestId('list-view-name')).toHaveTextContent('acme_loan.default'); + // objectstack#34796 — one sentence, and no `object.view` machine name in the panel. + expect(notice).toHaveTextContent('Changes save as a draft first.'); + const panel = screen.getByTestId('studio-list-view-inspector'); + expect(panel).not.toHaveTextContent('acme_loan.default'); + expect(panel).toHaveAttribute('data-view-id', 'acme_loan.default'); }); it('reads in the designer locale', async () => { @@ -151,8 +154,8 @@ describe('the list-view panel names the view by its display name (objectui#13151 const notice = await loaded('list-view-not-created'); expect(headerTitle('zh-CN')).toBe('默认视图'); - expect(notice).toHaveTextContent('还没有列表视图「默认视图」。'); - expect(notice).not.toHaveTextContent('acme_loan.default'); + expect(notice).toHaveTextContent('改动先存为草稿。'); + expect(screen.getByTestId('studio-list-view-inspector')).not.toHaveTextContent('acme_loan.default'); }); it('an unlabelled named view is headed by the key the nav entry names it by', async () => { @@ -166,7 +169,8 @@ describe('the list-view panel names the view by its display name (objectui#13151 await loaded('list-view-columns'); expect(headerTitle()).toBe('open'); - expect(screen.getByTestId('list-view-name')).toHaveTextContent('acme_loan.open'); + expect(screen.getByTestId('studio-list-view-inspector')).toHaveAttribute('data-view-id', 'acme_loan.open'); + expect(screen.getByTestId('studio-list-view-inspector')).not.toHaveTextContent('acme_loan.open'); }); it('an unlabelled item that is not a list view: the not-list sentence names the same title', async () => { @@ -197,6 +201,6 @@ describe('the list-view panel names the view by its display name (objectui#13151 await waitFor(() => expect(headerTitle()).toBe('Active loans')); expect(screen.queryByTestId('list-view-not-created')).not.toBeInTheDocument(); - expect(screen.getByTestId('list-view-name')).toHaveTextContent('acme_loan.default'); + expect(screen.getByTestId('studio-list-view-inspector')).toHaveAttribute('data-view-id', 'acme_loan.default'); }); }); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.namesOnHover-34796.test.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.namesOnHover-34796.test.tsx new file mode 100644 index 00000000000..78bf31f3751 --- /dev/null +++ b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.namesOnHover-34796.test.tsx @@ -0,0 +1,159 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * objectstack#34796 — Studio's list-view panel shows each column by its label; + * the field's machine name is on the row's hover title only. The row component + * is shared with the Setup designers, whose rows keep the name beside the + * label (the CONTROL below). + * + * The harness is `ObjectListViewInspector.displayTitle-13151.test.tsx`'s: the + * real panel over a metadata client answering from an in-memory server. + */ + +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; +import '@testing-library/jest-dom/vitest'; +import * as React from 'react'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { cleanup, render, screen, waitFor } from '@testing-library/react'; +import { MetadataCtx, type MetadataContextValue } from '@object-ui/react'; +import { MetadataClient } from '@object-ui/data-objectstack'; + +const PKG = 'com.acme.app'; + +const OBJECT_DEF = { + name: 'acme_loan', + label: 'Loan', + fields: { + book: { name: 'book', label: 'Book', type: 'text' }, + status: { name: 'status', label: 'Status', type: 'text' }, + }, +}; + +/** The views the server holds, by name. */ +const server = { active: new Map>() }; + +const json = (status: number, body: unknown) => + new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } }); + +async function serve(input: RequestInfo | URL, init?: RequestInit): Promise { + const method = (init?.method ?? 'GET').toUpperCase(); + const url = new URL(String(input), 'http://studio.test'); + const meta = url.pathname.match(/^\/api\/v1\/meta\/(.+)$/); + if (!meta) return json(404, { error: { code: 'NOT_FOUND', message: 'absent' } }); + const seg = meta[1].split('/').map(decodeURIComponent); + if (method === 'PUT') return json(200, { success: true, version: 'v2', state: 'draft' }); + if (seg[0] === 'object' && seg.length === 2) return json(200, { type: 'object', name: seg[1], item: OBJECT_DEF }); + if (seg.length === 2 && url.searchParams.get('state') === 'draft') { + return json(404, { error: { code: 'NO_DRAFT', message: 'absent' } }); + } + const row = server.active.get(`${seg[0]}/${seg[1]}`); + if (seg.length === 3 && seg[2] === 'layers') { + return row + ? json(200, { code: null, overlay: row, overlayScope: 'env', effective: row }) + : json(404, { error: { code: 'NOT_FOUND', message: 'absent' } }); + } + return row ? json(200, { type: seg[0], name: seg[1], item: row }) : json(404, { error: { code: 'NOT_FOUND', message: 'absent' } }); +} + +const client = new MetadataClient({ baseUrl: '', fetch: vi.fn(serve) as unknown as typeof fetch }); + +vi.mock('../metadata-admin/useMetadata', async (importOriginal) => { + const mod = await importOriginal(); + return { ...mod, useMetadataClient: () => client }; +}); + +import { ObjectListViewInspector, useObjectListViewDraft } from './ObjectListViewInspector'; +import type { Surface } from './navSurface'; +import { DraftTargetLabels, type DraftTargetLabel } from '../../hooks/useNavTargetLabel'; +import { FieldListRow } from '../metadata-admin/previews/ViewColumnPanes'; + +function metadataOf(objects: unknown[]): MetadataContextValue { + return { + apps: [], + objects, + dashboards: [], + reports: [], + pages: [], + loading: false, + error: null, + refresh: async () => {}, + invalidate: () => {}, + ensureType: async () => [], + getItem: async () => null, + getItemsByType: () => [], + }; +} + +function Host({ leaf, locale }: { leaf: Surface; locale: string }) { + const listView = useObjectListViewDraft({ client, packageId: PKG, leaf, publishNonce: 0 }); + return ; +} + +function mount({ + leaf = { type: 'object', name: 'acme_loan', label: 'Loans' } as Surface, + locale = 'en-US', + objects = [OBJECT_DEF] as unknown[], + drafts = [] as DraftTargetLabel[], +} = {}) { + return render( + + + + + , + ); +} + + +beforeEach(() => { + server.active.clear(); +}); +afterEach(cleanup); + +describe("Studio's list-view column rows keep field names on hover (objectstack#34796)", () => { + it('a row reads its label alone, with the field name as its title', async () => { + server.active.set('view/acme_loan.default', { + name: 'acme_loan.default', + object: 'acme_loan', + viewKind: 'list', + label: 'Active loans', + isDefault: true, + config: { type: 'grid', data: { provider: 'object', object: 'acme_loan' }, columns: ['book', 'status'] }, + }); + mount(); + const columns = await screen.findByTestId('list-view-columns', undefined, { timeout: 8000 }); + await waitFor(() => expect(columns).toHaveTextContent('Book')); + expect(columns).toHaveTextContent('Status'); + // No visible machine name: neither as text nor as the old secondary code element. + expect(columns.textContent).not.toMatch(/\bbook\b|\bstatus\b/); + expect(columns.querySelector('code')).toBeNull(); + expect(screen.getByTitle('book')).toHaveTextContent('Book'); + expect(screen.getByTitle('status')).toHaveTextContent('Status'); + }); + + it('CONTROL: outside the Studio panel the shared row keeps the name beside the label', () => { + const noop = () => {}; + render( + , + ); + const code = document.querySelector('code'); + expect(code).not.toBeNull(); + expect(code).toHaveTextContent('book'); + }); +}); diff --git a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx index fdb84f49d54..919e4f4df49 100644 --- a/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx +++ b/ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx @@ -104,6 +104,7 @@ import { stripReadDecorations } from '@objectstack/spec/kernel'; import { NavigationModeSchema, resolveI18nLabel, type I18nLabel, type NavigationMode } from '@objectstack/spec/ui'; import { InspectorReorderButtons, InspectorShell } from '../metadata-admin/inspectors/_shared.js'; import { FieldsListEditor } from '../metadata-admin/previews/FieldsListEditor.js'; +import { FieldListRowNameOnHover } from '../metadata-admin/previews/ViewColumnPanes.js'; import { useObjectFields } from '../metadata-admin/previews/useObjectFields.js'; import { colFieldName } from '../metadata-admin/previews/view-column-io.js'; import { WIDGETS, type ObjectFieldOption } from '../metadata-admin/widgets.js'; @@ -1435,14 +1436,9 @@ export function ObjectListViewInspector({ ) : null } > -
- {/* objectui#13151 — the machine name, secondary to the title, as a - Studio row shows it (smaller, monospace, only where it differs). */} - {target.viewId !== title && ( -

- {target.viewId} -

- )} + {/* objectstack#34796 — no `object.view` machine name under the title: the + panel names the view by its label alone; the name stays an attribute. */} +
{readOnly ? (

{t('engine.studio.inspector.listView.readOnly', locale)} @@ -1476,8 +1472,8 @@ export function ObjectListViewInspector({ ) : ( <> {!row && ( -

- {tFormat('engine.studio.inspector.listView.notCreated', locale, { view: title })} +

+ {t('engine.studio.inspector.listView.notCreated', locale)}

)} {body.type === 'kanban' && ( @@ -1516,21 +1512,25 @@ export function ObjectListViewInspector({ /> )}
- { - if (isPlainObject(patch.config)) writeBody(patch.config); - }} - onSelectionChange={selectColumn} - copilotAdded={addedColumns.length > 0 ? new Set(addedColumns) : undefined} - /> + {/* objectstack#34796 — a column row shows its label; the field's + machine name is on hover only. */} + + { + if (isPlainObject(patch.config)) writeBody(patch.config); + }} + onSelectionChange={selectColumn} + copilotAdded={addedColumns.length > 0 ? new Set(addedColumns) : undefined} + /> + {/* A copilot change to `columns` that added no column (a reorder, a removal) has no row to mark: the setting carries the chip. */} {columnsMark && addedColumns.length === 0 && } diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewInspector-11823.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewInspector-11823.test.tsx index 7deab1d9be9..cd04e463333 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewInspector-11823.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewInspector-11823.test.tsx @@ -19,6 +19,8 @@ * - CONTROL: a studio-canvas leaf of another type keeps the statement. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -175,15 +177,17 @@ describe('an object leaf\'s Properties panel edits its list view (objectui#11823 expect(within(panel).getByTestId('list-view-filter')).toHaveTextContent('Filter'); expect(within(panel).getByTestId('list-view-sort')).toHaveTextContent('Sort'); // The loaded view: its two columns, and its filter summarised by field. - expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('title'); - expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('status'); + // Rows read the field label; the field name is on the row's hover title (objectstack#34796). + expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('Title'); + expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('Status'); + expect(within(panel).getByTestId('list-view-columns').querySelector('[title="status"]')).not.toBeNull(); expect(within(panel).getByTestId('filter-builder-trigger')).toHaveTextContent('Status'); expect(document.body.textContent).not.toContain(NO_BLOCKS); }); it('writes an edit to the package draft as a spec-valid view item, and the canvas shows it', async () => { const panel = await openObjectLeaf(); - await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('status')); + await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('Status')); // objectui#12693 — the row, and so its remove control, is named by the field's label. fireEvent.click(within(panel).getByRole('button', { name: 'Remove Status' })); @@ -227,9 +231,8 @@ describe('an object leaf\'s Properties panel edits its list view (objectui#11823 it('creates a view the object does not have yet at the first edit, seeded with the default columns', async () => { views = {}; const panel = await openObjectLeaf(); - // objectui#13151 — the notice names the view by the object's label and its - // role (the object is "Task", its nav entry "Tasks"), never `.`. - await waitFor(() => expect(within(panel).getByTestId('list-view-not-created')).toHaveTextContent('“Default view”')); + // objectstack#34796 — the notice is one sentence, and never `.`. + await waitFor(() => expect(within(panel).getByTestId('list-view-not-created')).toHaveTextContent('Changes save as a draft first.')); expect(within(panel).getByTestId('list-view-not-created')).not.toHaveTextContent('showcase_task.default'); // Nothing is saved yet, and the canvas shows the list the running app // shows an object with no view: its default columns. @@ -264,7 +267,7 @@ describe('an object leaf\'s Properties panel edits its list view (objectui#11823 it('shows the panel read-only on a read-only package, and writes nothing', async () => { const panel = await openObjectLeaf(true); - await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('status')); + await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('Status')); expect(within(panel).getByTestId('list-view-read-only')).toBeInTheDocument(); // objectui#12693 — the name the remove control would carry is the field's label. @@ -286,7 +289,7 @@ describe('an object leaf\'s Properties panel edits its list view (objectui#11823 }); mockClient.save.mockRejectedValueOnce(refusal); const panel = await openObjectLeaf(); - await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('status')); + await waitFor(() => expect(within(panel).getByTestId('list-view-columns')).toHaveTextContent('Status')); await addSortOnFirstField(panel); const strip = await within(panel).findByTestId('list-view-refusal', undefined, { timeout: 8000 }); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewSwitch-27896.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewSwitch-27896.test.tsx index b669d7f7555..ff60dedd126 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewSwitch-27896.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.listViewSwitch-27896.test.tsx @@ -28,6 +28,8 @@ * none; CONTROL: a link to another entry's view is not taken. */ +// Paid at collection, not inside a clocked case (check:test-source-alias). +import '@objectstack/lint'; import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; @@ -208,7 +210,7 @@ const panelTitle = () => screen.getByTestId('studio-list-view-inspector').parentElement?.parentElement?.querySelector('div.mt-1[title]')?.textContent; /** The view item name the panel shows beneath its title. */ -const shownView = () => screen.queryByTestId('list-view-name')?.textContent; +const shownView = () => screen.queryByTestId('studio-list-view-inspector')?.getAttribute('data-view-id'); function viewSaves(): Array<[string, string, Record, Record]> { return mockClient.save.mock.calls.filter((c: unknown[]) => c[0] === 'view') as never; diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx index 53963f71844..eca924352a6 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx @@ -5341,6 +5341,8 @@ export function InterfacesPillar({ selection={navSel} onSelectionChange={(s) => setNavSel(s ? { kind: s.kind, id: s.id } : null)} onRenamePendingChange={setNavRenamePending} + // objectstack#34796 — each entry's kind in the words the navigation list uses. + kindLabel={(item) => navKindName({ type: item.type, viewName: typeof item.viewName === 'string' ? item.viewName : undefined }, locale)} /> ) : navTree.length === 0 && !(appStatus === 'ready' && placesAnyNav(navPlacement)) ? (

@@ -8321,6 +8323,9 @@ export function AutomationsPillar({ const [loading, setLoading] = React.useState(false); const [saving, setSaving] = React.useState(false); const [hasDraft, setHasDraft] = React.useState(false); + // The aside header's slot for the hosted inspector's header actions (the + // flow node's "···" menu), so they sit in the title bar (`InspectorShellHost`). + const [configHeaderSlot, setConfigHeaderSlot] = React.useState(null); // objectstack#26858 — the server's verdict on the flow on screen: the pending // draft's (what its publish will refuse), else the layered read's. Taken off // each read, never computed here; the inspectors read it at their paths. @@ -9876,6 +9881,7 @@ export function AutomationsPillar({ title={heading && } onClose={selection ? () => setSelection(null) : undefined} closeLabel={t('engine.studio.deselect', locale)} + actions={heading ? : undefined} // objectui#12453 — a read-only package saves no draft: no footer. // objectstack#28570 — a customized flow saves into the pair. footer={ @@ -9890,7 +9896,9 @@ export function AutomationsPillar({ bodyClassName={heading ? 'p-0' : undefined} > {heading ? ( - {configBodyEl} + + {configBodyEl} + ) : ( configBodyEl )} diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index 4e928becb72..1d38b987f52 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -730,15 +730,15 @@ const STUDIO_EN: Record = { 'engine.inspector.flowNode.kv.empty': 'No entries yet.', // objectui#7588 — the per-value text / expression toggle on a `value`-role // map (the assignment node's `assignments`); see `flow-value-envelope.ts`. - 'engine.inspector.flowNode.kv.asExpression': 'Write as a CEL expression', - 'engine.inspector.flowNode.kv.expressionPlaceholder': 'CEL expression, e.g. joinNonEmpty(…)', - 'engine.inspector.flowNode.kv.expressionNeeded': 'This value needs an expression. Write one, or switch the value back to text.', + 'engine.inspector.flowNode.kv.asExpression': 'Write as a formula', + 'engine.inspector.flowNode.kv.expressionPlaceholder': 'Formula, e.g. joinNonEmpty(…)', + 'engine.inspector.flowNode.kv.expressionNeeded': 'This value needs a formula. Write one, or switch the value back to text.', // objectstack#33838 — a connector Input key the action does not declare: the run refuses it. 'engine.inspector.flowNode.kv.undeclaredKey': 'The action does not declare this input, so the run refuses it. Remove it, or pick an action that declares it.', // objectstack#27834 — the Update Records filter's "Triggering record" target. 'engine.inspector.flowNode.triggeringRecord.use': 'Update the triggering record', - 'engine.inspector.flowNode.triggeringRecord.hint': 'Targets the {object} record that started this flow.', - 'engine.inspector.flowNode.triggeringRecord.active': 'Updates the {object} record that started this flow.', + 'engine.inspector.flowNode.triggeringRecord.hint': 'Targets the “{object}” record that started this flow.', + 'engine.inspector.flowNode.triggeringRecord.active': 'Updates the “{object}” record that started this flow.', 'engine.inspector.flowNode.list.add': 'Add item', 'engine.inspector.flowNode.list.item': 'Value', 'engine.inspector.flowNode.list.remove': 'Remove item', @@ -750,6 +750,9 @@ const STUDIO_EN: Record = { 'engine.inspector.flowNode.help.learnMore': 'Learn more', 'engine.inspector.flowNode.help.showLess': 'Show less', 'engine.inspector.flowNode.remove': 'Remove node', + // objectstack#34796 — the node panel's header menu and its collapsed section for the node id. + 'engine.inspector.flowNode.moreActions': 'More actions', + 'engine.inspector.flowNode.developerInfo': 'Developer info', // App nav inspector 'engine.inspector.appNav.kind': 'Nav Item', 'engine.inspector.appNav.close': 'Close nav item', @@ -1591,7 +1594,7 @@ const STUDIO_EN: Record = { 'engine.inspector.reference.managerPlaceholder': 'Resolved automatically', 'engine.inspector.reference.managerHint': "Resolved at runtime from the submitter's manager — no value needed.", 'engine.inspector.reference.queueHint': "The queue's machine name. Its members when the step opens are the approvers; an empty queue adds nobody.", - 'engine.inspector.reference.fieldsOf': 'Fields of {object}.', + 'engine.inspector.reference.fieldsOf': 'Fields of “{object}”.', 'engine.inspector.reference.setTriggerObject': 'Set the flow’s trigger object (on the Start node) to list fields.', 'engine.inspector.reference.actionsOf': 'Actions of {connector}.', 'engine.inspector.reference.chooseConnector': 'Choose a Connector above to list its actions.', @@ -1608,7 +1611,7 @@ const STUDIO_EN: Record = { 'engine.inspector.recipients.placeholder.user': 'Pick a user', 'engine.inspector.recipients.placeholder.team': 'Pick a team', 'engine.inspector.recipients.placeholder.email': 'name@example.com', - 'engine.inspector.recipients.placeholder.expression': 'CEL, e.g. ownerId', + 'engine.inspector.recipients.placeholder.expression': 'Formula, e.g. ownerId', 'engine.inspector.recipients.placeholder.custom': 'Saved as typed, e.g. role:admin', 'engine.inspector.recipients.add': 'Add recipient', 'engine.inspector.recipients.remove': 'Remove recipient', @@ -2201,7 +2204,7 @@ const STUDIO_EN: Record = { 'engine.studio.data.tab.advanced': 'Advanced', 'engine.studio.data.nameLabel': 'Object name', 'engine.studio.data.idLabel': 'Identifier', - 'engine.studio.auto.nameLabel': 'Flow name', + 'engine.studio.auto.nameLabel': 'Automation name', 'engine.studio.auto.idLabel': 'Identifier', 'engine.studio.access.nameLabel': 'Name', 'engine.studio.access.idLabel': 'Identifier', @@ -4515,8 +4518,7 @@ const STUDIO_EN: Record = { // qualified name (`{view}` below is the panel's title, the same string). // objectstack#30046 — the header's title names the object before it. 'engine.studio.inspector.listView.defaultView': 'Default view', - 'engine.studio.inspector.listView.notCreated': - 'There is no list view “{view}” yet. Your first change here creates it in this package\'s draft.', + 'engine.studio.inspector.listView.notCreated': 'Changes save as a draft first.', 'engine.studio.inspector.listView.readOnly': 'This package is read-only: the list view is shown here, not edited.', 'engine.studio.inspector.listView.notList': '“{view}” is not a list view, so it is not edited here.', 'engine.studio.inspector.listView.filter': 'Filter', diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index 27e70bf91ed..a65bb468619 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -620,14 +620,14 @@ const STUDIO_ZH: Record = { 'engine.inspector.flowNode.kv.value': '值', 'engine.inspector.flowNode.kv.remove': '删除条目', 'engine.inspector.flowNode.kv.empty': '暂无条目。', - 'engine.inspector.flowNode.kv.asExpression': '写成 CEL 表达式', - 'engine.inspector.flowNode.kv.expressionPlaceholder': 'CEL 表达式,例如 joinNonEmpty(…)', - 'engine.inspector.flowNode.kv.expressionNeeded': '这个值需要一个表达式。请填写表达式,或把这个值切回文本。', + 'engine.inspector.flowNode.kv.asExpression': '写成公式', + 'engine.inspector.flowNode.kv.expressionPlaceholder': '公式,例如 joinNonEmpty(…)', + 'engine.inspector.flowNode.kv.expressionNeeded': '这个值需要一个公式。请填写公式,或把这个值切回文本。', 'engine.inspector.flowNode.kv.undeclaredKey': '该动作没有声明这个输入,运行时会拒绝它。请删除它,或选择声明了它的动作。', // objectstack#27834 — the Update Records filter's "Triggering record" target. 'engine.inspector.flowNode.triggeringRecord.use': '更新触发记录', - 'engine.inspector.flowNode.triggeringRecord.hint': '目标为启动此流程的那条 {object} 记录。', - 'engine.inspector.flowNode.triggeringRecord.active': '更新启动此流程的那条 {object} 记录。', + 'engine.inspector.flowNode.triggeringRecord.hint': '目标为启动此流程的那条「{object}」记录。', + 'engine.inspector.flowNode.triggeringRecord.active': '更新启动此流程的那条「{object}」记录。', 'engine.inspector.flowNode.list.add': '添加项', 'engine.inspector.flowNode.list.item': '值', 'engine.inspector.flowNode.list.remove': '删除项', @@ -639,6 +639,9 @@ const STUDIO_ZH: Record = { 'engine.inspector.flowNode.help.learnMore': '了解更多', 'engine.inspector.flowNode.help.showLess': '收起', 'engine.inspector.flowNode.remove': '删除节点', + // objectstack#34796 — the node panel's header menu and its collapsed section for the node id. + 'engine.inspector.flowNode.moreActions': '更多操作', + 'engine.inspector.flowNode.developerInfo': '开发者信息', // App nav inspector 'engine.inspector.appNav.kind': '导航项', 'engine.inspector.appNav.close': '关闭导航项', @@ -1423,7 +1426,7 @@ const STUDIO_ZH: Record = { 'engine.inspector.reference.managerPlaceholder': '自动解析', 'engine.inspector.reference.managerHint': '运行时根据提交人的上级自动解析 —— 无需填写。', 'engine.inspector.reference.queueHint': '队列的机器名。步骤开启时队列的成员即为审批人;空队列不会添加任何人。', - 'engine.inspector.reference.fieldsOf': '{object} 的字段。', + 'engine.inspector.reference.fieldsOf': '「{object}」的字段。', 'engine.inspector.reference.setTriggerObject': '请先在开始节点上设置流程的触发对象,才能列出字段。', 'engine.inspector.reference.actionsOf': '{connector} 的动作。', 'engine.inspector.reference.chooseConnector': '请先在上方选择连接器,才能列出其动作。', @@ -1440,7 +1443,7 @@ const STUDIO_ZH: Record = { 'engine.inspector.recipients.placeholder.user': '选择用户', 'engine.inspector.recipients.placeholder.team': '选择团队', 'engine.inspector.recipients.placeholder.email': 'name@example.com', - 'engine.inspector.recipients.placeholder.expression': 'CEL 表达式,例如 ownerId', + 'engine.inspector.recipients.placeholder.expression': '公式,例如 ownerId', 'engine.inspector.recipients.placeholder.custom': '按原样保存,例如 role:admin', 'engine.inspector.recipients.add': '添加收件人', 'engine.inspector.recipients.remove': '移除收件人', @@ -1992,7 +1995,7 @@ const STUDIO_ZH: Record = { 'engine.studio.data.tab.advanced': '高级', 'engine.studio.data.nameLabel': '对象名称', 'engine.studio.data.idLabel': '标识', - 'engine.studio.auto.nameLabel': '流程名称', + 'engine.studio.auto.nameLabel': '自动化名称', 'engine.studio.auto.idLabel': '标识', 'engine.studio.access.nameLabel': '名称', 'engine.studio.access.idLabel': '标识', @@ -4056,7 +4059,7 @@ const STUDIO_ZH: Record = { 'engine.studio.inspector.listView.kind': '列表视图', 'engine.studio.inspector.listView.intro': '画布上的就是这个列表。它的列、筛选与排序保存到本包的草稿,并立即显示在画布上。', 'engine.studio.inspector.listView.defaultView': '默认视图', - 'engine.studio.inspector.listView.notCreated': '还没有列表视图「{view}」。在这里做的第一次修改会在本包的草稿中创建它。', + 'engine.studio.inspector.listView.notCreated': '改动先存为草稿。', 'engine.studio.inspector.listView.readOnly': '本包只读:这里展示列表视图,不能编辑。', 'engine.studio.inspector.listView.notList': '「{view}」不是列表视图,因此不在这里编辑。', 'engine.studio.inspector.listView.filter': '筛选',