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
21 changes: 21 additions & 0 deletions .changeset/39053-setup-ten-group-anchors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@objectstack/spec': minor
'@objectstack/objectql': minor
'@objectstack/platform-objects': minor
'@objectstack/cli': patch
'@objectstack/runtime': patch
'@object-ui/types': patch
---

feat(setup): Setup navigation gets ten group anchors; a nav group's `renamedFrom` keeps retired ids working

Clause-②: yes (widening)
Metadata-protocol: added

**New key: `renamedFrom` on a group nav item** (`GroupNavItemSchema`, optional, a list of nav ids). It names the group ids the group replaced. A `navigationContributions[]` entry whose `group` names one of them lands in that group instead of the app's top level. The merge looks for an exact group id first and reads `renamedFrom` only when none matches. The app's own parse refuses an entry that is the group's own id, repeats in the list, is an id another entry of the app still declares, or is claimed by a second group, and refuses the key on a group inside `areas[].navigation`, where no contribution is merged. Nothing changes for an app that does not write the key. `@objectstack/spec/ui` exports the check, `checkAppNavGroupRenamedFrom`, and `@object-ui/types`' `AppComponentSchema` chains it and accepts `renamedFrom` on a navigation item, so objectui's validator judges the key as the publish door does instead of dropping it.

**New warning: `nav_contribution_group_renamed`.** A contribution that names a retired id is logged at `warn` by the runtime and reported by `os build` and `os validate` under its own headline. The message names the package, the retired id and the group that took it over; the fix is to change the contribution's `group` to the new id. It is not a relocation, so the published relocation surface keeps its contract: `NavContributionGroupDiagnostic`, `checkNavContributionGroups()` and `SchemaRegistry#getAppNavDiagnostics()` are unchanged and never carry it (a group id that resolves through `renamedFrom` is not reported there). `@objectstack/objectql` adds `checkNavContributionGroupRenames()` (the compile-time notices, `NavContributionGroupRenamedDiagnostic[]`), `resolveNavGroup()`, `navContributionGroupRenamedDiagnostic()`, `NAV_CONTRIBUTION_GROUP_RENAMED`, and the `NavContributionGroupRenamedDiagnostic` / `NavContributionGroupFinding` (either finding) / `NavGroupResolution` types; `findNavGroup()` now also finds a group through its `renamedFrom`, and `formatNavContributionGroupDiagnostic()` accepts either finding.

**Setup's anchors.** The System Overview dashboard is pinned above the groups. The groups, in order: `group_users_org`, `group_access_sharing`, `group_apps_ai`, `group_routing_approvals`, `group_audit_data` (expanded), then `group_company`, `group_currency_units`, `group_notifications`, `group_login_security`, `group_integrations_dev` (collapsed), labelled in all 11 Setup locales. Each group that replaced an old anchor lists it in `renamedFrom`, so every existing contribution still lands in the right place, with the warning above. `group_overview` has no successor: a contribution still naming it is appended at the top level with the `nav_contribution_group_missing` warning, and it loses the `manage_platform_settings` gate that group carried. In this repository that is `@objectstack/mcp`'s "Connect an AI Assistant" entry (`nav_connect_agent`, no gate of its own): until its contribution moves to a new anchor it shows at Setup's top level to everyone who can open Setup, not only to holders of `manage_platform_settings`. The page itself was already open to every user through the Account app.

