Overview
The profile page at app/profile/[userId]/page.tsx is read-only. There is no way for users to edit their own profile, change avatar, update bio, or configure notification preferences. Add a /settings route where authenticated users can manage their own data.
Goals
- Allow authenticated users to edit name, bio, avatar URL, and social links
- Allow users to set notification preferences (in-app vs. email, frequency)
- Allow users to disconnect their wallet (with a confirmation dialog)
- Surface validation errors inline
Implementation Details
1. Settings route and tabs
Create: app/settings/page.tsx
- Tabs:
Profile, Notifications, Wallet, Danger Zone
- Server-side guard: redirect to sign-in if unauthenticated
- Pull current user via
authClient.useSession() and a useMe() query
2. Profile tab
Create: components/settings/profile-tab.tsx
- Avatar uploader (or URL input)
- Display name, bio (rich text or markdown editor)
- Social links (GitHub, Twitter, personal site)
- Save via
useUpdateUserMutation (add to hooks/use-user-mutations.ts)
3. Notifications tab
Create: components/settings/notifications-tab.tsx
- Per-event-type toggles (in-app, email)
- Email digest cadence (off, daily, weekly)
- Persist to backend via mutation
4. Wallet tab
- Show connected wallet address
- "Disconnect Wallet" button with
AlertDialog confirmation
5. Danger zone
- "Delete account" button with double-confirm
- Wired to a
useDeleteAccountMutation (placeholder if backend not ready)
Files Affected
Created
app/settings/page.tsx
components/settings/profile-tab.tsx
components/settings/notifications-tab.tsx
components/settings/wallet-tab.tsx
components/settings/danger-zone-tab.tsx
hooks/use-user-mutations.ts
Acceptance Criteria
Additional Notes
- Optimistic update on save; rollback on error
- Keep this consistent with the existing dialog/form patterns elsewhere in the app
Overview
The profile page at
app/profile/[userId]/page.tsxis read-only. There is no way for users to edit their own profile, change avatar, update bio, or configure notification preferences. Add a/settingsroute where authenticated users can manage their own data.Goals
Implementation Details
1. Settings route and tabs
Create:
app/settings/page.tsxProfile,Notifications,Wallet,Danger ZoneauthClient.useSession()and auseMe()query2. Profile tab
Create:
components/settings/profile-tab.tsxuseUpdateUserMutation(add tohooks/use-user-mutations.ts)3. Notifications tab
Create:
components/settings/notifications-tab.tsx4. Wallet tab
AlertDialogconfirmation5. Danger zone
useDeleteAccountMutation(placeholder if backend not ready)Files Affected
Created
app/settings/page.tsxcomponents/settings/profile-tab.tsxcomponents/settings/notifications-tab.tsxcomponents/settings/wallet-tab.tsxcomponents/settings/danger-zone-tab.tsxhooks/use-user-mutations.tsAcceptance Criteria
/settingsis reachable only by authenticated usersAdditional Notes