Skip to content

Commit 2ba560a

Browse files
os-zhuangclaude
andauthored
fix(plugin-approvals): give decision actions a visual hierarchy (objectui#2762 P1-5) (#3437)
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 Claude-Session: https://claude.ai/code/session_01Cu48mLFUdRBmMh8Z8R3CVz Co-authored-by: Claude <noreply@anthropic.com>
1 parent af5a224 commit 2ba560a

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@objectstack/plugin-approvals": patch
3+
---
4+
5+
fix(plugin-approvals): give the decision actions a visual hierarchy (objectui#2762 P1-5)
6+
7+
The `sys_approval_request` decision actions all declared as equal-weight
8+
buttons, so the drawer's action bar rendered five identical outlined
9+
buttons with no emphasis on the primary path. `approval_approve` now
10+
declares `variant: 'primary'` and `approval_reject` declares
11+
`variant: 'danger'`, so a metadata-driven renderer highlights Approve and
12+
styles Reject as destructive — matching the hierarchy the mobile card
13+
already has. Pure metadata; the secondary levers stay unstyled (tertiary).

packages/plugins/plugin-approvals/src/sys-approval-request.object.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ export const SysApprovalRequest = ObjectSchema.create({
247247
name: 'approval_approve',
248248
label: 'Approve',
249249
icon: 'check-circle',
250+
// Primary decision — the console renders this filled/highlighted so it
251+
// stands out from the secondary levers in the drawer's action bar,
252+
// matching the mobile card hierarchy (objectui#2762 P1-5).
253+
variant: 'primary',
250254
type: 'api',
251255
method: 'POST',
252256
target: '/api/v1/approvals/requests/{id}/approve',
@@ -266,6 +270,9 @@ export const SysApprovalRequest = ObjectSchema.create({
266270
name: 'approval_reject',
267271
label: 'Reject',
268272
icon: 'x-circle',
273+
// Destructive decision — rendered in the console's danger styling so it
274+
// reads as the irreversible action it is (objectui#2762 P1-5).
275+
variant: 'danger',
269276
type: 'api',
270277
method: 'POST',
271278
target: '/api/v1/approvals/requests/{id}/reject',

0 commit comments

Comments
 (0)