**What a package author does.** If your package contributes into Setup, change `group` to the new id named in the warning: `group_people_org` → `group_users_org`, `group_access_control` → `group_access_sharing`, `group_apps` → `group_apps_ai`, `group_approvals` → `group_routing_approvals`, `group_diagnostics` → `group_audit_data`, `group_configuration` → `group_company`, `group_integrations` and `group_advanced` → `group_integrations_dev`. A translation bundle keyed by an old group id (`apps.setup.navigation.<id>`) no longer labels anything; key it by the new id.
7 changes: 6 additions & 1 deletion content/docs/references/ui/app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,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** | `'group'` | ✅ | |
| **expanded** | `boolean` | optional (default: `true`) | Whether the group starts open in the sidebar. Omitted, it opens; write `false` to keep it closed until the user opens it. A group holding the current route opens whatever it declares. |
| **renamedFrom** | `string[]` | optional | Earlier ids of THIS navigation group, in the nav-id grammar (lowercase snake_case), e.g. `renamedFrom: ['group_people_org']` on a group now `group_users_org`. A navigation contribution (`navigationContributions[]`) whose `group` names one of them lands in this group, and the contributing package is warned to name the new id (`nav_contribution_group_renamed`, by the runtime at `warn` and by `os build` / `os validate`). A group whose own id matches always wins over a `renamedFrom` entry. Several retired groups merged into this one are all listed. Each entry once; never this group's own id; never an id another entry of the app still declares; never an old id another group also claims; only on groups in the app's `navigation` (contributions never fold into `areas`). |
| **children** | `({ id: string; label?: string \| Record<string, string>; icon?: string; order?: number; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Child navigation items |

### Nested Shape: `App.areas[number]`
Expand Down Expand Up @@ -496,6 +497,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** | `'group'` | ✅ | |
| **expanded** | `boolean` | optional (default: `true`) | Whether the group starts open in the sidebar. Omitted, it opens; write `false` to keep it closed until the user opens it. A group holding the current route opens whatever it declares. |
| **renamedFrom** | `string[]` | optional | Earlier ids of THIS navigation group, in the nav-id grammar (lowercase snake_case), e.g. `renamedFrom: ['group_people_org']` on a group now `group_users_org`. A navigation contribution (`navigationContributions[]`) whose `group` names one of them lands in this group, and the contributing package is warned to name the new id (`nav_contribution_group_renamed`, by the runtime at `warn` and by `os build` / `os validate`). A group whose own id matches always wins over a `renamedFrom` entry. Several retired groups merged into this one are all listed. Each entry once; never this group's own id; never an id another entry of the app still declares; never an old id another group also claims; only on groups in the app's `navigation` (contributions never fold into `areas`). |

### Nested Shape: `GroupNavItem.dataSource`

Expand Down Expand Up @@ -701,6 +703,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** | `'group'` | ✅ | |
| **expanded** | `boolean` | optional (default: `true`) | Whether the group starts open in the sidebar. Omitted, it opens; write `false` to keep it closed until the user opens it. A group holding the current route opens whatever it declares. |
| **renamedFrom** | `string[]` | optional | Earlier ids of THIS navigation group, in the nav-id grammar (lowercase snake_case), e.g. `renamedFrom: ['group_people_org']` on a group now `group_users_org`. A navigation contribution (`navigationContributions[]`) whose `group` names one of them lands in this group, and the contributing package is warned to name the new id (`nav_contribution_group_renamed`, by the runtime at `warn` and by `os build` / `os validate`). A group whose own id matches always wins over a `renamedFrom` entry. Several retired groups merged into this one are all listed. Each entry once; never this group's own id; never an id another entry of the app still declares; never an old id another group also claims; only on groups in the app's `navigation` (contributions never fold into `areas`). |
| **children** | `({ id: string; label?: string \| Record<string, string>; icon?: string; order?: number; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Child navigation items |


Expand All @@ -715,7 +718,7 @@ A navigation contribution: a package injecting nav items into an app it does not
| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **app** | `string` | ✅ | Target app name to contribute navigation into (e.g. "setup") |
| **group** | `string` | optional | Target group nav-item id to append into (e.g. "group_integrations"); omit to append at the app top level. Naming a group the target app does not declare is not refused: the items are appended at the app top level anyway and a `nav_contribution_group_missing` diagnostic is emitted — by the runtime at `warn`, and by `os build` and `os validate` at compile time. |
| **group** | `string` | optional | Target group nav-item id to append into (e.g. "group_integrations"); omit to append at the app top level. A retired id that a group of the target app lists in its `renamedFrom` lands in that group, with a `nav_contribution_group_renamed` warning naming the new id. Naming a group the target app does not declare is not refused: the items are appended at the app top level anyway and a `nav_contribution_group_missing` diagnostic is emitted — by the runtime at `warn`, and by `os build` and `os validate` at compile time. |
| **priority** | `integer` | optional (default: `200`) | Merge priority within the target group — lower applied first (matches object extender priority) |
| **items** | `({ id: string; label?: string \| Record<string, string>; icon?: string; order?: number; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Navigation items contributed into the target app/group |

Expand Down Expand Up @@ -900,6 +903,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** | `'group'` | ✅ | |
| **expanded** | `boolean` | optional (default: `true`) | Whether the group starts open in the sidebar. Omitted, it opens; write `false` to keep it closed until the user opens it. A group holding the current route opens whatever it declares. |
| **renamedFrom** | `string[]` | optional | Earlier ids of THIS navigation group, in the nav-id grammar (lowercase snake_case), e.g. `renamedFrom: ['group_people_org']` on a group now `group_users_org`. A navigation contribution (`navigationContributions[]`) whose `group` names one of them lands in this group, and the contributing package is warned to name the new id (`nav_contribution_group_renamed`, by the runtime at `warn` and by `os build` / `os validate`). A group whose own id matches always wins over a `renamedFrom` entry. Several retired groups merged into this one are all listed. Each entry once; never this group's own id; never an id another entry of the app still declares; never an old id another group also claims; only on groups in the app's `navigation` (contributions never fold into `areas`). |
| **children** | `({ id: string; label?: string \| Record<string, string>; icon?: string; order?: number; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Child navigation items |


Expand Down Expand Up @@ -1221,6 +1225,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** | `'group'` | ✅ | |
| **expanded** | `boolean` | optional (default: `true`) | Whether the group starts open in the sidebar. Omitted, it opens; write `false` to keep it closed until the user opens it. A group holding the current route opens whatever it declares. |
| **renamedFrom** | `string[]` | optional | Earlier ids of THIS navigation group, in the nav-id grammar (lowercase snake_case), e.g. `renamedFrom: ['group_people_org']` on a group now `group_users_org`. A navigation contribution (`navigationContributions[]`) whose `group` names one of them lands in this group, and the contributing package is warned to name the new id (`nav_contribution_group_renamed`, by the runtime at `warn` and by `os build` / `os validate`). A group whose own id matches always wins over a `renamedFrom` entry. Several retired groups merged into this one are all listed. Each entry once; never this group's own id; never an id another entry of the app still declares; never an old id another group also claims; only on groups in the app's `navigation` (contributions never fold into `areas`). |
| **children** | `[NavigationItem](#navigationitem)[]` | ✅ | Child navigation items |

### Nested Shape: `NavigationItem[type='group'].dataSource`
Expand Down
57 changes: 43 additions & 14 deletions content/docs/ui/apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ them in a code package.
navigationContributions: [
{
app: 'setup',
group: 'group_integrations',
group: 'group_integrations_dev',
priority: 100,
items: [
{ id: 'nav_webhooks', type: 'object', label: 'Webhooks', objectName: 'sys_webhook', requiresObject: 'sys_webhook', order: 30 },
Expand Down Expand Up @@ -895,19 +895,48 @@ the build. The anchor id is the whole contract between the shell and its
contributors, and a typo renders a working menu with the entry one level up, so
read that warning.

The Setup app's anchors:

| Group id | Holds |
| :--- | :--- |
| `group_overview` | System Overview dashboard |
| `group_apps` | Packages and the marketplace |
| `group_people_org` | Users, organizations, business units, teams, invitations |
| `group_access_control` | Positions, permission sets, sharing rules, API keys |
| `group_approvals` | Approvals inbox, requests, history, delegations |
| `group_configuration` | Settings, localization, exchange rates, working calendars, authentication, email, storage, AI, branding |
| `group_diagnostics` | Sessions, notification events, audit log |
| `group_integrations` | Webhooks, cloud connection |
| `group_advanced` | OAuth applications |
**A group can take over retired ids.** A group nav item may list the ids it
replaced in `renamedFrom`, so a contribution that still names one of them lands in
that group instead of the top level. The merge looks for an exact group id first,
and only then for a group whose `renamedFrom` lists the id. Such a contribution
raises a `nav_contribution_group_renamed` warning that names the package, the
retired id and the group that took it over, from the runtime and from `os build`
and `os validate`; change the contribution's `group` to the new id. The app's own
parse refuses a `renamedFrom` entry that is the group's own id, repeats in the
list, is an id another entry of the app still declares, or is claimed by a second
group, and refuses the key on a group inside `areas[].navigation`, where no
contribution is merged.

```typescript
{
id: 'group_integrations_dev',
type: 'group',
label: 'Integrations & Developer',
renamedFrom: ['group_integrations', 'group_advanced'],
children: [],
}
```

The Setup app opens with the System Overview dashboard pinned above its groups,
then these anchors, in this order:

| Group id | Holds | Took over |
| :--- | :--- | :--- |
| `group_users_org` | Users, organizations, business units, teams, invitations | `group_people_org` |
| `group_access_sharing` | Positions, permission sets, sharing rules, API keys | `group_access_control` |
| `group_apps_ai` | Packages and the marketplace | `group_apps` |
| `group_routing_approvals` | Approvals inbox, requests, history, delegations | `group_approvals` |
| `group_audit_data` | Sessions, notification events, audit log | `group_diagnostics` |
| `group_company` | Settings, localization, exchange rates, working calendars, authentication, email, storage, AI, branding | `group_configuration` |
| `group_currency_units` | Currency and unit settings | |
| `group_notifications` | Notification settings | |
| `group_login_security` | Login and security settings | |
| `group_integrations_dev` | Webhooks, cloud connection, OAuth applications | `group_integrations`, `group_advanced` |

The first five start expanded and the last five collapsed. The retired
`group_overview` has no successor: the dashboard it held is pinned at the top,
and a contribution still naming it is appended at the top level with the
`nav_contribution_group_missing` warning.

**Exchange Rates** (`sys_exchange_rate`, under Localization) holds an organization's dated rates, editable by
its administrators. One row means 1 unit of the home currency (Localization → Default currency) = `rate` units
Expand Down
Loading
Loading