From d860fdc4d26d0fc5a40a485c2a1733cfe0d6cc1b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 14:10:57 +0000 Subject: [PATCH] fix(plugin-approvals): give decision actions a visual hierarchy (objectui#2762 P1-5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit approval_approve declares variant:'primary' and approval_reject declares variant:'danger' so a metadata-driven renderer highlights Approve and styles Reject as destructive — the drawer action bar gains the hierarchy the mobile card already had. Pure metadata; secondary levers stay tertiary. Refs objectui#2762 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Cu48mLFUdRBmMh8Z8R3CVz --- .changeset/approval-action-hierarchy.md | 13 +++++++++++++ .../src/sys-approval-request.object.ts | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 .changeset/approval-action-hierarchy.md diff --git a/.changeset/approval-action-hierarchy.md b/.changeset/approval-action-hierarchy.md new file mode 100644 index 000000000..033237bce --- /dev/null +++ b/.changeset/approval-action-hierarchy.md @@ -0,0 +1,13 @@ +--- +"@objectstack/plugin-approvals": patch +--- + +fix(plugin-approvals): give the decision actions a visual hierarchy (objectui#2762 P1-5) + +The `sys_approval_request` decision actions all declared as equal-weight +buttons, so the drawer's action bar rendered five identical outlined +buttons with no emphasis on the primary path. `approval_approve` now +declares `variant: 'primary'` and `approval_reject` declares +`variant: 'danger'`, so a metadata-driven renderer highlights Approve and +styles Reject as destructive — matching the hierarchy the mobile card +already has. Pure metadata; the secondary levers stay unstyled (tertiary). diff --git a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts index 24551c981..bd0c1bbb8 100644 --- a/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts +++ b/packages/plugins/plugin-approvals/src/sys-approval-request.object.ts @@ -247,6 +247,10 @@ export const SysApprovalRequest = ObjectSchema.create({ name: 'approval_approve', label: 'Approve', icon: 'check-circle', + // Primary decision — the console renders this filled/highlighted so it + // stands out from the secondary levers in the drawer's action bar, + // matching the mobile card hierarchy (objectui#2762 P1-5). + variant: 'primary', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/approve', @@ -266,6 +270,9 @@ export const SysApprovalRequest = ObjectSchema.create({ name: 'approval_reject', label: 'Reject', icon: 'x-circle', + // Destructive decision — rendered in the console's danger styling so it + // reads as the irreversible action it is (objectui#2762 P1-5). + variant: 'danger', type: 'api', method: 'POST', target: '/api/v1/approvals/requests/{id}/reject',