Skip to content

Commit 8a6cecb

Browse files
os-zhuangclaude
andauthored
feat(app-showcase): restore page:card panels on My Work (#2068)
objectui #1815 fixed page:card-in-region (the layout div was shadowing the real renderer). Restore the My Work sidebar to use `page:card`: • a Shortcuts card (title + children list); • an admin-only Leadership card gated by `visible: user.email == …`. Both render title + body and the role gate hides for non-matching users. Browser-verified on :5181. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e7f6539 commit 8a6cecb

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

examples/app-showcase/src/pages/my-work.page.ts

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,31 @@ export const MyWorkPage: Page = {
5858
name: 'sidebar',
5959
width: 'small',
6060
components: [
61-
{ type: 'element:text', properties: { content: 'Shortcuts' } },
62-
{ type: 'element:text', properties: { content: '• Delivery Operations — org-wide KPI dashboard.' } },
63-
{ type: 'element:text', properties: { content: '• Approvals — items in review.' } },
64-
{ type: 'element:text', properties: { content: '• New Project (Wizard).' } },
65-
// Per-user rendering via `visible` on the signed-in user (now that the
66-
// renderer feeds `user` into the expression context). The first line
67-
// shows for the admin; the second is gated to a different email and
68-
// stays hidden — proving the gate, not just always-on rendering.
69-
{ type: 'element:text', properties: { visible: "user.email == 'admin@objectos.ai'", content: '✓ Admin-only note (visible: user.email == admin@objectos.ai)' } },
70-
{ type: 'element:text', properties: { visible: "user.email == 'nobody@example.com'", content: 'This must NOT appear (gated to a different user).' } },
61+
// Shortcuts in a page:card — children now render in a region
62+
// (the bare `page:card` key is no longer shadowed by the thin layout div).
63+
{
64+
type: 'page:card',
65+
properties: {
66+
title: 'Shortcuts',
67+
children: [
68+
{ type: 'element:text', properties: { content: 'Delivery Operations — org-wide KPI dashboard.' } },
69+
{ type: 'element:text', properties: { content: 'Approvals — items awaiting a decision.' } },
70+
{ type: 'element:text', properties: { content: 'New Project (Wizard) — stepped create.' } },
71+
],
72+
},
73+
},
74+
// Admin-only card — per-user rendering via `visible` on the signed-in
75+
// user (the renderer now feeds `user` into the expression context).
76+
{
77+
type: 'page:card',
78+
properties: {
79+
title: 'Leadership View',
80+
visible: "user.email == 'admin@objectos.ai'",
81+
children: [
82+
{ type: 'element:text', properties: { content: 'Admin-only — shown because user.email matches the card’s visible expression.' } },
83+
],
84+
},
85+
},
7186
],
7287
},
7388
],

0 commit comments

Comments
 (0)