feat: Customize hub + roles editor, terminal logo, invite links

IA refactor and the custom-roles editor pass 11 left as data-only.

Customize hub:
- New /customize (admin/board) with a left section rail: Roles,
  Membership tiers, Areas, Invite codes, Onboarding.
- One focused module per panel under app/(app)/customize/panels/
  plus a shared card and types file. The client shell is ~75 lines;
  each panel is self-contained (smart separation of concerns).
- Settings slimmed to Space, Integrations, Webhooks. Removed the
  Roles/Tiers/Invites/Onboarding tabs and the Areas block from
  settings-client.tsx (~700 lines) and the matching fetches from
  settings/page.tsx. Dead props/state/types removed.
- Sidebar: added a Customize NavLink (admin/board).

Roles editor:
- Rename/recolor the five built-in roles (upsertRoleLabel) and full
  CRUD on custom org roles. Adds the read path the audit flagged as
  missing: lib/role-labels.ts (getRoleLabelMap/roleDisplayName) is
  consumed in (app)/layout.tsx so the sidebar shows the renamed role.

Logo:
- Reverted the brand mark to the terminal >_ glyph
  (components/brand-mark.tsx) on the landing nav/footer, onboarding
  header, and favicon (public/logo.svg). Removed the dead local
  IcoTerminal. AtlasLogo stays only on the resources project page.

Invite links:
- InvitesPanel has Copy code and Copy link (/signup?invite=CODE).
  signup reads ?invite= on mount, prefills the code, preselects join.

Deferred and tracked in HANDOFF: types/database.ts sync, renamed-role
display on the members table, splitting the still-large
settings-client.tsx, custom-role assignment UI.

266/266 tests pass. Production build clean; /customize, /onboarding,
slimmed /settings all in the route table. No migration this pass.
This commit is contained in:
Moheeb Zara
2026-05-15 16:03:52 -07:00
parent 30bba045f8
commit 71d5e243cf
21 changed files with 791 additions and 856 deletions
-66
View File
@@ -18,31 +18,6 @@ export default async function SettingsPage() {
const { data: integrations } = await supabase
.from('integrations').select('*').eq('space_id', member.space_id)
const { data: areas } = await supabase
.from('space_areas')
.select('id, code, name, icon, sort_order, is_archived')
.eq('space_id', member.space_id)
.order('sort_order', { ascending: true })
.order('name', { ascending: true })
const { data: tiers } = await supabase
.from('space_tiers')
.select('id, slug, name, description, monthly_price_cents, billing_cadence, is_system, is_archived, sort_order')
.eq('space_id', member.space_id)
.order('sort_order', { ascending: true })
const { data: invites } = await supabase
.from('space_invites')
.select('id, code, label, expires_at, max_uses, uses_count, is_enabled, created_at')
.eq('space_id', member.space_id)
.order('created_at', { ascending: false })
const { data: onboardingSteps } = await supabase
.from('space_onboarding_steps')
.select('id, step_key, step_type, title, body, config, is_enabled, is_required, is_system, sort_order')
.eq('space_id', member.space_id)
.order('sort_order', { ascending: true })
const isAdmin = member?.role === 'admin'
return (
@@ -51,47 +26,6 @@ export default async function SettingsPage() {
isAdmin={isAdmin}
integrations={integrations ?? []}
currentRole={member.role}
areas={(areas ?? []) as Array<{
id: string
code: string
name: string
icon: string | null
sort_order: number
is_archived: boolean
}>}
tiers={(tiers ?? []) as Array<{
id: string
slug: string
name: string
description: string | null
monthly_price_cents: number
billing_cadence: string
is_system: boolean
is_archived: boolean
sort_order: number
}>}
invites={(invites ?? []) as Array<{
id: string
code: string
label: string | null
expires_at: string | null
max_uses: number | null
uses_count: number
is_enabled: boolean
created_at: string
}>}
onboardingSteps={(onboardingSteps ?? []) as Array<{
id: string
step_key: string
step_type: 'welcome' | 'code_of_conduct' | 'profile' | 'payment' | 'content'
title: string
body: string | null
config: Record<string, unknown>
is_enabled: boolean
is_required: boolean
is_system: boolean
sort_order: number
}>}
/>
)
}