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',