diff --git a/.changeset/36292-record-field-set-placeholder.md b/.changeset/36292-record-field-set-placeholder.md new file mode 100644 index 00000000000..63c7382bef7 --- /dev/null +++ b/.changeset/36292-record-field-set-placeholder.md @@ -0,0 +1,17 @@ +--- +'@object-ui/plugin-detail': patch +'@object-ui/i18n': patch +--- + +feat(console): on the record page's field list an empty field you can edit reads 「设置{字段名}」 and one click fills it in; an editable value offers the copy icon too + +Clause-②: yes (widening) +Metadata-protocol: none + +The synthesized record page's field area (the side preview, the phone's 「详情」 tab, the wide page's pinned left column and a full page alone): + +- **Empty editable fields read 「设置」 plus their label.** An empty value the reader can edit is drawn as light text, 「设置」 plus the field's label (`Set Phone` in English), and a single click on it opens the field's editor, as a click on any editable value already does. A read-only field, a field the caller may not write and a record that is not inline-editable keep the shared 「—」 placeholder. Empty fields still fold into the list's one 「显示 N 个空字段」 row; shown, they read 「设置…」 instead of 「—」. +- **An editable value can be copied without editing.** Its copy icon is drawn on hover or keyboard focus at the value's right, as a read-only value's is; it copies the value and does not enter edit. A touch screen draws none, as before for read-only values. The keyboard's way into edit (the pencil, drawn on focus only) is unchanged. +- Authored record pages and every other DetailView keep their faces: an empty field there reads 「—」 and an editable row keeps its double-click and pencil. + +`@object-ui/i18n` widens: one new key in every pack, `detail.setField` (`Set {{field}}` / `设置{{field}}`). diff --git a/ui/packages/i18n/src/locales/ar.ts b/ui/packages/i18n/src/locales/ar.ts index dc76cd4007b..ca71eead002 100644 --- a/ui/packages/i18n/src/locales/ar.ts +++ b/ui/packages/i18n/src/locales/ar.ts @@ -1441,6 +1441,7 @@ const ar = { updatedTime: "تاريخ التعديل", recordNumber: "معرّف السجل", clickToEdit: "انقر للتحرير", + setField: "تعيين {{field}}", back: "رجوع", edit: "تحرير", editInline: "تحرير", diff --git a/ui/packages/i18n/src/locales/de.ts b/ui/packages/i18n/src/locales/de.ts index 27d853e2e38..22de6a2723b 100644 --- a/ui/packages/i18n/src/locales/de.ts +++ b/ui/packages/i18n/src/locales/de.ts @@ -1659,6 +1659,7 @@ const de = { updatedTime: "Geändert am", recordNumber: "Datensatz-ID", clickToEdit: "Zum Bearbeiten klicken", + setField: "{{field}} festlegen", // objectui#3863 — base key. de's categories are exactly `one`/`other`, so this // slot is unreachable here and equals `_other` for key-set parity. showEmptyRelated: "+ {{count}} leer", diff --git a/ui/packages/i18n/src/locales/en.ts b/ui/packages/i18n/src/locales/en.ts index 9f348e24a3f..00975779cc7 100644 --- a/ui/packages/i18n/src/locales/en.ts +++ b/ui/packages/i18n/src/locales/en.ts @@ -1906,6 +1906,7 @@ const en = { updatedTime: 'Updated on', recordNumber: 'Record ID', clickToEdit: 'Click to edit', + setField: 'Set {{field}}', // Attachments dropFilesToUpload: 'Drop files here or click to upload', attachmentCount: '{{count}} attachment', diff --git a/ui/packages/i18n/src/locales/es.ts b/ui/packages/i18n/src/locales/es.ts index 6be89640539..35f80ffdaaa 100644 --- a/ui/packages/i18n/src/locales/es.ts +++ b/ui/packages/i18n/src/locales/es.ts @@ -1713,6 +1713,7 @@ const es = { updatedTime: "Fecha de modificación", recordNumber: "ID del registro", clickToEdit: "Haga clic para editar", + setField: "Establecer {{field}}", // objectui#3863 — base key, answering only a call made without a count. es's // `many` (exact millions) has its own slot since objectui#11432; it repeats // `_other` here because the count governs no noun complement. diff --git a/ui/packages/i18n/src/locales/fr.ts b/ui/packages/i18n/src/locales/fr.ts index e3862337f4c..b2c8cbf7860 100644 --- a/ui/packages/i18n/src/locales/fr.ts +++ b/ui/packages/i18n/src/locales/fr.ts @@ -1336,6 +1336,7 @@ const fr = { updatedTime: "Modifié le", recordNumber: "ID de l’enregistrement", clickToEdit: "Cliquez pour modifier", + setField: "Définir {{field}}", back: "Retour", edit: "Modifier", editInline: "Modifier", diff --git a/ui/packages/i18n/src/locales/ja.ts b/ui/packages/i18n/src/locales/ja.ts index 96c3d9d2007..11e38f5bf62 100644 --- a/ui/packages/i18n/src/locales/ja.ts +++ b/ui/packages/i18n/src/locales/ja.ts @@ -1659,6 +1659,7 @@ const ja = { updatedTime: "更新日時", recordNumber: "レコード ID", clickToEdit: "クリックで編集", + setField: "{{field}}を設定", // objectui#3863 — base key. ja has a single plural category (`other`), so this // slot is unreachable here and equals `_other` for key-set parity. showEmptyRelated: "+ {{count}} 件(空)", diff --git a/ui/packages/i18n/src/locales/ko.ts b/ui/packages/i18n/src/locales/ko.ts index 7e5f05d5637..133c18b3a3c 100644 --- a/ui/packages/i18n/src/locales/ko.ts +++ b/ui/packages/i18n/src/locales/ko.ts @@ -1659,6 +1659,7 @@ const ko = { updatedTime: "수정 일시", recordNumber: "레코드 ID", clickToEdit: "클릭하여 편집", + setField: "{{field}} 설정", // objectui#3863 — base key. ko has a single plural category (`other`), so this // slot is unreachable here and equals `_other` for key-set parity. showEmptyRelated: "+ {{count}}개 비어 있음", diff --git a/ui/packages/i18n/src/locales/pt-BR.ts b/ui/packages/i18n/src/locales/pt-BR.ts index 1173e5948a5..bda737d521b 100644 --- a/ui/packages/i18n/src/locales/pt-BR.ts +++ b/ui/packages/i18n/src/locales/pt-BR.ts @@ -1336,6 +1336,7 @@ const pt = { updatedTime: "Atualizado em", recordNumber: "ID do registro", clickToEdit: "Clique para editar", + setField: "Definir {{field}}", back: "Voltar", edit: "Editar", editInline: "Editar", diff --git a/ui/packages/i18n/src/locales/ru.ts b/ui/packages/i18n/src/locales/ru.ts index e4001201ca1..2e9d884ec8a 100644 --- a/ui/packages/i18n/src/locales/ru.ts +++ b/ui/packages/i18n/src/locales/ru.ts @@ -1374,6 +1374,7 @@ const ru = { updatedTime: "Дата изменения", recordNumber: "ID записи", clickToEdit: "Нажмите, чтобы изменить", + setField: "Указать «{{field}}»", back: "Назад", edit: "Редактировать", editInline: "Редактировать", diff --git a/ui/packages/i18n/src/locales/zh-Hans.ts b/ui/packages/i18n/src/locales/zh-Hans.ts index e9ab3666270..5a69a50b77a 100644 --- a/ui/packages/i18n/src/locales/zh-Hans.ts +++ b/ui/packages/i18n/src/locales/zh-Hans.ts @@ -1606,6 +1606,7 @@ const zh = { updatedTime: '修改时间', recordNumber: '记录编号', clickToEdit: '点击编辑', + setField: '设置{{field}}', // Attachments dropFilesToUpload: '拖拽文件到此处或点击上传', attachmentCount: '{{count}} 个附件', diff --git a/ui/packages/i18n/src/locales/zh-Hant.ts b/ui/packages/i18n/src/locales/zh-Hant.ts index 322accfb993..b698dcd04ad 100644 --- a/ui/packages/i18n/src/locales/zh-Hant.ts +++ b/ui/packages/i18n/src/locales/zh-Hant.ts @@ -1606,6 +1606,7 @@ const zhHant = { updatedTime: '修改時間', recordNumber: '記錄編號', clickToEdit: '點選編輯', + setField: '設定{{field}}', // Attachments dropFilesToUpload: '拖拽檔案到此處或點選上傳', attachmentCount: '{{count}} 個附件', diff --git a/ui/packages/plugin-detail/src/DetailSection.tsx b/ui/packages/plugin-detail/src/DetailSection.tsx index ee0440d0672..932402dfeeb 100644 --- a/ui/packages/plugin-detail/src/DetailSection.tsx +++ b/ui/packages/plugin-detail/src/DetailSection.tsx @@ -628,9 +628,22 @@ export const DetailSection: React.FC = ({ const fieldEditable = !isReadonly && !isComputedField && !isSystemField && !isInlineExcluded && isWriteGranted; const canInlineEditField = fieldEditable && !!onEnterInlineEdit; + const fieldLabelText = fieldLabel(objectName || '', field.name, field.label || field.name); const displayValue = (() => { const isEmpty = !hasCellValue(value); + // On the record page's field face an empty value the reader can fill in + // reads "Set