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
10 changes: 10 additions & 0 deletions .changeset/33235-skills-approvals-inbox-nav-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/skills': patch
---

docs(skills): the navigation rule teaches the approvals inbox entry the way the platform's Account app writes it, gated on the approvals service

Clause-②: no
Metadata-protocol: none

`objectstack-ui`'s navigation rule taught the approvals entry as a `type: 'object'` item on `sys_approval_request` gated by `requiresObject: 'sys_approval_request'`. An app that copied it hid the entry from every non-administrator approver until some approval request already involved them: the object metadata read answers 404 to them until then, and the console prunes a `requiresObject` entry against the objects it is served. The rule now teaches the inbox component, `{ type: 'component', componentRef: 'approvals:inbox', requiresService: 'approvals' }` (the shape of `nav_account_approvals` in `@objectstack/platform-objects`), which the server keeps in the served navigation whenever plugin-approvals registers its `approvals` service, and says in one line why `requiresObject` is wrong here. The matching eval expects the same shape. No schema or runtime change.
6 changes: 3 additions & 3 deletions skills/objectstack-ui/evals/views-apps-actions-pages.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
{
"id": 2,
"prompt": "Build `src/apps/crm.app.ts`: a Sales group with Leads, Opportunities, the pipeline kanban, a 'My open deals' entry and the sales dashboard; an Approvals group that only shows when approvals are installed; and a second app for the support team, who work the same objects.",
"expected_output": "`App.create({...})` with a `navigation` tree of `group` items: `type: 'object'` entries with `objectName`, a `viewName: 'pipeline_kanban'` shortcut, a bare `filters: { owner_id: '{current_user_id}', status: 'open' }` slice for 'My open deals' (no view authored for a one-off), `type: 'dashboard'` with `dashboardName`, and `requiresObject: 'sys_approval_request'` on the approvals item. At most one app per package, so not a second `App.create` here: the support team shares this product and its objects, so it is a `requiredPermissions`-gated group inside the app. (A support product with objects of its own would carry its app in its own `type: 'module'` package of the suite.) Registered under `defineStack({ apps })`.",
"expected_output": "`App.create({...})` with a `navigation` tree of `group` items: `type: 'object'` entries with `objectName`, a `viewName: 'pipeline_kanban'` shortcut, a bare `filters: { owner_id: '{current_user_id}', status: 'open' }` slice for 'My open deals' (no view authored for a one-off), `type: 'dashboard'` with `dashboardName`, and the approvals inbox as `type: 'component', componentRef: 'approvals:inbox'` gated by `requiresService: 'approvals'` (never `requiresObject: 'sys_approval_request'`: that object read answers 404 to an approver until a request involves them). At most one app per package, so not a second `App.create` here: the support team shares this product and its objects, so it is a `requiredPermissions`-gated group inside the app. (A support product with objects of its own would carry its app in its own `type: 'module'` package of the suite.) Registered under `defineStack({ apps })`.",
"files": [],
"assertions": {
"must_contain": ["App.create", "navigation", "objectName", "viewName", "filters", "requiresObject", "requiredPermissions"],
"must_not_contain": ["\"path\":", "pageName"]
"must_contain": ["App.create", "navigation", "objectName", "viewName", "filters", "approvals:inbox", "requiresService", "requiredPermissions"],
"must_not_contain": ["\"path\":", "pageName", "requiresObject: 'sys_approval_request'"]
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions skills/objectstack-ui/rules/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const CrmApp = App.create({
{
id: 'group_approvals', type: 'group', label: 'Approvals', icon: 'check-circle',
children: [
// Reference system objects via `requiresObject` so the menu auto-hides
// when the capability is not installed.
{ id: 'nav_approval_requests', type: 'object', objectName: 'sys_approval_request', label: 'Approval Requests', icon: 'inbox', requiresObject: 'sys_approval_request' },
// The inbox component, gated on the approvals service. Not `requiresObject`:
// the object read answers 404 to approvers until a request involves them.
{ id: 'nav_approvals', type: 'component', componentRef: 'approvals:inbox', label: 'Approvals', icon: 'inbox', requiresService: 'approvals' },
],
},
],
Expand Down
Loading