Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/36468-navigation-size-auto-describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@objectstack/spec': patch
'@objectstack/platform-objects': patch
---

docs(spec): `navigation.size` says what `'auto'` really does

Clause-②: no
Metadata-protocol: none

The TSDoc and `.describe()` text of a view's `navigation.size` said that the default `'auto'` makes the renderer derive the drawer size from the object's field count and the viewport, so an author writes nothing. No renderer does that. `'auto'` is the host's fixed default width, the same for every object: the console's record side panel opens at `min(92vw, 460px)`, and a page block's drawer at that block's own default. The text now says so, gives the pixel cap of each explicit bucket (sm 480, md 720, lg 960, xl 1200, full 1600, always clamped to the viewport), says that a width the reader drags wins, and says where the key has no effect (a record that opens as a page, a phone-width screen). It no longer calls the buckets aligned with `FormView.modalSize`, whose buckets have other names and other widths.

Prose only: the key, its values and its default are unchanged. The view form's help text for the key, the English metadata-form bundle `@objectstack/platform-objects` serves it from, and the generated reference pages carry the same text.
14 changes: 7 additions & 7 deletions content/docs/references/ui/component.mdx

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions content/docs/references/ui/view.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma
| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). |
| **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely |
| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Width bucket for the record drawer: 'auto' (default) keeps the host's fixed default width, the same for every object whatever its field count (the console's record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it. |
| **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. |

### Nested Shape: `ListView.pagination`
Expand Down Expand Up @@ -1212,7 +1212,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma
| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). |
| **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely |
| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Width bucket for the record drawer: 'auto' (default) keeps the host's fixed default width, the same for every object whatever its field count (the console's record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it. |
| **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. |


