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
25 changes: 25 additions & 0 deletions .changeset/39052-nav-item-keywords.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@objectstack/spec': minor
'@object-ui/types': patch
'@object-ui/app-shell': patch
---

feat(spec): a navigation item declares search aliases, `keywords`, and a translation bundle gives them per locale

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

Setup pages are being renamed (#39050), so a page must still be found by its old name. Two optional keys carry that:

- **`keywords: string[]` on every navigation item** except `separator` (it sits on the shared nav base, beside `label`). Source-language words a person may type to find the entry, such as its old name. Search only: never shown, never a route, never a gate. Each keyword is one trimmed, non-empty word or phrase of at most 60 characters, and an entry takes at most 20 (the dataset synonym's rule); anything else is refused, not trimmed. `synonyms`, `searchTerms` and `searchKeywords` are refused with "did you mean `keywords`", and so is `aliases`, except on a `group`, where it is answered with both keys it can mean there (`keywords`, or `renamedFrom` for retired group ids). A `separator` refuses `keywords` with its own prescription.
- **`keywords: string[]` on a translation bundle's navigation node**, beside `label`: `apps.<app>.navigation.<id>.keywords` gives this locale's aliases for the entry, keyed by the same entry id as the label, at both translation doors (the file bundle and the registered `translation` item), under the same rule as the item's. The node still owes its `label`, and an unknown key is still refused.

The key is named `keywords`, not `aliases`, because `aliases` already means a retired-key rename map across the AI schemas.

Nothing reads either key yet. The reader is the command palette (#39055), which will match a query against the aliases resolved for the current locale. Until then the key is graded `planned` on the liveness ledger (`navigation.children.keywords`), its describe carries `[PLANNED — not yet read]`, and authoring it raises no warning: an alias nothing reads costs a search hit, not a gate.

The navigation contribution's `group` describe and example now name a current Setup group id, `group_integrations_dev`, instead of the retired `group_integrations`.

`@object-ui/types` declares `keywords` on its navigation item mirror, so `objectui validate` keeps the key, under the spec's rule, instead of stripping it; nothing in the console reads it yet. `@object-ui/app-shell`'s nav editors count `keywords` among the describing keys, so changing an entry's type keeps them.

No action needed for existing metadata: both keys are optional.
67 changes: 56 additions & 11 deletions content/docs/references/ui/app.mdx

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions content/docs/ui/apps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ rejected — a divider has nothing to label, gate, or badge.)
| :--- | :--- | :--- |
| `id` | `string` | Unique identifier (`snake_case`, required) |
| `label` | `string` | Display label |
| `keywords` | `string[]` | Search aliases, such as a page's old name after a rename (planned: the command palette will read them) |
| `icon` | `string` | Icon name (Lucide) |
| `order` | `number` | Sort order within the same level (lower = first); entries [contributed by another package](#contributing-navigation-to-another-app) sort in the same level |
| `badge` | `string \| number` | Badge text or count displayed on the item |
Expand All @@ -311,6 +312,11 @@ load with no navigation edit. Other entries fall back to their target's name
console's own name for the index. A `label` you write renders verbatim; never write an empty one, omit the
key instead.

`keywords` lists other words a person may type to find the entry, such as its old
name after a rename; they are never shown and never gate anything, and a
translation bundle gives each locale its own under
`apps.<app>.navigation.<id>.keywords`, beside that entry's `label`.

## Designing the navigation

The same requirement can often be met three ways: a plain object entry, an object
Expand Down
6 changes: 3 additions & 3 deletions docs/qa/platform-checklist/areas/dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@
"fixtures": {
"app": "showcase",
"requires": [
"the built-in Setup app + the platform `system_overview` dashboard (packages/platform-objects/src/apps/dashboards/system_overview.dashboard.ts) reached at Setup → System Overview (nav_system_overview, setup-nav.contributions.ts) — present in any booted app, not a showcase fixture",
"the built-in Setup app + the platform `system_overview` dashboard (packages/platform-objects/src/apps/dashboards/system_overview.dashboard.ts) reached at Setup → System Overview (nav_system_overview, setup.app.ts, pinned at the top of the Setup sidebar outside every group) — present in any booted app, not a showcase fixture",
"the five backing datasets over `sys_*` objects (packages/platform-objects/src/apps/dashboards/system.datasets.ts: sys_user_metrics, sys_session_metrics, sys_organization_metrics, sys_package_installation_metrics, sys_audit_log_metrics)",
"at least one signed-in session (the admin's own) so sys_session count is non-zero, and the seeded sys_user population"
],
Expand All @@ -967,7 +967,7 @@
]
},
"steps": [
"sign in as admin, open the Setup app, and navigate to System Overview (nav_system_overview → dashboard system_overview); let the board settle and screenshot the whole dashboard BEFORE reading any DOM",
"sign in as admin, open the Setup app, and navigate to System Overview, the first entry of the Setup sidebar (nav_system_overview → dashboard system_overview); let the board settle and screenshot the whole dashboard BEFORE reading any DOM",
"capture the dataset queries the widgets issue on load (the network trace) — each metric tile queries its sys_*_metrics dataset (count aggregate)",
"first make the live-session predicate discriminate — a fresh boot holds no revoked or expired sys_session row, so the live count and the table count are equal and clause 1 proves nothing (QA run #23927 F3): sign the admin in a SECOND time (POST /api/v1/auth/sign-in/email; keep the returned token) and, from the first session, revoke the second one (POST /api/v1/auth/revoke-session {\"token\": the second token}). An interactive revoke TOMBSTONES the row in place — revoked_at and revoke_reason 'user_revoked' stamped, expires_at moved into the past (packages/plugins/plugin-auth/src/session-tombstone.ts#INTERACTIVE_REVOKE_REASON) — whereas sign-out deletes it, so use the revoke. Confirm the unfiltered sys_session count now exceeds the live-predicate count, then reload the board. THEN establish ground truth via the data API: a count aggregate on sys_user, and a count aggregate on sys_session restricted to LIVE sessions (revoked_at is null AND expires_at after now — the Active Sessions widget's own filter), recording both numbers and the unfiltered sys_session count",
"read the rendered value of widget_total_users (Total Users) and widget_active_sessions (Active Sessions) from the DOM (only after the screenshot confirmed render) and compare each to its API count",
Expand Down Expand Up @@ -1028,7 +1028,7 @@
"source": [
"packages/platform-objects/src/apps/dashboards/system_overview.dashboard.ts#requiresService (9 widget ids; requiresService / requiresObject gates; widget_active_sessions' live-session filter, #7531; the Row 2 note on the removed Permission Changes tile; globalFilters date range) + packages/rest/src/meta-item-read-gate.ts#filterDashboardForUser (the server strip of an unmet requiresService widget, ADR-0057 D10)",
"packages/platform-objects/src/apps/dashboards/system.datasets.ts (the five sys_*_metrics datasets and their count measures)",
"packages/platform-objects/src/apps/setup-nav.contributions.ts#nav_system_overview (nav_system_overview → dashboard system_overview in the Setup app)"
"packages/platform-objects/src/apps/setup.app.ts#nav_system_overview (nav_system_overview → dashboard system_overview, pinned at the top of the Setup app)"
],
"history": [
{
Expand Down
9 changes: 9 additions & 0 deletions packages/spec/authorable-surface/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"ui/ActionNavItem:dataSource",
"ui/ActionNavItem:icon",
"ui/ActionNavItem:id",
"ui/ActionNavItem:keywords",
"ui/ActionNavItem:label",
"ui/ActionNavItem:order",
"ui/ActionNavItem:requiredPermissions",
Expand Down Expand Up @@ -315,6 +316,7 @@
"ui/ComponentNavItem:dataSource",
"ui/ComponentNavItem:icon",
"ui/ComponentNavItem:id",
"ui/ComponentNavItem:keywords",
"ui/ComponentNavItem:label",
"ui/ComponentNavItem:order",
"ui/ComponentNavItem:params",
Expand Down Expand Up @@ -357,6 +359,7 @@
"ui/DashboardNavItem:dataSource",
"ui/DashboardNavItem:icon",
"ui/DashboardNavItem:id",
"ui/DashboardNavItem:keywords",
"ui/DashboardNavItem:label",
"ui/DashboardNavItem:order",
"ui/DashboardNavItem:requiredPermissions",
Expand Down Expand Up @@ -447,6 +450,7 @@
"ui/DocNavItem:doc",
"ui/DocNavItem:icon",
"ui/DocNavItem:id",
"ui/DocNavItem:keywords",
"ui/DocNavItem:label",
"ui/DocNavItem:order",
"ui/DocNavItem:requiredPermissions",
Expand Down Expand Up @@ -701,6 +705,7 @@
"ui/GroupNavItem:expanded",
"ui/GroupNavItem:icon",
"ui/GroupNavItem:id",
"ui/GroupNavItem:keywords",
"ui/GroupNavItem:label",
"ui/GroupNavItem:order",
"ui/GroupNavItem:renamedFrom",
Expand Down Expand Up @@ -1076,6 +1081,7 @@
"ui/ObjectNavItem:filters",
"ui/ObjectNavItem:icon",
"ui/ObjectNavItem:id",
"ui/ObjectNavItem:keywords",
"ui/ObjectNavItem:label",
"ui/ObjectNavItem:objectName",
"ui/ObjectNavItem:order",
Expand Down Expand Up @@ -1178,6 +1184,7 @@
"ui/PageNavItem:dataSource",
"ui/PageNavItem:icon",
"ui/PageNavItem:id",
"ui/PageNavItem:keywords",
"ui/PageNavItem:label",
"ui/PageNavItem:order",
"ui/PageNavItem:pageName",
Expand Down Expand Up @@ -1358,6 +1365,7 @@
"ui/ReportNavItem:dataSource",
"ui/ReportNavItem:icon",
"ui/ReportNavItem:id",
"ui/ReportNavItem:keywords",
"ui/ReportNavItem:label",
"ui/ReportNavItem:order",
"ui/ReportNavItem:reportName",
Expand Down Expand Up @@ -1399,6 +1407,7 @@
"ui/UrlNavItem:dataSource",
"ui/UrlNavItem:icon",
"ui/UrlNavItem:id",
"ui/UrlNavItem:keywords",
"ui/UrlNavItem:label",
"ui/UrlNavItem:order",
"ui/UrlNavItem:requiredPermissions",
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/docs/references/api/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const result = AppDefinitionResponseSchema.parse(data);
| **isDefault** | `boolean` | optional (default: `false`) | Is default app |
| **hidden** | `boolean` | optional | Hide from the App Switcher; the shell surfaces hidden apps via the avatar menu instead (navigation only — never an access gate) |
| **_unpublished** | `boolean` | optional | Machine-managed publish gate (ADR-0045 §3) — true = unpublished, externally unobservable. Written by AI materialization, cleared by publish-drafts. Never authored. |
| **navigation** | `({ id: string; label?: string \| Record<string, string>; icon?: string; order?: number; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | optional | Full navigation tree for the app sidebar |
| **navigation** | `({ id: string; label?: string \| Record<string, string>; keywords?: string[]; icon?: string; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | optional | Full navigation tree for the app sidebar |
| **areas** | `{ id: string; label: string \| Record<string, string>; icon?: string; description?: string \| Record<string, string>; … }[]` | optional | Navigation areas for partitioning navigation by business domain |
| **contextSelectors** | `{ id: string; label: string \| Record<string, string>; icon?: string; optionsSource: object; … }[]` | optional | App-level scope dropdowns whose value is injected into nav items as `{<id>}` template vars |
| **landing** | `{ item: string; visible: string \| object }[]` | optional | Per-audience landing: the first entry whose `visible` (CEL) holds for the reader names the navigation entry (`item`, an `id` of this app's own `navigation` or `areas[].navigation`) the app opens on; an entry whose `item` the reader's own navigation gates hide, or whose `visible` faults, is passed over. An `item` that names no entry of this app, or a `group` / `separator` / `action` / `url` entry, is refused at parse. No match, or no key: the app opens on its first navigation item by `order`, as before. |
Expand Down
8 changes: 4 additions & 4 deletions packages/spec/docs/references/api/package-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ 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. 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. |
| **group** | `string` | optional | Target group nav-item id to append into (e.g. "group_integrations_dev"); 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 |
| **items** | `({ id: string; label?: string \| Record<string, string>; keywords?: string[]; icon?: string; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Navigation items contributed into the target app/group |

### Nested Shape: `PackageInstallBody[option 2].engine`

Expand Down Expand Up @@ -370,9 +370,9 @@ 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. 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. |
| **group** | `string` | optional | Target group nav-item id to append into (e.g. "group_integrations_dev"); 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 |
| **items** | `({ id: string; label?: string \| Record<string, string>; keywords?: string[]; icon?: string; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Navigation items contributed into the target app/group |

### Nested Shape: `PackageInstallManifest.engine`

Expand Down
4 changes: 2 additions & 2 deletions packages/spec/docs/references/kernel/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ 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. 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. |
| **group** | `string` | optional | Target group nav-item id to append into (e.g. "group_integrations_dev"); 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 |
| **items** | `({ id: string; label?: string \| Record<string, string>; keywords?: string[]; icon?: string; … } \| { type: 'separator'; id?: string; order?: number } \| … +8 more)[]` | ✅ | Navigation items contributed into the target app/group |

### Nested Shape: `Manifest.engine`

Expand Down
Loading
Loading