In-app notification inbox, consolidate /profile into /me, theme realign

In-app notification center (Phase 5, migration 051):
- notifications.read_at + partial unread index. /me Notifications is now
  an inbox: unread styling, click to expand the message + mark read,
  "mark all as read", unread count. markNotificationsRead is a service-
  client write scoped to the caller's own member_id. Always-on channel:
  email-muted ('skipped') notifications still appear in-app.

Consolidate /profile into /me:
- Delete app/(app)/profile/*; /me is the single member page. Port the
  conflict-of-interest privileged-role nudge + last-disclosed date into
  /me's profile editor. Remove the "My profile" sidebar + command-palette
  entries; rename the /me nav label to "My membership". Repoint the
  recruitment empty-state link to /me.

Theme realign:
- Revert the rounded-lg cards introduced in the prior /me visual pass to
  rounded (the app norm, matching the former /profile). Route /me section
  headers through the SectionTitle primitive.

Regression guard:
- integration/auth-embed.test.ts runs the auth layout's
  space_members.select('*, spaces(*)') embed through PostgREST and fails
  on PGRST201, so a future junction table cannot silently break auth again.
This commit is contained in:
Moheeb Zara
2026-05-19 22:51:44 -07:00
parent a7d880d747
commit 5d153b4d68
20 changed files with 319 additions and 380 deletions
+5 -1
View File
@@ -29,7 +29,7 @@ export default async function MePage() {
const { data: member } = await supabase
.from('space_members')
.select(
'id, space_id, role, email, display_name, handle, phone, bio, skills, interests, willing_to, affiliations',
'id, space_id, role, email, display_name, handle, phone, bio, skills, interests, willing_to, affiliations, coi_last_disclosed_at',
)
.eq('user_id', user.id)
.in('status', ['current', 'unverified', 'late'])
@@ -59,6 +59,8 @@ export default async function MePage() {
interests: (member.interests as string[] | null) ?? [],
willing_to: (member.willing_to as string[] | null) ?? [],
affiliations: (member.affiliations as string[] | null) ?? [],
isPrivileged: ['admin', 'board', 'treasurer'].includes(member.role as string),
coiLastDisclosed: (member.coi_last_disclosed_at as string | null) ?? null,
}
const { data: grantsRaw } = await supabase
@@ -119,6 +121,7 @@ export default async function MePage() {
const notifsRes = await getMyNotifications()
const notifs: MyNotif[] = 'data' in notifsRes ? (notifsRes.data as MyNotif[]) : []
const unreadNotifs = 'unreadCount' in notifsRes ? notifsRes.unreadCount : 0
const notifPrefsRes = await getMyNotificationPreferences()
const notifPrefs: PrefMap = 'data' in notifPrefsRes ? notifPrefsRes.data : {}
@@ -140,6 +143,7 @@ export default async function MePage() {
duesMethods={duesMethods}
payments={payments}
notifs={notifs}
unreadNotifs={unreadNotifs}
notifPrefs={notifPrefs}
classSignups={classSignups}
reservations={reservations}