Expand Down Expand Up @@ -1357,7 +1357,7 @@ An any-of group: `{ or: [rule, ...] }` matches a record when ANY of its rules ma
| **view** | `never` | optional | [REMOVED] `view.list.navigation.view` was removed in @objectstack/spec 17.5.0 (ADR-0049 enforce-or-remove) — it named the form view to open for a record detail, and no layer resolved a view by that name: the value was passed straight into the navigation-MODE argument of the console's `onNavigate`, where anything other than `edit` or `view` matched no branch, so the key selected nothing and could silently deaden the row click. Delete the key; to choose what opens for a record, assign a `record` page to the object and let `isDefault` pick the one that opens — page assignment is the machinery that resolves a detail layout, and a list view's navigation block only decides HOW the detail is surfaced (its `size`, and on a page block its `mode`). |
| **preventNavigation** | `boolean` | optional (default: `false`) | Disable standard navigation entirely |
| **openNewTab** | `boolean` | optional (default: `false`) | Open the record's full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it. |
| **size** | `Enum<'auto' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'>` | optional (default: `"auto"`) | Width bucket for the record drawer: 'auto' (default) keeps the host's fixed default width, the same for every object whatever its field count (the console's record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it. |
| **width** | `string \| number` | optional | [DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket. |

### Nested Shape: `ObjectListView.pagination`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
},
"navigation.size": {
label: "Size",
helpText: "Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it."
helpText: "Width bucket for the record drawer: 'auto' (default) keeps the host's fixed default width, the same for every object whatever its field count (the console's record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it."
},
"navigation.width": {
label: "Width",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
},
"navigation.size": {
label: "尺寸",
helpText: "抽屉详情的浮层尺寸档位:'auto'(默认——渲染器按字段数与视口推导,AI 无需填写),或粗粒度覆盖 sm/md/lg/xl/full。优先使用它而非像素 `width`;page 模式会忽略它。"
helpText: "记录抽屉的宽度档位:'auto'(默认)沿用宿主固定的默认宽度,每个对象都一样,与字段数无关(控制台的记录侧边面板以 460px 打开);或粗粒度覆盖 sm/md/lg/xl/full(上限分别为 480/720/960/1200/1600px,始终受视口限制)。读者拖动出的宽度优先于两者。优先使用它而非像素 `width`;记录以整页打开时它不起作用(控制台在手机上一律以整页打开记录),在手机宽度的屏幕上也不起作用,那里抽屉占满屏幕。"
},
"navigation.width": {
label: "宽度",
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/ui/view.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export const viewForm = defineForm({
},
{ field: 'preventNavigation', helpText: 'Disable standard navigation entirely' },
{ field: 'openNewTab', helpText: 'Open the record\'s full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place' },
{ field: 'size', helpText: 'Overlay size bucket for the drawer detail: \'auto\' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it.' },
{ field: 'size', helpText: 'Width bucket for the record drawer: \'auto\' (default) keeps the host\'s fixed default width, the same for every object whatever its field count (the console\'s record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it.' },
{ field: 'width', helpText: '[DEPRECATED → size] Pixel/percent width of the drawer (e.g. "600px"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket.' },
],
},
Expand Down
23 changes: 17 additions & 6 deletions packages/spec/src/ui/view.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3102,14 +3102,25 @@ export const NavigationConfigSchema = lazySchema(() => strictObject({
openNewTab: z.boolean().default(false).describe('Open the record\'s full page in a new browser tab when it is clicked; rows that open nothing stay that way, and a phone opens the page in place'),

/**
* [#2578] Overlay size for a drawer detail — coarse T-shirt buckets,
* aligned with `FormView.modalSize` (`page` mode ignores it). `'auto'`
* (default): the renderer derives the size from the object's field count and
* clamps it to the client viewport, so AI writes nothing — it cannot know the
* client width. Explicit buckets are a coarse, viewport-independent override.
* [#2578] Width of the record drawer, as a coarse T-shirt bucket. Each
* explicit bucket is a pixel cap the renderer clamps to the viewport
* (`min(92vw, CAP)`): sm 480, md 720, lg 960, xl 1200, full 1600.
*
* `'auto'` (default) is the host's fixed default width, the same for every
* object whatever its field count — nothing is derived from the object's
* fields. The console's record side panel (opened from an object's list, and
* the drawer level over a record page) opens at `min(92vw, 460px)`; a page
* block's drawer opens at that block's own default (`min(960px, 60vw)` for
* the grid, kanban, calendar, gantt and tree; 42rem for the list, gallery,
* map and timeline). A width the reader drags is remembered and wins over
* both `'auto'` and a bucket.
*
* The key has no effect where the record opens as a page rather than a
* drawer (in the console every record opens as a page on a phone), nor on a
* phone-width screen, where a block's drawer fills the screen.
*/
size: z.enum(['auto', 'sm', 'md', 'lg', 'xl', 'full']).default('auto')
.describe("Overlay size bucket for the drawer detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it."),
.describe("Width bucket for the record drawer: 'auto' (default) keeps the host's fixed default width, the same for every object whatever its field count (the console's record side panel opens at 460px), or a coarse override sm/md/lg/xl/full (a 480/720/960/1200/1600px cap, always clamped to the viewport). A width the reader drags wins over either. Prefer this over the pixel `width`; it has no effect where the record opens as a page (in the console, every record on a phone), nor on a phone-width screen, where the drawer fills it."),

/**
* @deprecated [#2578 → `size`] A pixel/percent width cannot be authored blind:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export const ZH_CN_SPEC_FORMS: NonNullable<TranslationData['metadataForms']> = {
'navigation.mode': { label: '模式', helpText: '[已弃用] 在对象列表(列表视图、对象的 `listViews`)上不再决定记录如何打开:在控制台中,对所有用户而言,点记录名称进入整页,点名称旁的悬停图标从侧边面板打开。这里 `drawer`、`page`、`new_window` 仍可解析,但不再起作用,请省略此键;`none` 仍表示列表行不打开任何内容——建议改用 `preventNavigation: true`。带 `navigation` 的页面区块(列表区块、时间线、嵌入视图)仍按所有取值生效。' },
'navigation.preventNavigation': { label: '禁止导航', helpText: '完全禁用标准导航' },
'navigation.openNewTab': { label: '在新标签页打开', helpText: '点击记录时在新的浏览器标签页中打开其整页;设为不打开的行保持不打开,手机上仍在当前页打开' },
'navigation.size': { label: '尺寸', helpText: '抽屉详情的浮层尺寸档位:\'auto\'(默认——渲染器按字段数与视口推导,AI 无需填写),或粗粒度覆盖 sm/md/lg/xl/full。优先使用它而非像素 `width`;page 模式会忽略它。' },
'navigation.size': { label: '尺寸', helpText: '记录抽屉的宽度档位:\'auto\'(默认)沿用宿主固定的默认宽度,每个对象都一样,与字段数无关(控制台的记录侧边面板以 460px 打开);或粗粒度覆盖 sm/md/lg/xl/full(上限分别为 480/720/960/1200/1600px,始终受视口限制)。读者拖动出的宽度优先于两者。优先使用它而非像素 `width`;记录以整页打开时它不起作用(控制台在手机上一律以整页打开记录),在手机宽度的屏幕上也不起作用,那里抽屉占满屏幕。' },
'navigation.width': { label: '宽度', helpText: '[已弃用 → size] 抽屉的像素 / 百分比宽度(如 "600px")。编写时无法预知客户端视口,因此选不出合适的像素宽度——请使用 `size` 档位。' },
sharing: { label: '共享', helpText: '视图共享配置:谁锁定了视图配置' },
'sharing.lockedBy': { label: '锁定者', helpText: '锁定该视图配置的用户' },
Expand Down
Loading