diff --git a/.changeset/37792-object-pin-overview.md b/.changeset/37792-object-pin-overview.md new file mode 100644 index 00000000000..7cc7a9e7d89 --- /dev/null +++ b/.changeset/37792-object-pin-overview.md @@ -0,0 +1,16 @@ +--- +'@objectstack/spec': minor +'@object-ui/plugin-detail': minor +'@object-ui/app-shell': minor +'@objectstack/platform-objects': minor +'@objectstack/metadata-core': minor +--- + +feat: an object can keep its record page from pinning the overview, with `pinOverview: false` + +Clause-②: yes (widening) — `ObjectSchema` gains the optional boolean `pinOverview`; `RecordPageColumns` gains the optional `pinOverview` prop, and `recordPagePinsDetails` an optional fourth argument of the same name +Metadata-protocol: added + +On a wide desktop full record page the overview (the record's own fields) is pinned to a left column beside the other tabs. An object can now turn that off with `pinOverview: false`: the page keeps the overview as its first tab, open by default, and lays its fields out by width in up to three columns, as a page whose overview is its only tab does, at any width and also when the overview holds a related table. Leaving the key out, or writing `true`, keeps the page exactly as before. Only the desktop full standard record page reads it: the side preview and a phone never pin, so they look the same either way, and print pages and authored `kind: 'full' | 'html' | 'react'` pages do not read it. An object extension cannot write it (refused with a message naming `ObjectSchema.pinOverview`), and a non-boolean value is refused at parse. The object metadata form offers it as a switch; an untouched switch writes nothing. + +Nothing to migrate. diff --git a/content/docs/references/data/object.mdx b/content/docs/references/data/object.mdx index d3121fd2aa1..cad627f548c 100644 --- a/content/docs/references/data/object.mdx +++ b/content/docs/references/data/object.mdx @@ -178,6 +178,7 @@ const result = ApiMethod.parse(data); | **imageField** | `string` | optional | The record's picture: names the field the record page header (record chrome) draws beside the title — one object-level declaration every record detail page reads, not a per-page header prop. Must name a field of this object whose type is `image` or `avatar`; any other name is refused. A record whose field is empty shows no picture (no initials or placeholder). | | **highlightFields** | `string[]` | optional | [ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it. Renamed from compactLayout. | | **relatedLists** | `(string \| { list: string; label?: string; columns?: string[] })[]` | optional | The record page's tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension's place entry (an `{ list, after \| before }` entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be `{ list, label?, columns? }` to give that list its own title and child-field columns (wins over the child FK's relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child's relationships, as relatedListColumns is) is refused. | +| **pinOverview** | `boolean` | optional | Whether the desktop full standard record page pins the overview (the record's own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full \| html \| react pages do not read it. Not accepted on an object extension. | | **stageField** | `string \| false` | optional | [ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed. When the named field carries options, it must be a single-value `select` / `radio` with inline `options`, each declaring its `kind` ('open' / 'won' / 'lost'); a picklist-backed or multi-value stage field is refused. A name that resolves to no declared field, or a field with no options, is not judged at parse. | | **editMode** | `Enum<'modal' \| 'page'>` | optional | Edit-interaction intent for records of this object: 'modal' opens the edit form as a dialog over the current view; 'page' navigates to a dedicated full-page edit route. Absent = the renderer picks its own default (objectui defaults to modal). Cross-renderer intent, not pixel styling (family). | | **listViews** | `Record; type?: Enum<'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map' \| …>; data?: object \| object \| object; … }>` | optional | Built-in named list views (segmented tabs) shipped with the object schema — "views" mode, dropdown userFilters allowed, no page-only tabs (ADR-0047) | diff --git a/content/docs/ui/pages.mdx b/content/docs/ui/pages.mdx index 39a5436e4d4..cf4534baeee 100644 --- a/content/docs/ui/pages.mdx +++ b/content/docs/ui/pages.mdx @@ -297,6 +297,27 @@ whose details hold a related table, draws the details across the page. Narrower the drawer and a phone draw one column: the tab row, **Details** first, and the open tab under it. +An object that declares `pinOverview: false` keeps its desktop full page from pinning at any +width: the page draws the tab row with **Details** first and open by default, and lays the +fields out by the page's width in up to three columns, as a page whose details are its only tab +does, also when the details hold a related table. Leaving the key out, or writing `true`, keeps +the layout above. The drawer and a phone draw the same either way, and an object extension +cannot write the key. + +```ts +import { ObjectSchema, Field } from '@objectstack/spec/data'; + +export const Policy = ObjectSchema.create({ + name: 'policy', + label: 'Policy', + pinOverview: false, + fields: { + title: Field.text({ label: 'Title' }), + body: Field.markdown({ label: 'Body' }), + }, +}); +``` + The related lists load in steps, and the details never wait for them. The page asks every list's count in one request set, sent beside the record read, and draws each list's tab before those counts land; a list counted at 0 reads no rows, and its tab is muted, with no diff --git a/packages/metadata-core/src/object-schema-fls-references.ts b/packages/metadata-core/src/object-schema-fls-references.ts index fdfa8efdf43..bdc115e1eb3 100644 --- a/packages/metadata-core/src/object-schema-fls-references.ts +++ b/packages/metadata-core/src/object-schema-fls-references.ts @@ -822,6 +822,8 @@ export const OBJECT_REFERENCE_POSITIONS: Readonly> = { name: keep, label: keep, pluralLabel: keep, description: keep, icon: keep, color: keep, actionLayout: keep, isSystem: keep, managedBy: keep, ownership: keep, systemFields: keep, datasource: keep, access: keep, requiredPermissions: keep, fileAccessDelegate: keep, schemaReadDelegate: keep, editMode: keep, enable: keep, + // The record page layout switch (ADR-0085's Note of 2026-11-27): a boolean, no field name. + pinOverview: keep, sharingModel: keep, externalSharingModel: keep, protection: keep, // [#25760] The per-object sharing opt-ins (`sharing.controlledByParent.ownerMayEdit`, // ADR-0055 §3 amendment): a block of booleans that names no field. diff --git a/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts b/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts index 8eb62f9025d..4ee2d7ad23e 100644 --- a/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts +++ b/packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts @@ -416,9 +416,11 @@ describe('#17501 — /meta/types serves a real schema for `action`, and moves no // from (ADR-0160 D8), which gives its MCP prompt a record argument. // [#37402] `object` 52 → 53: `uiReadonlyWhen`, the whole-record hand lock // (no person edits a field of the record at the console; writes keep it). + // [#37792] `object` 53 → 54: `pinOverview`, the record page layout switch + // (ADR-0085's Note of 2026-11-27). const CARD_PROPERTY_COUNTS: Record = { agent: 24, app: 24, dashboard: 21, dataset: 17, field: 89, flow: 24, - hook: 24, object: 53, page: 28, position: 14, report: 24, skill: 18, tool: 14, + hook: 24, object: 54, page: 28, position: 14, report: 24, skill: 18, tool: 14, }; it.each(Object.entries(CARD_PROPERTY_COUNTS))( diff --git a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts index 3ee50bbe66f..122b54abb87 100644 --- a/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const arMetadataForms: NonNullable = { label: "علامات تبويب صفحة السجل", helpText: "علامات تبويب صفحة السجل بعد النظرة العامة، بالترتيب. كل إدخال اسم كائن فرعي (مثل task)، أو object.field عندما تكون لذلك الكائن الفرعي أكثر من علاقة بهذا الكائن، أو علامة تبويب مدمجة (sys_attachment وsys_approval_request وsys_activity)، أو إدخال بعنوانه وأعمدته الخاصة يُضبط في إعدادات الكائن في Studio. بمجرد إدراج أي شيء، لا تظهر علامة تبويب لقائمة مرتبطة لا يسمّيها أي إدخال، بما في ذلك قائمة تضيفها حزمة أخرى، إلى أن يسمّيها هذا الكائن؛ ولا تظهر المرفقات إلا عند إدراجها. فارغ: تظهر كل القوائم بالترتيب الافتراضي. يُرفض عند حفظ الكائن أي اسم لا يطابق علاقة تشير إلى هذا الكائن." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "الحقول القابلة للبحث", helpText: "أسماء الحقول التي يطابقها استعلام $search ‏(ADR-0061): القيمة الافتراضية لمنتقي السجلات والبحث السريع في القوائم والبحث العام؛ ويمكن لطريقة العرض تضييقها. عند عدم تعيينها، يستخدم البحث حقل الاسم/العنوان إضافة إلى الحقول النصية القصيرة. يجب أن يسمّي كل إدخال حقلًا مخزَّنًا من هذا الكائن — ويُرفض عند النشر الاسم المجهول أو حقل الصيغة الافتراضي." diff --git a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts index d1f3a002d10..7a38e8eb767 100644 --- a/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ar.source-hashes.generated.ts @@ -94,6 +94,8 @@ export const arGeneratedSourceHashes: Readonly> = { "metadataForms.knowledge_source.sections.records.label": "9e5814dbd123f1c1", "metadataForms.knowledge_source.sections.refresh.description": "79311cb3f9e55b89", "metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.permission.fields.fields.helpText": "887a0bae04a950e2", "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", diff --git a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts index 8175e7cdf3a..fa9fe31de92 100644 --- a/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const deMetadataForms: NonNullable = { label: "Tabs der Datensatzseite", helpText: "Die Tabs der Datensatzseite nach der Übersicht, in Reihenfolge. Jeder Eintrag ist der Name eines untergeordneten Objekts (z. B. task), object.field, wenn dieses Objekt mehr als eine Beziehung zu diesem Objekt hat, ein integrierter Tab (sys_attachment, sys_approval_request, sys_activity) oder ein Eintrag mit eigenem Titel und eigenen Spalten, festgelegt in den Objekteinstellungen von Studio. Sobald etwas aufgeführt ist, zeigt eine verknüpfte Liste, die kein Eintrag nennt, keinen Tab, auch eine Liste, die ein anderes Paket hinzufügt, bis dieses Objekt sie nennt; Anhänge erscheinen nur, wenn sie aufgeführt sind. Leer: Alle Listen erscheinen in der Standardreihenfolge. Ein Name, der keiner auf dieses Objekt zeigenden Beziehung entspricht, wird beim Speichern des Objekts abgelehnt." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "Durchsuchbare Felder", helpText: "Feldnamen, auf die die Abfrage $search passt (ADR-0061): der Standard für die Datensatzauswahl, die Schnellsuche der Liste und die globale Suche; eine Ansicht kann ihn einschränken. Nicht gesetzt, sucht die Suche im Namens-/Titelfeld und in kurzen Textfeldern. Jeder Eintrag muss ein gespeichertes Feld dieses Objekts benennen – ein unbekannter Name oder ein virtuelles Formelfeld wird bei der Veröffentlichung abgelehnt." diff --git a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts index 6f2fc9759e8..a8352bfc6d2 100644 --- a/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/de.source-hashes.generated.ts @@ -133,6 +133,8 @@ export const deGeneratedSourceHashes: Readonly> = { "metadataForms.object.fields.enable.feeds.label": "669c64671f632139", "metadataForms.object.fields.lifecycle.storage.shards.label": "739988affb36b2e0", "metadataForms.object.fields.name.label": "5274417ff1ccaf01", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.object.fields.userActions.import.label": "05c80d3a61ec3290", "metadataForms.page.fields.name.label": "5274417ff1ccaf01", "metadataForms.page.sections.layout.label": "7f508ea1bb2c3a6b", diff --git a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts index 1a122e0d54e..b857c9545f3 100644 --- a/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const enMetadataForms: NonNullable = { label: "Related Lists", helpText: "The record page tabs after the overview, in order. Each entry is a child object name (e.g. task), object.field when that child has more than one relationship to this object, a built-in tab (sys_attachment, sys_approval_request, sys_activity), or an entry with its own title and columns, set in App Studio's object settings. Once anything is listed, a related list no entry names shows no tab, a list another package adds included, until this object names it; attachments show only when listed. Empty: every list shows in the default order. A name that matches no relationship pointing at this object is refused when the object is saved." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "Searchable Fields", helpText: "Field names the $search query matches (ADR-0061): the default for the record picker, list quick-search and global search; a view may narrow it. Unset, search uses the name/title field plus short-text fields. Each entry must name a stored field of this object — an unknown name or a virtual formula field is refused at publish." diff --git a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts index 8ce8b42c465..9bea909628d 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const esESMetadataForms: NonNullable = label: "Pestañas de la página de registro", helpText: "Las pestañas de la página de registro después del resumen, en orden. Cada entrada es el nombre de un objeto hijo (p. ej., task), object.field cuando ese hijo tiene más de una relación con este objeto, una pestaña integrada (sys_attachment, sys_approval_request, sys_activity) o una entrada con su propio título y columnas, definida en la configuración del objeto en Studio. En cuanto se enumera algo, una lista relacionada que ninguna entrada nombra no muestra pestaña, incluida una lista que añade otro paquete, hasta que este objeto la nombre; los adjuntos solo se muestran si se enumeran. Vacío: todas las listas se muestran en el orden predeterminado. Un nombre que no coincide con ninguna relación que apunte a este objeto se rechaza al guardar el objeto." }, + pinOverview: { + label: "Fijar resumen", + helpText: "Si la página de registro de escritorio ancha fija el resumen (los campos propios del registro) en una columna izquierda junto a las demás pestañas. Sin definir: se fija como antes siempre que la página sea lo bastante ancha y tenga otras pestañas; un interruptor sin tocar no escribe nada, por lo que aparece desactivado mientras la página sigue fijada. Desactivado una vez definido: la página completa de escritorio nunca se fija, en ningún ancho, y el resumen es su primera pestaña, abierta por defecto, con los campos dispuestos según el ancho en hasta tres columnas, también cuando el resumen contiene una tabla relacionada. La vista previa lateral y un teléfono se ven igual en ambos casos." + }, searchableFields: { label: "Campos buscables", helpText: "Nombres de campo con los que coincide la consulta $search (ADR-0061): el valor predeterminado del selector de registros, la búsqueda rápida de listas y la búsqueda global; una vista puede acotarlo. Sin definir, la búsqueda usa el campo de nombre/título más los campos de texto corto. Cada entrada debe nombrar un campo almacenado de este objeto: un nombre desconocido o un campo formula virtual se rechaza al publicar." diff --git a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts index 7029b01f849..d5b376fbe0b 100644 --- a/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const frMetadataForms: NonNullable = { label: "Onglets de la page d’enregistrement", helpText: "Les onglets de la page d’enregistrement après la vue d’ensemble, dans l’ordre. Chaque entrée est un nom d’objet enfant (par ex. task), object.field lorsque cet enfant a plus d’une relation avec cet objet, un onglet intégré (sys_attachment, sys_approval_request, sys_activity) ou une entrée avec son propre titre et ses propres colonnes, définie dans les paramètres de l’objet de Studio. Dès qu’un élément est listé, une liste associée qu’aucune entrée ne nomme n’affiche aucun onglet, y compris une liste ajoutée par un autre paquet, jusqu’à ce que cet objet la nomme ; les pièces jointes ne s’affichent que si elles sont listées. Vide : toutes les listes s’affichent dans l’ordre par défaut. Un nom qui ne correspond à aucune relation pointant vers cet objet est refusé à l’enregistrement de l’objet." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "Champs de recherche", helpText: "Noms des champs auxquels correspond la requête $search (ADR-0061) : la valeur par défaut pour le sélecteur d’enregistrements, la recherche rapide dans les listes et la recherche globale ; une vue peut la restreindre. Si elle n’est pas définie, la recherche utilise le champ de nom/titre ainsi que les champs de texte court. Chaque entrée doit désigner un champ stocké de cet objet — un nom inconnu ou un champ de formule virtuel est refusé à la publication." diff --git a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts index 406686dccbf..df969fde695 100644 --- a/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/fr.source-hashes.generated.ts @@ -161,6 +161,8 @@ export const frGeneratedSourceHashes: Readonly> = { "metadataForms.object.fields.fields.type.label": "901bb552898b2cab", "metadataForms.object.fields.fields.unique.label": "1d37471d3205fbc8", "metadataForms.object.fields.lifecycle.archive.label": "dc721777496e2512", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.object.fields.userActions.import.label": "05c80d3a61ec3290", "metadataForms.object.fields.validations.label": "06fc6dd288348779", "metadataForms.page.fields.aria.label": "d98a61c7b79cbd75", diff --git a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts index a46a739cf0b..fd74ec8dbac 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const jaJPMetadataForms: NonNullable = label: "レコードページのタブ", helpText: "概要の後に表示するレコードページのタブを順番に並べます。各項目は子オブジェクト名(例: task)、その子オブジェクトがこのオブジェクトと複数の関係を持つ場合は object.field、組み込みタブ(sys_attachment、sys_approval_request、sys_activity)、または Studio のオブジェクト設定で独自のタイトルと列を設定した項目です。何か一つでも列挙すると、どの項目にも挙がっていない関連リストにはタブが表示されません(他のパッケージが追加したリストも同様)。このオブジェクトがそれを列挙するまで表示されません。添付ファイルは列挙した場合にのみ表示されます。空の場合は、すべてのリストが既定の順序で表示されます。このオブジェクトを指す関係に一致しない名前は、オブジェクトの保存時に拒否されます。" }, + pinOverview: { + label: "概要を固定", + helpText: "デスクトップの広いレコードページで、概要(レコード自身の項目)を左の列に固定し、他のタブをその横に並べるかどうか。未設定:ページが十分に広く他のタブがあれば、これまでどおり固定されます。触れていないスイッチは何も書き込まないため、オフと表示されていてもページは固定されたままです。一度オフに設定すると:デスクトップの全画面ページはどの幅でも固定されず、概要が最初のタブとして既定で開き、項目は幅に合わせて最大 3 列で並びます。概要に関連テーブルがある場合も同じです。サイドプレビューとスマートフォンはどちらでも同じ表示です。" + }, searchableFields: { label: "検索対象項目", helpText: "$search クエリが照合する項目名(ADR-0061)。レコードピッカー、一覧のクイック検索、グローバル検索の既定値で、ビューで絞り込めます。未設定の場合は名前/タイトル項目と短いテキスト項目で検索します。各項目はこのオブジェクトの保存済みの項目を指す必要があり、不明な名前や仮想の formula 項目は公開時に拒否されます。" diff --git a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts index be1a817a7ac..2b5de15d92f 100644 --- a/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const koMetadataForms: NonNullable = { label: "레코드 페이지 탭", helpText: "개요 뒤에 표시되는 레코드 페이지 탭을 순서대로 나열합니다. 각 항목은 하위 객체 이름(예: task), 그 하위 객체가 이 객체와 관계가 둘 이상이면 object.field, 기본 제공 탭(sys_attachment, sys_approval_request, sys_activity), 또는 Studio의 객체 설정에서 자체 제목과 열을 지정한 항목입니다. 하나라도 나열하면 어떤 항목에도 없는 관련 목록은 탭이 표시되지 않으며(다른 패키지가 추가한 목록 포함), 이 객체가 그것을 나열할 때까지 표시되지 않습니다. 첨부 파일은 나열된 경우에만 표시됩니다. 비어 있으면 모든 목록이 기본 순서로 표시됩니다. 이 객체를 가리키는 관계와 일치하지 않는 이름은 객체를 저장할 때 거부됩니다." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "검색 가능 필드", helpText: "$search 쿼리가 일치시키는 필드 이름입니다(ADR-0061). 레코드 선택기, 목록 빠른 검색, 전역 검색의 기본값이며 뷰에서 좁힐 수 있습니다. 설정하지 않으면 이름/제목 필드와 짧은 텍스트 필드로 검색합니다. 각 항목은 이 객체의 저장된 필드를 지정해야 하며, 알 수 없는 이름이나 가상 수식 필드는 게시할 때 거부됩니다." diff --git a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts index 9d818854b76..0d0b6127998 100644 --- a/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ko.source-hashes.generated.ts @@ -94,6 +94,8 @@ export const koGeneratedSourceHashes: Readonly> = { "metadataForms.knowledge_source.sections.records.label": "9e5814dbd123f1c1", "metadataForms.knowledge_source.sections.refresh.description": "79311cb3f9e55b89", "metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.permission.fields.fields.helpText": "887a0bae04a950e2", "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", diff --git a/packages/platform-objects/src/apps/translations/object-collapsed-sections-echo-decisions.test.ts b/packages/platform-objects/src/apps/translations/object-collapsed-sections-echo-decisions.test.ts index 234b7bd2f8e..3f975ab1011 100644 --- a/packages/platform-objects/src/apps/translations/object-collapsed-sections-echo-decisions.test.ts +++ b/packages/platform-objects/src/apps/translations/object-collapsed-sections-echo-decisions.test.ts @@ -1015,7 +1015,10 @@ describe('#19403 round 8 — the population, DERIVED from the form and a shape', // 132 since #35315 gave the `fields` repeater its `transferBehavior` // sub-row (the Change Owner cascade) — label and help text, authored in // every translated locale, so `openEchoes` stays at zero. - expect(OPEN_LEAVES.length).toBe(132); + // 134 since #37792 gave `basics` the `pinOverview` row (the record page + // layout switch) — label and help text, authored in every translated + // locale, so `openEchoes` stays at zero. + expect(OPEN_LEAVES.length).toBe(134); expect(PANEL_LEAVES.some((l) => l.path === 'fields.placeholder')).toBe(false); expect(OPEN_LEAVES.some((l) => l.path === 'fields.placeholder')).toBe(true); for (const path of ['name', 'label', 'fields', 'fields.valueDomain', 'fields.deleteBehavior', 'fields.expression']) { diff --git a/packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts b/packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts index 8b57fd2cc53..9058db36f9c 100644 --- a/packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts +++ b/packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts @@ -1359,7 +1359,9 @@ describe('#19403 round 10 — the verdicts, on the live bundles', () => { // unit) — one row label, authored in all three locales. // 868: its `affinity` row (the order for the asker) — one row label, // authored in all three locales. - expect(translated.length, `${locale} positive control`).toBe(868); + // 869 since #37792: the object form's `pinOverview` row (the record + // page layout switch) — one row label, authored in all three locales. + expect(translated.length, `${locale} positive control`).toBe(869); } // ⭐ DARK — the blindness, executable. On a synthetic two-locale catalog the // all-three predicate returns 0 while the per-locale one returns 1, so the diff --git a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts index e0d43f2ebd4..f359904d89f 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const ptBRMetadataForms: NonNullable = label: "Abas da página do registro", helpText: "As abas da página do registro depois da visão geral, em ordem. Cada entrada é o nome de um objeto filho (por exemplo task), object.field quando esse filho tem mais de uma relação com este objeto, uma aba integrada (sys_attachment, sys_approval_request, sys_activity) ou uma entrada com título e colunas próprios, definida nas configurações do objeto no Studio. Assim que algo é listado, uma lista relacionada que nenhuma entrada nomeia não mostra aba, inclusive uma lista que outro pacote adiciona, até que este objeto a nomeie; os anexos só aparecem quando listados. Vazio: todas as listas aparecem na ordem padrão. Um nome que não corresponde a nenhuma relação que aponte para este objeto é recusado ao salvar o objeto." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "Campos pesquisáveis", helpText: "Nomes de campos que a consulta $search compara (ADR-0061): o padrão para o seletor de registros, a busca rápida da lista e a busca global; uma visualização pode restringi-lo. Quando não definido, a busca usa o campo de nome/título mais os campos de texto curto. Cada entrada deve nomear um campo armazenado deste objeto — um nome desconhecido ou um campo de fórmula virtual é recusado na publicação." diff --git a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts index 8e80cc43845..07f4c5fd1bf 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.generated.ts @@ -108,6 +108,8 @@ export const ptBRGeneratedSourceHashes: Readonly> = { "metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6", "metadataForms.object.fields.enable.feeds.label": "669c64671f632139", "metadataForms.object.fields.lifecycle.storage.shards.label": "739988affb36b2e0", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.page.sections.layout.label": "7f508ea1bb2c3a6b", "metadataForms.permission.fields.fields.helpText": "887a0bae04a950e2", "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", diff --git a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts index c6eed74bf64..88ff3a6b1bf 100644 --- a/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const ruMetadataForms: NonNullable = { label: "Вкладки страницы записи", helpText: "Вкладки страницы записи после обзора, по порядку. Каждый элемент — имя дочернего объекта (например, task), object.field, если у этого дочернего объекта больше одной связи с этим объектом, встроенная вкладка (sys_attachment, sys_approval_request, sys_activity) или элемент с собственным заголовком и столбцами, заданными в настройках объекта в Studio. Как только что-либо перечислено, связанный список, который не назван ни одним элементом, не показывает вкладку — в том числе список, добавленный другим пакетом, — пока этот объект его не назовёт; вложения показываются, только если они перечислены. Пусто: все списки показываются в порядке по умолчанию. Имя, не соответствующее ни одной связи, указывающей на этот объект, отклоняется при сохранении объекта." }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "Поля поиска", helpText: "Имена полей, по которым ищет запрос $search (ADR-0061): значение по умолчанию для выбора записей, быстрого поиска в списке и глобального поиска; представление может его сузить. Если не задано, поиск использует поле названия/заголовка и короткие текстовые поля. Каждая запись должна указывать хранимое поле этого объекта — неизвестное имя или виртуальное поле формулы отклоняется при публикации." diff --git a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts index aaabf6a75fd..60941b9f3a0 100644 --- a/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/ru.source-hashes.generated.ts @@ -94,6 +94,8 @@ export const ruGeneratedSourceHashes: Readonly> = { "metadataForms.knowledge_source.sections.records.label": "9e5814dbd123f1c1", "metadataForms.knowledge_source.sections.refresh.description": "79311cb3f9e55b89", "metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.permission.fields.fields.helpText": "887a0bae04a950e2", "metadataForms.permission.fields.objects.helpText": "e2512cfb3b501aae", "metadataForms.permission.fields.tabPermissions.helpText": "8942e2aebe59897c", diff --git a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts index 3923e718042..83afaf885ea 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const zhCNMetadataForms: NonNullable = label: "记录页页签", helpText: "记录页在概览之后显示的页签,按顺序排列。每一项是子对象名称(例如 task);当该子对象与本对象有多个关系时写 object.field;也可以是内置页签(sys_attachment、sys_approval_request、sys_activity),或带自己标题和列的一项(在应用搭建的对象设置里设置)。一旦列出任何一项,没有列出的相关列表就不显示页签(其他包添加的列表也一样),直到本对象列出它;附件只有列出时才显示。为空时,所有列表按默认顺序显示。不对应任何指向本对象的关系的名称,在保存对象时会被拒绝。" }, + pinOverview: { + label: "固定概览", + helpText: "桌面宽屏记录页是否把概览(记录自己的字段)固定在左栏、其他页签排在旁边。未设置:只要页面够宽且有其他页签,就照旧固定;没动过的开关不写任何值,所以它显示为关闭,页面却仍然固定。设置为关闭后:桌面整页在任何宽度下都不再固定,概览是第一个页签并默认打开,字段按页面宽度最多排三列,概览里有子表时也一样。侧边预览和手机无论设不设都一样。" + }, searchableFields: { label: "可搜索字段", helpText: "$search 查询匹配的字段名(ADR-0061):记录选择器、列表快速搜索和全局搜索的默认范围,视图可以再收窄。未设置时,搜索使用名称/标题字段加上短文本字段。每一项都必须是本对象已存储的字段——未知的名称或虚拟的 formula 字段会在发布时被拒绝。" diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts index 6bb3564911b..cd7cc6e30cf 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.metadata-forms.generated.ts @@ -80,6 +80,10 @@ export const zhHantMetadataForms: NonNullable label: "記錄頁頁籤", helpText: "記錄頁在概覽之後顯示的頁籤,依順序排列。每一項是子物件名稱(例如 task);當該子物件與本物件有多個關係時寫 object.field;也可以是內建頁籤(sys_attachment、sys_approval_request、sys_activity),或帶自己標題和欄位的一項(在應用搭建的物件設定裡設定)。一旦列出任何一項,未列出的相關清單就不顯示頁籤(其他套件新增的清單也一樣),直到本物件列出它;附件只有列出時才顯示。為空時,所有清單依預設順序顯示。不對應任何指向本物件之關係的名稱,在儲存物件時會被拒絕。" }, + pinOverview: { + label: "Pin Overview", + helpText: "Whether the wide desktop record page pins the overview (the record's own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way." + }, searchableFields: { label: "可搜尋欄位", helpText: "$search 查詢比對的欄位名(ADR-0061):記錄選擇器、清單快速搜尋和全域搜尋的預設範圍,檢視可以再收窄。未設定時,搜尋使用名稱/標題欄位加上短文字欄位。每一項都必須是本物件已儲存的欄位——未知的名稱或虛擬的 formula 欄位會在發布時被拒絕。" diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts index 464e92ba410..b7814b163f8 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.generated.ts @@ -92,6 +92,8 @@ export const zhHantGeneratedSourceHashes: Readonly> = { "metadataForms.knowledge_source.sections.records.label": "9e5814dbd123f1c1", "metadataForms.knowledge_source.sections.refresh.description": "79311cb3f9e55b89", "metadataForms.knowledge_source.sections.refresh.label": "1b63ae2e002930a6", + "metadataForms.object.fields.pinOverview.helpText": "768f0157c04d4ee2", + "metadataForms.object.fields.pinOverview.label": "901b14e51cd49243", "metadataForms.report.fields.dateRange.allowCustomRange.helpText": "eb95a6b1536e22fd", "metadataForms.report.fields.dateRange.allowCustomRange.label": "a1fb0e1cf5fe5d8e", "metadataForms.report.fields.dateRange.defaultRange.helpText": "03ccdb24491c9b5f", diff --git a/packages/spec/authorable-surface/data.json b/packages/spec/authorable-surface/data.json index 07c0cb93ecb..14a97189fb6 100644 --- a/packages/spec/authorable-surface/data.json +++ b/packages/spec/authorable-surface/data.json @@ -709,6 +709,7 @@ "data/Object:name", "data/Object:nameField", "data/Object:ownership", + "data/Object:pinOverview", "data/Object:pluralLabel", "data/Object:protection", "data/Object:publicSharing", diff --git a/packages/spec/docs/references/api/metadata.md b/packages/spec/docs/references/api/metadata.md index 56b8224d1d0..30f42a3874b 100644 --- a/packages/spec/docs/references/api/metadata.md +++ b/packages/spec/docs/references/api/metadata.md @@ -963,6 +963,7 @@ Metadata query with filtering, sorting, and pagination | **imageField** | `string` | optional | The record's picture: names the field the record page header (record chrome) draws beside the title — one object-level declaration every record detail page reads, not a per-page header prop. Must name a field of this object whose type is `image` or `avatar`; any other name is refused. A record whose field is empty shows no picture (no initials or placeholder). | | **highlightFields** | `string[]` | optional | [ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it. Renamed from compactLayout. | | **relatedLists** | `(string \| { list: string; label?: string; columns?: string[] })[]` | optional | The record page's tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension's place entry (an `{ list, after \| before }` entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be `{ list, label?, columns? }` to give that list its own title and child-field columns (wins over the child FK's relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child's relationships, as relatedListColumns is) is refused. | +| **pinOverview** | `boolean` | optional | Whether the desktop full standard record page pins the overview (the record's own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full \| html \| react pages do not read it. Not accepted on an object extension. | | **stageField** | `string \| false` | optional | [ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed. When the named field carries options, it must be a single-value `select` / `radio` with inline `options`, each declaring its `kind` ('open' / 'won' / 'lost'); a picklist-backed or multi-value stage field is refused. A name that resolves to no declared field, or a field with no options, is not judged at parse. | | **editMode** | `Enum<'modal' \| 'page'>` | optional | Edit-interaction intent for records of this object: 'modal' opens the edit form as a dialog over the current view; 'page' navigates to a dedicated full-page edit route. Absent = the renderer picks its own default (objectui defaults to modal). Cross-renderer intent, not pixel styling (family). | | **listViews** | `Record; type?: Enum<'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map' \| …>; data?: object \| object \| object; … }>` | optional | Built-in named list views (segmented tabs) shipped with the object schema — "views" mode, dropdown userFilters allowed, no page-only tabs (ADR-0047) | diff --git a/packages/spec/docs/references/system/migration.md b/packages/spec/docs/references/system/migration.md index 1a2259cec20..58a15330816 100644 --- a/packages/spec/docs/references/system/migration.md +++ b/packages/spec/docs/references/system/migration.md @@ -362,6 +362,7 @@ Create a new object | **imageField** | `string` | optional | The record's picture: names the field the record page header (record chrome) draws beside the title — one object-level declaration every record detail page reads, not a per-page header prop. Must name a field of this object whose type is `image` or `avatar`; any other name is refused. A record whose field is empty shows no picture (no initials or placeholder). | | **highlightFields** | `string[]` | optional | [ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it. Renamed from compactLayout. | | **relatedLists** | `(string \| { list: string; label?: string; columns?: string[] })[]` | optional | The record page's tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension's place entry (an `{ list, after \| before }` entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be `{ list, label?, columns? }` to give that list its own title and child-field columns (wins over the child FK's relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child's relationships, as relatedListColumns is) is refused. | +| **pinOverview** | `boolean` | optional | Whether the desktop full standard record page pins the overview (the record's own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full \| html \| react pages do not read it. Not accepted on an object extension. | | **stageField** | `string \| false` | optional | [ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed. When the named field carries options, it must be a single-value `select` / `radio` with inline `options`, each declaring its `kind` ('open' / 'won' / 'lost'); a picklist-backed or multi-value stage field is refused. A name that resolves to no declared field, or a field with no options, is not judged at parse. | | **editMode** | `Enum<'modal' \| 'page'>` | optional | Edit-interaction intent for records of this object: 'modal' opens the edit form as a dialog over the current view; 'page' navigates to a dedicated full-page edit route. Absent = the renderer picks its own default (objectui defaults to modal). Cross-renderer intent, not pixel styling (family). | | **listViews** | `Record; type?: Enum<'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map' \| …>; data?: object \| object \| object; … }>` | optional | Built-in named list views (segmented tabs) shipped with the object schema — "views" mode, dropdown userFilters allowed, no page-only tabs (ADR-0047) | diff --git a/packages/spec/docs/references/system/migration.part-2.md b/packages/spec/docs/references/system/migration.part-2.md index 7f0d63e9959..6c50582c8d1 100644 --- a/packages/spec/docs/references/system/migration.part-2.md +++ b/packages/spec/docs/references/system/migration.part-2.md @@ -206,6 +206,7 @@ Create a new object | **imageField** | `string` | optional | The record's picture: names the field the record page header (record chrome) draws beside the title — one object-level declaration every record detail page reads, not a per-page header prop. Must name a field of this object whose type is `image` or `avatar`; any other name is refused. A record whose field is empty shows no picture (no initials or placeholder). | | **highlightFields** | `string[]` | optional | [ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default list and related-list columns, cards, hover cards, previews and the record picker; the default record page draws no strip from it. Renamed from compactLayout. | | **relatedLists** | `(string \| { list: string; label?: string; columns?: string[] })[]` | optional | The record page's tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension's place entry (an `{ list, after \| before }` entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be `{ list, label?, columns? }` to give that list its own title and child-field columns (wins over the child FK's relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child's relationships, as relatedListColumns is) is refused. | +| **pinOverview** | `boolean` | optional | Whether the desktop full standard record page pins the overview (the record's own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full \| html \| react pages do not read it. Not accepted on an object extension. | | **stageField** | `string \| false` | optional | [ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed. When the named field carries options, it must be a single-value `select` / `radio` with inline `options`, each declaring its `kind` ('open' / 'won' / 'lost'); a picklist-backed or multi-value stage field is refused. A name that resolves to no declared field, or a field with no options, is not judged at parse. | | **editMode** | `Enum<'modal' \| 'page'>` | optional | Edit-interaction intent for records of this object: 'modal' opens the edit form as a dialog over the current view; 'page' navigates to a dedicated full-page edit route. Absent = the renderer picks its own default (objectui defaults to modal). Cross-renderer intent, not pixel styling (family). | | **listViews** | `Record; type?: Enum<'grid' \| 'kanban' \| 'gallery' \| 'calendar' \| 'timeline' \| 'gantt' \| 'map' \| …>; data?: object \| object \| object; … }>` | optional | Built-in named list views (segmented tabs) shipped with the object schema — "views" mode, dropdown userFilters allowed, no page-only tabs (ADR-0047) | diff --git a/packages/spec/liveness/object.json b/packages/spec/liveness/object.json index efe379ab252..1d6e871a1b7 100644 --- a/packages/spec/liveness/object.json +++ b/packages/spec/liveness/object.json @@ -139,6 +139,14 @@ } } }, + "pinOverview": { + "status": "live", + "verifiedAt": "2026-11-30", + "evidenceScope": "in-repo", + "evidence": "ui/packages/plugin-detail/src/synth/recordPageColumns.ts#recordPagePinsDetails (the pin decision: `false` never pins; absent or `true` leaves it derived from the page's width, its other tabs and the body tables among its fields); ui/packages/plugin-detail/src/RecordPageColumns.tsx#RecordPageColumns (`false` on a full page: never pinned, the overview its first tab, open by default, its fields laid out by width up to three columns, a page whose overview holds a related table and a narrow page included; a drawer and a pane draw the same either way)", + "producer": "ui/packages/app-shell/src/views/RecordDetailView.tsx#RecordDetailView (threads the served object's `pinOverview` into `RecordPageColumns` on the desktop full record page; not on a phone)", + "note": "ADR-0085 Note of 2026-11-27: a ruled exception (an object key that only re-arranges the synthesized record page). Not an object-extension key and not in CUSTOM_ARRANGEMENT_KEYS." + }, "stageField": { "status": "live", "proof": "packages/qa/dogfood/test/semantic-roles.dogfood.test.ts#semantic-roles-served", diff --git a/packages/spec/liveness/state-counts/object.md b/packages/spec/liveness/state-counts/object.md index a51975c0ba9..e433accdd00 100644 --- a/packages/spec/liveness/state-counts/object.md +++ b/packages/spec/liveness/state-counts/object.md @@ -12,4 +12,4 @@ committed anywhere: `check:liveness` sums the shards when it reads them. | Type | live | exp | elsewhere | dead | planned | classified | |---|---|---|---|---|---|---| -| `object` | 95 | 0 | 0 | 1 | 1 | 97 | +| `object` | 96 | 0 | 0 | 1 | 1 | 98 | diff --git a/packages/spec/src/data/object.metadata-form.ts b/packages/spec/src/data/object.metadata-form.ts index dcc3a9f2ad7..6f9d643ef6c 100644 --- a/packages/spec/src/data/object.metadata-form.ts +++ b/packages/spec/src/data/object.metadata-form.ts @@ -81,6 +81,10 @@ export const objectForm = defineMetadataForm({ // is refused at the publish door (`related-list-ref-unknown`, `error`, // judged against the registry's children) and by `os validate` / `os build`. { field: 'relatedLists', widget: 'related-list-entries', colSpan: 2, helpText: 'The record page tabs after the overview, in order. Each entry is a child object name (e.g. task), object.field when that child has more than one relationship to this object, a built-in tab (sys_attachment, sys_approval_request, sys_activity), or an entry with its own title and columns, set in App Studio\'s object settings. Once anything is listed, a related list no entry names shows no tab, a list another package adds included, until this object names it; attachments show only when listed. Empty: every list shows in the default order. A name that matches no relationship pointing at this object is refused when the object is saved.' }, + // ADR-0085 (Note of 2026-11-27) — the record page layout switch beside + // the tab list it lays out. A boolean row: an untouched switch writes + // nothing, so an object keeps the derived pin until an author sets it. + { field: 'pinOverview', type: 'boolean', colSpan: 1, helpText: 'Whether the wide desktop record page pins the overview (the record\'s own fields) to a left column beside the other tabs. Unset: it pins as before wherever the page is wide enough and has other tabs; an untouched switch writes nothing, so it reads off while the page still pins. Off once set: the desktop full page never pins, at any width, and the overview is its first tab, open by default, its fields laid out by width in up to three columns, also when the overview holds a related table. The side preview and a phone draw the same either way.' }, { field: 'searchableFields', widget: 'string-tags', colSpan: 2, helpText: 'Field names the $search query matches (ADR-0061): the default for the record picker, list quick-search and global search; a view may narrow it. Unset, search uses the name/title field plus short-text fields. Each entry must name a stored field of this object — an unknown name or a virtual formula field is refused at publish.' }, // #19332 (flight G2a of ruling record 5861442317) — the object's field // groups, the ADR-0085 layout role beside `nameField` / `highlightFields`. diff --git a/packages/spec/src/data/object.test.ts b/packages/spec/src/data/object.test.ts index e08aa8ecd93..febbfe99305 100644 --- a/packages/spec/src/data/object.test.ts +++ b/packages/spec/src/data/object.test.ts @@ -6,7 +6,7 @@ import { describe, it, expect, vi, afterEach } from 'vitest'; // `activities`, … and the annotation stops being a contract check at all. This // only became visible when tsconfig.test.json put these files in front of tsc // (#5286). -import { ObjectSchema, ObjectCapabilities, IndexSchema, ObjectFieldGroupSchema, ObjectExternalBindingSchema, ObjectAccessConfigSchema, LifecycleSchema, TenancyConfigSchema, isTenancyDisabled, isPublicSharingEnabled, resolveCrudAffordances, type ServiceObject } from './object.zod'; +import { ObjectSchema, ObjectExtensionSchema, ObjectCapabilities, IndexSchema, ObjectFieldGroupSchema, ObjectExternalBindingSchema, ObjectAccessConfigSchema, LifecycleSchema, TenancyConfigSchema, isTenancyDisabled, isPublicSharingEnabled, resolveCrudAffordances, type ServiceObject } from './object.zod'; import { resolveInjectedSystemColumns } from './injected-system-columns'; import { RETIRED_KEY_UPGRADE_GUIDE_SENTENCE } from '../shared/protocol-upgrade-guide'; import { projectPublishedJsonSchema } from '../../scripts/lib/refinement-projection'; @@ -2006,6 +2006,42 @@ describe('ObjectSchema editMode (declared by maintainer ruling: the renderer rea }); }); +/** + * [ADR-0085, Note of 2026-11-27, a ruled exception] `pinOverview`: whether + * the desktop full standard record page pins the overview to a left column. + * The page's reading is pinned in `@object-ui/plugin-detail` + * (`RecordPageColumns.test.tsx`); here, the contract an author writes. + */ +describe('ObjectSchema.pinOverview — the record page layout switch', () => { + it('parses absent, true and false end to end, and carries the value', () => { + expect(ObjectSchema.parse({ name: 'policy', fields: {} }).pinOverview).toBeUndefined(); + expect(ObjectSchema.parse({ name: 'policy', fields: {}, pinOverview: true }).pinOverview).toBe(true); + expect(ObjectSchema.parse({ name: 'policy', fields: {}, pinOverview: false }).pinOverview).toBe(false); + expect(ObjectSchema.create({ name: 'policy', fields: {}, pinOverview: false }).pinOverview).toBe(false); + }); + + it('refuses a value that is not a boolean, as a value error at pinOverview — never unrecognized_keys', () => { + for (const bad of ['false', 0, 1, null, { wide: false }] as const) { + const result = ObjectSchema.safeParse({ name: 'policy', fields: {}, pinOverview: bad }); + expect(result.success).toBe(false); + if (!result.success) { + expect(result.error.issues[0].code).toBe('invalid_type'); + expect(result.error.issues[0].path).toEqual(['pinOverview']); + } + } + }); + + it('an object extension refuses it, naming the object key instead', () => { + const result = ObjectExtensionSchema.safeParse({ extend: 'crm_account', pinOverview: false }); + expect(result.success).toBe(false); + if (!result.success) { + const issue = result.error.issues.find((i) => i.code === 'unrecognized_keys'); + expect(issue).toBeDefined(); + expect(issue!.message).toContain('ObjectSchema.pinOverview'); + } + }); +}); + describe('ObjectSchema.fieldGroups', () => { it('should accept an object without fieldGroups (fully optional)', () => { const result = ObjectSchema.safeParse({ diff --git a/packages/spec/src/data/object.zod.ts b/packages/spec/src/data/object.zod.ts index 2b2ab939660..e52fb504e37 100644 --- a/packages/spec/src/data/object.zod.ts +++ b/packages/spec/src/data/object.zod.ts @@ -4929,6 +4929,27 @@ const ObjectSchemaBase = strictObject( * synthesized page's tab list (`buildDefaultTabs`). */ relatedLists: z.array(RelatedListEntrySchema).optional().describe('The record page\'s tabs beside the overview, in order. Absent: every related list shows (owned master_detail children, then lookup children), then attachments, approvals and the activity stream, as before. Declared: only the lists named here show, in this order; leaving one out hides its tab. A child list another package brings is not hidden by it: that package places the list with its object extension\'s place entry (an { list, after | before } entry), and an unplaced one shows at the end of the tabs, before approvals and the activity stream; this object may also name it, which a build accepts only when that package is in the stack, and then its own position wins. Each entry is a child object name (e.g. "task"), object.field when that child has more than one relationship to this object (e.g. "event.related_to"), or a built-in tab: "sys_attachment" (attachments, still only when enable.files is on; not shown when unlisted), "sys_approval_request" (approvals, still only when the record has requests; when unlisted it follows the listed tabs), "sys_activity" (the activity stream of activities, discussion and changes; when unlisted it comes last). An entry may instead be { list, label?, columns? } to give that list its own title and child-field columns (wins over the child FK\'s relatedListTitle / relatedListColumns, used wherever the list is drawn); a built-in tab is written only as its bare name. relatedList: false on the FK still hides a list; body tables placed by fieldGroups are not hidden by this list. A name whose child is in the stack but has no inbound lookup / master_detail field to this object is refused everywhere; one whose child exists nowhere is refused by os validate / os build (which leave a sys_ / cloud_ / ai_ name to the runtime) and by a metadata write that names no package; a write into a package stores it and the record page places nothing for it. A columns name that resolves to no field of the child (a dotted name is walked through the child\'s relationships, as relatedListColumns is) is refused.'), + /** + * [ADR-0085, Note of 2026-11-27, a ruled exception] Whether the desktop + * full standard record page pins the overview (the 概览 tab: the record's + * own fields) to a left column beside its other tabs. + * + * Absent or `true`: the pin is derived, exactly as before this key existed + * (`recordPagePinsDetails` in `@object-ui/plugin-detail`): a full page + * wide enough for both columns, with another tab to put beside the + * overview and no related table placed among the fields, pins. `false`: the + * desktop full page never pins, at any width; the overview is its first + * tab, open by default, and its fields lay out by the page's width in up to + * three columns, as on a page whose overview is its only tab — a page whose + * overview holds a related table, and a narrow window, included. + * + * Read by the desktop full standard (synthesized) record page alone. The + * side preview and a phone draw the same with or without it (they never + * pin, and keep their one-column field list); print pages and authored + * `kind: 'full' | 'html' | 'react'` pages do not read it. Not an object-extension key: on an installed + * object it is the base package's to write. + */ + pinOverview: z.boolean().optional().describe('Whether the desktop full standard record page pins the overview (the record\'s own fields) to a left column beside its other tabs. Absent or true: derived as before (a full page wide enough for both columns, with another tab and no related table among the fields, pins). false: the desktop full page never pins, at any width; the overview is its first tab, open by default, and its fields lay out by width in up to three columns, also when the overview holds a related table. Read by the desktop full standard record page alone: the side preview and a phone draw the same either way, and print pages and authored kind: full | html | react pages do not read it. Not accepted on an object extension.'), /** * [ADR-0085] Semantic role: the field that represents the record's LINEAR * lifecycle (an ordered pipeline / stage progression). A string names the @@ -7092,6 +7113,13 @@ export const ObjectExtensionSchema = lazySchema(() => strictObject({ // and its judge, at publish, `os validate` / `os build` and install). // A membership key belongs to the package that owns the roster object, so a // key cannot reach into another package's object (the ruled refusal 10). + // [ADR-0085, Note of 2026-11-27] The record-page layout switch is the + // object's own: no extension slot carries it, the paired `.custom` + // package's included (it is not in `CUSTOM_ARRANGEMENT_KEYS`). + pinOverview: + '`pinOverview` cannot be contributed through an object extension: whether the record page pins ' + + 'the overview is declared on the object itself (`ObjectSchema.pinOverview`) by the package that ' + + 'defines it.', membershipKeys: '`membershipKeys` cannot be contributed through an object extension: a membership key is ' + 'declared by the package that owns the roster object whose rows define it. Declare the key on ' + diff --git a/ui/packages/app-shell/src/views/RecordDetailView.tsx b/ui/packages/app-shell/src/views/RecordDetailView.tsx index 8f271c606b1..eafcaf7c495 100644 --- a/ui/packages/app-shell/src/views/RecordDetailView.tsx +++ b/ui/packages/app-shell/src/views/RecordDetailView.tsx @@ -6588,6 +6588,11 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri // beside the other tabs when it has room; a drawer or pane // keeps them as its first tab. fullPage={!embedded} + // ADR-0085 (Note of 2026-11-27) — the object's one + // declared layout switch, read by the desktop full page + // alone: `false` keeps it unpinned, its fields laid out by + // width. A phone keeps its one-column field list. + pinOverview={phonePage ? undefined : objectDef?.pinOverview} detailsWidth={detailsWidth} onDetailsWidthChange={setDetailsWidth} onShownTabChange={setShownRecordTab} diff --git a/ui/packages/plugin-detail/README.md b/ui/packages/plugin-detail/README.md index 49c2572a1cc..282fb8d978c 100644 --- a/ui/packages/plugin-detail/README.md +++ b/ui/packages/plugin-detail/README.md @@ -917,6 +917,15 @@ still edits it. A `markdown`, `html` or `richtext` body draws its `h1`–`h3` one step smaller than `prose-sm` (18 / 16 / 14 px); they stay heading elements, so a `?section=` link still finds them. +An object that declares `pinOverview: false` (`ObjectSchema.pinOverview`) is +never pinned: the host passes the key to `RecordPageColumns` as its +`pinOverview` prop on the desktop full page, and that page keeps the details +as its first tab, open by default, their fields laid out by width in up to +three columns, at any width and also when the details hold a related table. A +drawer, a pane and a phone draw the same either way (the host does not pass +the key on a phone). `recordPagePinsDetails` takes the same value as its +optional fourth argument. + On a pinned page the left column narrows on its own to leave the tabs 400 px, never below 320 px; under that the page is no longer pinned and the details become its first tab again. The divider between the column and the tabs is a diff --git a/ui/packages/plugin-detail/src/RecordPageColumns.tsx b/ui/packages/plugin-detail/src/RecordPageColumns.tsx index d5259cd8019..ac5eb7ac617 100644 --- a/ui/packages/plugin-detail/src/RecordPageColumns.tsx +++ b/ui/packages/plugin-detail/src/RecordPageColumns.tsx @@ -64,6 +64,17 @@ export interface RecordPageColumnsProps { * Absent: not. */ fullPage?: boolean; + /** + * The object's `pinOverview` (`ObjectSchema.pinOverview`, ADR-0085's Note of + * 2026-11-27), passed by the host on the desktop full page alone. `false` + * on a full page: never pinned; the details are its first tab, open by + * default, and their fields are laid out by their own width (up to three + * columns) as on a page whose details are its only face, a page whose + * details hold a related table and a narrow page included. Absent or + * `true`: pinned as derived. Without `fullPage` (a drawer, a pane) it is + * not read. + */ + pinOverview?: boolean; /** * The width the reader dragged the pinned left column to, from the host's * preference store (per person, per object), and the setter that keeps a @@ -453,7 +464,8 @@ const DetailsWidthHandle: React.FC<{ * * Pinned (objectstack#35890, figure 41; `recordPagePinsDetails` — a full page * with room for both columns, another tab, and no related table among the - * fields): the details are a left column (400 px, dragged by the reader, and + * fields, of an object that does not declare `pinOverview: false`): the + * details are a left column (400 px, dragged by the reader, and * narrowing on their own to leave the tabs 400 — `clampDetailsWidth`), no * longer a tab. Beside them sit the tab row without 「详情」 and the open * tab, the first of the row when the address names none. The two scroll @@ -461,6 +473,11 @@ const DetailsWidthHandle: React.FC<{ * the implied one is written to the address (`onEnlargeRelated` with * `replace`). * + * A full page of an object that declares `pinOverview: false` is never + * pinned: 「详情」 is its first tab, open by default, and its fields take the + * columns their own width allows, up to three, at any width and whether or + * not its details hold a related table. + * * A strip the page places (`record:path`, `record:highlights`, a slotted * page's `highlights`; the default page places none since objectstack#35891) * sits atop the details. The right rail of summary cards (objectstack#35596) @@ -479,6 +496,7 @@ export const RecordPageColumns: React.FC = ({ columns, footer, fullPage = false, + pinOverview, detailsWidth, onDetailsWidthChange, onShownTabChange, @@ -598,13 +616,20 @@ export const RecordPageColumns: React.FC = ({ const [frameEl, setFrameEl] = React.useState(null); const [gridEl, setGridEl] = React.useState(null); const contentWidth = useContentWidth(contentEl); - const pinned = recordPagePinsDetails(contentWidth, columns, fullPage) && otherTabs.length > 0; + const pinned = recordPagePinsDetails(contentWidth, columns, fullPage, pinOverview) && otherTabs.length > 0; const pinnedHeight = usePinnedHeight(pinned ? gridEl : null, frameEl); // objectstack#36147 — the field area is one column wherever it is drawn // beside other tabs or as one of them: a drawer, a phone, a narrow page and // the pinned left column. Only a full page whose details are its only face - // (no other tab, objectstack#35890 item 4) keeps laying them out by width. - const detailsFillPage = fullPage && otherTabs.length === 0 && resolved.hidden.length === 0; + // (no other tab, objectstack#35890 item 4) keeps laying them out by width, + // and so does every full page of an object that declares `pinOverview: + // false` (ADR-0085's Note of 2026-11-27): its details are the page's first + // tab and their own width decides their columns, whether or not the page + // would have pinned (a related table among the fields, a narrow page, + // every other tab hidden). The host passes the key on the desktop full page + // alone, so a phone keeps its one-column field list. + const detailsFillPage = + fullPage && ((otherTabs.length === 0 && resolved.hidden.length === 0) || pinOverview === false); // The open tab: the address's when it names one this page has; pinned, the // first of the row otherwise (it is implied, never written, until the page diff --git a/ui/packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx b/ui/packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx index 535aaa1644b..d8a7a41653e 100644 --- a/ui/packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx +++ b/ui/packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx @@ -54,7 +54,7 @@ vi.mock('@object-ui/react', async (importOriginal) => { import { RecordPageColumns } from '../RecordPageColumns'; import { useReportEmptyFields } from '../recordFieldList'; -import { buildDefaultPageColumns } from '../synth/recordPageColumns'; +import { buildDefaultPageColumns, recordPagePinsDetails } from '../synth/recordPageColumns'; import { buildDefaultPageSchema } from '../synth/buildDefaultPageSchema'; import { DetailView } from '../DetailView'; import { InlineEditProvider } from '@object-ui/react'; @@ -650,3 +650,120 @@ describe('RecordPageColumns — the field area is one list (objectstack#36147)', expect(container.querySelector('[data-empty-fields-row]')).toBeNull(); }); }); + +/** + * ADR-0085 (Note of 2026-11-27) — the object's `pinOverview`. `false` on a + * full page: never pinned, the details its first tab, open by default, laid + * out by width (cap 3) — on a wide page, a narrow one, and one whose details + * hold a related table alike. Absent or `true`, the pin is derived. Without + * `fullPage` (the side preview) the key changes nothing. + */ +describe('RecordPageColumns — pinOverview, the object\'s layout switch', () => { + beforeEach(() => RelatedCountStore._reset()); + const find = vi.fn(async () => ({ data: [], total: 0 })); + let draws = 0; + const drawPage = (extra: Record = {}, pageColumns = columns) => + render( + ({ fields: {} })) } as any} + > + + , + ); + const capOf = (container: HTMLElement) => + container.querySelector('[data-record-column="details"] [data-node="record:details"]')?.getAttribute('data-cap'); + const shape = (container: HTMLElement) => ({ + pinned: container.querySelector('[data-record-page-pinned]') !== null, + tabs: tabNames(), + selected: screen.queryByRole('tab', { selected: true })?.getAttribute('data-record-tab') ?? null, + shown: grid(container)?.getAttribute('data-record-columns-shown') ?? null, + cap: capOf(container) ?? null, + }); + + it('the decision: false never pins; absent and true leave it derived', () => { + expect(recordPagePinsDetails(1184, columns, true)).toBe(true); + expect(recordPagePinsDetails(1184, columns, true, true)).toBe(true); + expect(recordPagePinsDetails(1184, columns, true, false)).toBe(false); + expect(recordPagePinsDetails(600, columns, true, true)).toBe(false); + }); + + it('a wide full page pins when the key is absent or true', () => { + harness.width = 1184; + for (const extra of [{}, { pinOverview: true }]) { + const { container, unmount } = drawPage({ fullPage: true, ...extra }); + expect(shape(container)).toEqual({ + pinned: true, + tabs: ['task.lead_id', 'note.parent_id', 'timeline'], + selected: 'task.lead_id', + shown: 'details tabs', + cap: '1', + }); + unmount(); + } + }); + + it('false: the wide full page does not pin; the details are the first tab, open, laid out by width', () => { + harness.width = 1184; + const { container } = drawPage({ fullPage: true, pinOverview: false }); + expect(shape(container)).toEqual({ + pinned: false, + tabs: ['overview', 'task.lead_id', 'note.parent_id', 'timeline'], + selected: 'overview', + shown: 'details', + cap: '3', + }); + expect(container.querySelectorAll('[data-node="record:details"]')).toHaveLength(1); + }); + + it('false changes nothing on the side preview (no fullPage)', () => { + harness.width = 1600; + const without = drawPage({}); + const before = shape(without.container); + without.unmount(); + const declared = drawPage({ pinOverview: false }); + expect(shape(declared.container)).toEqual(before); + expect(before).toMatchObject({ pinned: false, selected: 'overview', cap: '1' }); + }); + + it('false lays the fields out by width on every full page: a narrow one, and one whose details hold a related table', () => { + // A narrow full page never pins either way; `false` still gives the + // details their own width's columns. + harness.width = 600; + const narrow = drawPage({ fullPage: true }); + expect(shape(narrow.container)).toMatchObject({ pinned: false, selected: 'overview', cap: '1' }); + narrow.unmount(); + const narrowDeclared = drawPage({ fullPage: true, pinOverview: false }); + expect(shape(narrowDeclared.container)).toMatchObject({ pinned: false, selected: 'overview', cap: '3' }); + narrowDeclared.unmount(); + + // A wide full page whose details hold a body table does not pin + // (objectstack#35889) and draws one column; `false` draws them by width. + harness.width = 1600; + const withTable = buildDefaultPageColumns(buildDefaultPageSchema( + { name: 'quote', fields: { name: { name: 'name', type: 'text' } } }, + { + related: [ + { objectName: 'quote_line', relationshipField: 'quote_id', title: 'Lines', isPrimary: true }, + { objectName: 'task', relationshipField: 'quote_id', title: 'Tasks' }, + ], + }, + ))!; + const tableCaps = (container: HTMLElement) => + Array.from(container.querySelectorAll('[data-record-column="details"] [data-node]')) + .map((n) => `${n.getAttribute('data-node')}:${n.getAttribute('data-cap')}`); + const derived = drawPage({ fullPage: true }, withTable); + expect(shape(derived.container)).toMatchObject({ pinned: false, selected: 'overview', cap: '1' }); + expect(tableCaps(derived.container)).toEqual(['record:details:1', 'record:related_list:1']); + derived.unmount(); + const declared = drawPage({ fullPage: true, pinOverview: false }, withTable); + expect(shape(declared.container)).toMatchObject({ + pinned: false, + tabs: ['overview', 'task.quote_id', 'timeline'], + selected: 'overview', + cap: '3', + }); + expect(tableCaps(declared.container)).toEqual(['record:details:3', 'record:related_list:3']); + }); +}); diff --git a/ui/packages/plugin-detail/src/synth/recordPageColumns.ts b/ui/packages/plugin-detail/src/synth/recordPageColumns.ts index d18b01a617a..ad09e5f0870 100644 --- a/ui/packages/plugin-detail/src/synth/recordPageColumns.ts +++ b/ui/packages/plugin-detail/src/synth/recordPageColumns.ts @@ -34,10 +34,14 @@ * The right rail of summary cards (objectstack#35596) is gone: each tab's * count carries what it said (objectstack#35890). * - * ## Why the layout is derived, never authored + * ## Why the layout is derived, with one declared exception * - * The tiers are the renderer's. No metadata key, no page template and no node - * type says "columns": the spec's page vocabulary is closed inside its own + * The tiers are the renderer's. No page template and no node type says + * "columns", and one object key alone steers the layout: `pinOverview` + * (`ObjectSchema.pinOverview`, a ruled exception recorded by ADR-0085's Note + * of 2026-11-27), which keeps the wide full page from pinning the details + * when it is `false` ({@link recordPagePinsDetails}). Everything else is + * derived. The spec's page vocabulary is closed inside its own * namespaces (`record:*`, `page:*`), so a columns node would be a type an * author — or an AI — could write and the spec could not judge, and a Studio * seed carrying it would be refused at save. The layout is therefore read off @@ -176,12 +180,18 @@ export const RECORD_PAGE_PIN_MIN_WIDTH = * related table among the fields (objectstack#35889) — a table does not fit * the left column, so that page keeps the details as its full-width first tab. * An unknown width (zero or not a number) never pins. + * + * `pinOverview` is the object's declaration (`ObjectSchema.pinOverview`, + * ADR-0085's Note of 2026-11-27): `false` never pins, so the details stay the + * page's first tab; absent or `true` leaves the decision derived as above. */ export function recordPagePinsDetails( contentWidth: number, columns: Pick | null | undefined, fullPage: boolean, + pinOverview?: boolean, ): boolean { + if (pinOverview === false) return false; if (!fullPage || !columns || !(contentWidth >= RECORD_PAGE_PIN_MIN_WIDTH)) return false; if (columns.timeline.length === 0 && columns.related.length === 0) return false; return relatedListIdsIn(columns.details).length === 0;