From 884e05588dbaee3b1fd30b3c68ccf5d5c94283a1 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 10:04:46 +0000 Subject: [PATCH 1/2] docs(spec): ObjectNavItemSchema.viewName states the view the console opens when it is omitted The describe said the default is "all". The console opens the object's default list view (the one `buildViewTabs` marks `isDefault`), else its first declared list view; `all` is only the fallback tab it builds for an object with no list view. The lint header's quote of the sentence follows. Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude --- packages/lint/src/lint-view-refs.ts | 6 ++++-- packages/spec/src/ui/app.zod.ts | 12 +++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/packages/lint/src/lint-view-refs.ts b/packages/lint/src/lint-view-refs.ts index 2c0b127ccf7..bc12f791211 100644 --- a/packages/lint/src/lint-view-refs.ts +++ b/packages/lint/src/lint-view-refs.ts @@ -43,8 +43,10 @@ * * A form action target is one way to name a view; an app's navigation is the * other, and it is the one an end user travels every day. `ObjectNavItemSchema` - * documents `viewName` as *"Default list view to open. Defaults to 'all'"* — so - * an unresolvable name does not fail, it **falls back**. Measured end to end: + * documents `viewName` as *"Default list view to open. When omitted, the console + * opens the object's default list view, else its first declared list view"* — + * and an unresolvable name does not fail, it **falls back** to that same view. + * Measured end to end: * mutating a real app's `viewName` to a name nothing declares leaves * `os validate --json` reporting `valid: true`, and `os build` green. * diff --git a/packages/spec/src/ui/app.zod.ts b/packages/spec/src/ui/app.zod.ts index 669509f0703..62af772bf44 100644 --- a/packages/spec/src/ui/app.zod.ts +++ b/packages/spec/src/ui/app.zod.ts @@ -429,7 +429,17 @@ export const ObjectNavItemSchema = lazySchema(() => strictObject(navItemSurface( ...BaseNavItemSchema.shape, type: z.literal('object'), objectName: z.string().describe('Target object name'), - viewName: z.string().optional().describe('Default list view to open. Defaults to "all". Ignored when `recordId` is set.'), + /** + * The rule this sentence states is the console's, read at the objectui commit + * `.objectui-sha` pins: an entry with no `viewName` links to the bare object + * route, where `ObjectView` opens `defaultViewId || views[0]` — the view + * `buildViewTabs` marks `isDefault` (the default `list`), else the first + * declared list view. Its `all` tab is the fallback `buildViewTabs` adds only + * when the object has no list view at all, so `all` is no default (#21973). + */ + viewName: z.string().optional().describe( + 'Default list view to open. When omitted, the console opens the object\'s default list view, else its first declared list view; `all` names the console\'s fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set.', + ), /** * When set, navigate straight to the detail page of this specific * record instead of the object's list view. Supports template From b53d7b5a347066148c25f196c97618d477d3723a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 10:15:18 +0000 Subject: [PATCH 2/2] docs(spec): regenerate the app reference page and add the spec patch changeset Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude --- .changeset/21973-nav-view-name-default.md | 12 ++++++++++++ content/docs/references/ui/app.mdx | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 .changeset/21973-nav-view-name-default.md diff --git a/.changeset/21973-nav-view-name-default.md b/.changeset/21973-nav-view-name-default.md new file mode 100644 index 00000000000..6e80d205830 --- /dev/null +++ b/.changeset/21973-nav-view-name-default.md @@ -0,0 +1,12 @@ +--- +"@objectstack/spec": patch +--- + +`ObjectNavItemSchema.viewName`'s describe no longer says the default is "all". It now states what the console does when an object nav entry names no view: it opens the object's default list view, else its first declared list view. `all` is only the console's fallback tab, and it exists only for an object that declares no list view. + +Clause-②: no + +- The rule is read from objectui at the `.objectui-sha` pin. `ObjectView` opens `defaultViewId || views[0]`, where `defaultViewId` is the view `buildViewTabs` marks `isDefault` (the default `list`). `buildViewTabs` adds the `all` tab only when the object has no list view at all. +- An author who omitted `viewName` expecting all records got that default or first declared view instead. When the object declares more than one list view, name the one the entry should open in `viewName`. +- The generated app reference page follows (#21973). The lint header that quoted the old sentence follows too, as a comment only. +- ⛔ No schema, type, optionality, default, export or accept-set change. The console's behaviour does not change. diff --git a/content/docs/references/ui/app.mdx b/content/docs/references/ui/app.mdx index d21247d5f46..6ec5862b041 100644 --- a/content/docs/references/ui/app.mdx +++ b/content/docs/references/ui/app.mdx @@ -113,7 +113,7 @@ const result = ActionNavItemSchema.parse(data); | **requiresService** | `string` | optional | Hide/disable this entry unless the named kernel service is registered | | **type** | `'object'` | ✅ | | | **objectName** | `string` | ✅ | Target object name | -| **viewName** | `string` | optional | Default list view to open. Defaults to "all". Ignored when `recordId` is set. | +| **viewName** | `string` | optional | Default list view to open. When omitted, the console opens the object's default list view, else its first declared list view; `all` names the console's fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set. | | **recordId** | `string` | optional | Navigate directly to this record id instead of the list view. Supports template vars: `{current_user_id}`, `{current_org_id}`. | | **recordMode** | `Enum<'view' \| 'edit'>` | optional | Open the record in view (default) or edit mode. Only meaningful when `recordId` is set. | | **filters** | `Record` | optional | URL filter conditions — targets the /:objectName/data bare surface via filter[``]=`` params instead of a saved view. Values support template vars `{current_user_id}`, `{current_org_id}`. Mutually exclusive with recordId/viewName. | @@ -462,7 +462,7 @@ Documentation entry on the app menu (ADR-0046). Targets a `book` and/or a `doc` | **requiresService** | `string` | optional | Hide/disable this entry unless the named kernel service is registered | | **type** | `'object'` | ✅ | | | **objectName** | `string` | ✅ | Target object name | -| **viewName** | `string` | optional | Default list view to open. Defaults to "all". Ignored when `recordId` is set. | +| **viewName** | `string` | optional | Default list view to open. When omitted, the console opens the object's default list view, else its first declared list view; `all` names the console's fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set. | | **recordId** | `string` | optional | Navigate directly to this record id instead of the list view. Supports template vars: `{current_user_id}`, `{current_org_id}`. | | **recordMode** | `Enum<'view' \| 'edit'>` | optional | Open the record in view (default) or edit mode. Only meaningful when `recordId` is set. | | **filters** | `Record` | optional | URL filter conditions — targets the /:objectName/data bare surface via filter[``]=`` params instead of a saved view. Values support template vars `{current_user_id}`, `{current_org_id}`. Mutually exclusive with recordId/viewName. | @@ -652,7 +652,7 @@ A navigation contribution: a package injecting nav items into an app it does not | **requiresService** | `string` | optional | Hide/disable this entry unless the named kernel service is registered | | **type** | `'object'` | ✅ | | | **objectName** | `string` | ✅ | Target object name | -| **viewName** | `string` | optional | Default list view to open. Defaults to "all". Ignored when `recordId` is set. | +| **viewName** | `string` | optional | Default list view to open. When omitted, the console opens the object's default list view, else its first declared list view; `all` names the console's fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set. | | **recordId** | `string` | optional | Navigate directly to this record id instead of the list view. Supports template vars: `{current_user_id}`, `{current_org_id}`. | | **recordMode** | `Enum<'view' \| 'edit'>` | optional | Open the record in view (default) or edit mode. Only meaningful when `recordId` is set. | | **filters** | `Record` | optional | URL filter conditions — targets the /:objectName/data bare surface via filter[``]=`` params instead of a saved view. Values support template vars `{current_user_id}`, `{current_org_id}`. Mutually exclusive with recordId/viewName. | @@ -839,7 +839,7 @@ This schema accepts one of the following structures: | **requiresService** | `string` | optional | Hide/disable this entry unless the named kernel service is registered | | **type** | `'object'` | ✅ | | | **objectName** | `string` | ✅ | Target object name | -| **viewName** | `string` | optional | Default list view to open. Defaults to "all". Ignored when `recordId` is set. | +| **viewName** | `string` | optional | Default list view to open. When omitted, the console opens the object's default list view, else its first declared list view; `all` names the console's fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set. | | **recordId** | `string` | optional | Navigate directly to this record id instead of the list view. Supports template vars: `{current_user_id}`, `{current_org_id}`. | | **recordMode** | `Enum<'view' \| 'edit'>` | optional | Open the record in view (default) or edit mode. Only meaningful when `recordId` is set. | | **filters** | `Record` | optional | URL filter conditions — targets the /:objectName/data bare surface via filter[``]=`` params instead of a saved view. Values support template vars `{current_user_id}`, `{current_org_id}`. Mutually exclusive with recordId/viewName. | @@ -1081,7 +1081,7 @@ Documentation entry on the app menu (ADR-0046). Targets a `book` and/or a `doc` | **requiresService** | `string` | optional | Hide/disable this entry unless the named kernel service is registered | | **type** | `'object'` | ✅ | | | **objectName** | `string` | ✅ | Target object name | -| **viewName** | `string` | optional | Default list view to open. Defaults to "all". Ignored when `recordId` is set. | +| **viewName** | `string` | optional | Default list view to open. When omitted, the console opens the object's default list view, else its first declared list view; `all` names the console's fallback tab, which exists only for an object that declares no list view. Ignored when `recordId` is set. | | **recordId** | `string` | optional | Navigate directly to this record id instead of the list view. Supports template vars: `{current_user_id}`, `{current_org_id}`. | | **recordMode** | `Enum<'view' \| 'edit'>` | optional | Open the record in view (default) or edit mode. Only meaningful when `recordId` is set. | | **filters** | `Record` | optional | URL filter conditions — targets the /:objectName/data bare surface via filter[``]=`` params instead of a saved view. Values support template vars `{current_user_id}`, `{current_org_id}`. Mutually exclusive with recordId/viewName. |