From ca498d51631ce535f1bfd8bde58b58ce5730d842 Mon Sep 17 00:00:00 2001 From: Moheeb Zara Date: Sun, 17 May 2026 01:35:09 -0700 Subject: [PATCH] feat(ux): dashboard 'Needs your attention' strip (admin/board) Surfaces actionable exceptions above the KPI grid: members awaiting approval and unreconciled payments, each a deep link. Only renders for admin/board and only when there is something to act on (adds one count query, gated). --- app/(app)/dashboard/page.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/(app)/dashboard/page.tsx b/app/(app)/dashboard/page.tsx index b2ddbe0..65a9cd3 100644 --- a/app/(app)/dashboard/page.tsx +++ b/app/(app)/dashboard/page.tsx @@ -55,6 +55,7 @@ export default async function DashboardPage() { { data: openProposalsRaw }, { data: myVotesRaw }, { data: pendingIncidentsRaw }, + { count: unverifiedMembers }, ] = await Promise.all([ supabase.from('space_members').select('*', { count: 'exact', head: true }).eq('space_id', spaceId).eq('status', 'current'), supabase.from('tasks').select('*', { count: 'exact', head: true }).eq('space_id', spaceId).in('status', ['open', 'claimed', 'in_progress']), @@ -67,6 +68,9 @@ export default async function DashboardPage() { isAdminOrBoard ? supabase.from('incidents').select('*').eq('space_id', spaceId).in('status', ['received', 'under_review']).order('created_at', { ascending: false }).limit(5) : Promise.resolve({ data: [] as unknown[] }), + isAdminOrBoard + ? supabase.from('space_members').select('*', { count: 'exact', head: true }).eq('space_id', spaceId).eq('status', 'unverified') + : Promise.resolve({ count: 0 }), ]) const votedProposalIds = new Set( @@ -177,6 +181,24 @@ export default async function DashboardPage() {
+ {isAdminOrBoard && ((unverifiedMembers ?? 0) > 0 || (unlinkedPayments ?? 0) > 0) && ( +
+

Needs your attention

+
+ {(unverifiedMembers ?? 0) > 0 && ( + + {unverifiedMembers} member{unverifiedMembers === 1 ? '' : 's'} awaiting approval → + + )} + {(unlinkedPayments ?? 0) > 0 && ( + + {unlinkedPayments} unreconciled payment{unlinkedPayments === 1 ? '' : 's'} → + + )} +
+
+ )} +
{stats.map(({ label, value, Ico, sub, warn }) => (