From 772361229675bef1e94d2b8aa974476a7d57d7e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 15:13:51 +0000 Subject: [PATCH] docs(skills): teach the approvals inbox nav entry gated on the approvals service, not requiresObject The objectstack-ui navigation rule and its eval taught the approvals entry as an object item gated by requiresObject: 'sys_approval_request', which hides it from non-admin approvers until a request involves them. Teach the Account app's shape instead: type 'component', componentRef 'approvals:inbox', requiresService 'approvals'. Claude-Session: https://claude.ai/code/session_01FEkQ5kCq2ZxdEfiiXADAhS Co-Authored-By: Claude --- .changeset/33235-skills-approvals-inbox-nav-gate.md | 10 ++++++++++ .../objectstack-ui/evals/views-apps-actions-pages.json | 6 +++--- skills/objectstack-ui/rules/navigation.md | 6 +++--- 3 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changeset/33235-skills-approvals-inbox-nav-gate.md diff --git a/.changeset/33235-skills-approvals-inbox-nav-gate.md b/.changeset/33235-skills-approvals-inbox-nav-gate.md new file mode 100644 index 00000000000..ac161fa0ed1 --- /dev/null +++ b/.changeset/33235-skills-approvals-inbox-nav-gate.md @@ -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. diff --git a/skills/objectstack-ui/evals/views-apps-actions-pages.json b/skills/objectstack-ui/evals/views-apps-actions-pages.json index 92f33473388..9dc8244668b 100644 --- a/skills/objectstack-ui/evals/views-apps-actions-pages.json +++ b/skills/objectstack-ui/evals/views-apps-actions-pages.json @@ -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'"] } }, { diff --git a/skills/objectstack-ui/rules/navigation.md b/skills/objectstack-ui/rules/navigation.md index fade08b84d3..d7952a24ec7 100644 --- a/skills/objectstack-ui/rules/navigation.md +++ b/skills/objectstack-ui/rules/navigation.md @@ -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' }, ], }, ],