Settings Live
Account, preferences, notifications, feedback, and external links (About KA26 → ka-26.com).
1. Overview
Single-page list with grouped cards: Account (Edit Profile, QR), Language (multi-language toggle), Notifications (enable / status), Feedback (form), About KA26 (external link to landing site), Logout.
2. User journey
- Profile → Settings cog (or directly via
/settings) - Tap any card to navigate
- Logout shows a confirmation dialog
3. Web ↔ Mobile parity
| Capability | Web | Mobile |
|---|---|---|
| Edit Profile | ✅ links to Profile section | ✅ |
| QR Code | ✅ | ✅ |
| Language picker (6 languages) | ✅ | ✅ |
| Notifications toggle | ✅ enable button (web push) | ✅ enable button (Expo push) |
| Feedback form | ✅ inline | ✅ separate screen feedback.tsx |
| About KA26 → ka-26.com | ✅ | ✅ uses Linking.openURL |
| Logout | ✅ | ✅ |
4. Key components
- Web:
src/app/(consumer)/settings/page.tsx(~520 lines, 3 views: main, language, feedback) - Mobile:
mobile/app/settings.tsx,mobile/app/feedback.tsx,mobile/app/language.tsx,mobile/app/edit-profile.tsx,mobile/app/my-qr.tsx
5. APIs
| Endpoint | Method | Purpose |
|---|---|---|
/api/auth/consumer-profile | PUT | Update language, photo, etc. |
/api/feedback | POST | Submit feedback (sends email to admin via Email Infra) |
/api/auth/logout | POST | Clear server session (consumer is mostly client-side though) |
6. Database touchpoints
Consumer.language— preferred display languageFeedback— feedback submissions (type: bug/feature/general, page, description, expected, screenshot)PushSubscription— saved web/Expo push tokens
7. Business logic
- PWA permission flow: never auto-request notification permission (breaks iOS). Settings provides the explicit "Enable Notifications" button.
- Feedback PAGE_OPTIONS: Reels, Profile, Orders, Requests, Shop, Product Page, Settings, Notifications, Other. (Eats removed 2026-04-17.)
- Description max 5000 chars (
MAX_DESCRIPTIONconstant in settings). - Feedback emails: subject
[KA26 <type>] <page> — <userName>, sent via central email lib withreplyTo: feedback.userEmailso admin can reply directly.
8. Feature flags / env vars
EMAIL_ADMIN_ADDRESS— where feedback emails go (defaultsiddugkattimani@gmail.com)
9. Tests
tests/email-infrastructure.test.ts— feedback email pathmobile/tests/mobile-code-integrity.test.ts— feedback PAGE_OPTIONS, settings nav
10. Known gotchas
- About KA26 link uses
Linking.openURLon mobile (opens external browser). Don't change to in-app webview without considering the auth implications. - Language change re-renders the whole tree via
LanguageContext. Heavy on first switch. - Logout clears
localStorage(web) / SecureStore (mobile) but doesn't invalidate server-side JWT — JWTs are stateless, just expire on their own (7d for seller, 30d for delivery, indefinite for consumer).
11. Related
- Email Infrastructure — where Feedback emails go
- Notifications — push opt-in flow