Skip to content

feat(frontend): settings tabs, user analytics, property map and toast system - #234

Merged
OsagieCynthia merged 1 commit into
Arbitra-Lab:devfrom
Yormee-103:feat/profile-analytics-map-toasts
Nov 24, 2026
Merged

OsagieCynthia merged 1 commit into
Arbitra-Lab:devfrom
Yormee-103:feat/profile-analytics-map-toasts

Conversation

@Yormee-103

Copy link
Copy Markdown
Contributor

Closes #151
Closes #156
Closes #150
Closes #149

All changes are in frontend/. New logic lives in small pure modules so it can be unit tested; UI is wired into the existing pages with minimal edits.

#151 Profile & Settings dashboard

  • SettingsPageClient now has Profile, Payments, Notifications, Security, Referrals tabs (accessible tablist with arrow-key navigation, /settings#security deep links). The existing cards moved under their tabs: Notifications (+ saved searches), Profile (Appearance, Language & Region), Security (password + the existing 2FA enable / disable / backup-code flow).
  • Profile: edit name and phone (validated), email read-only, explicit Save with an inline confirmation and a toast. Uses the same /api/profile calls as the existing profile page.
  • Payments: add, remove (inline confirm) and set default, against the existing /payment-methods endpoints. Only the last four digits are collected; anything longer is rejected client-side.
  • Referrals: shows the code with a copy button and stats from /referrals/code and /referrals/stats.
  • Saved searches: list, run and remove. They are stored on the device (no backend endpoint exists); a new Save search button on the properties page creates them.

#156 Analytics dashboard

  • New /user/analytics page (linked in the user sidebar) with Overview, Activity, Agreements, Payments, Reviews tabs, Recharts trend charts (properties viewed per month, payments per month), and Export CSV on each data tab. CSV export neutralises spreadsheet formulas (= + - @). Layout is responsive (grid breakpoints, scrollable tables, ResponsiveContainer).
  • Data: agreements from the existing useUserAgreements, payments from /payments, reviews from /reviews/user/:id. Properties viewed and saved searches have no server record, so they come from a small on-device activity log (lib/activity-log.ts). Applications sent is supported by the log but nothing records it yet, so it shows 0.

#150 Property map

  • Properties page gets a List / Map toggle. The map (Leaflet via next/dynamic, no SSR) shows a rent-price marker per listing; it reuses the page's existing filtered list, so price and amenity filters update the markers and the view re-fits to them.
  • Clicking a marker opens a details modal; on phones it is the existing BottomSheet (swipe down to close), on larger screens a dialog (Escape / outside click / button).
  • Listings without coordinates are skipped with a note. Marker HTML is escaped.

#149 Toast system

  • components/ui/toast.tsx: success / error / warning / info with icons and type styling, 5s default auto-dismiss, vertical stacking, click (or Enter/Space/Escape) closes. The existing notify.* API is unchanged and gains notify.warning.
  • lib/websocket/toast-events.ts maps real-time events to toasts, wired into use-realtime.ts: payment:completed (payment received), dispute:status (dispute opened / resolved / updated), escrow:released, appeal:submitted. Server text is never shown verbatim.

Notes for review

  • Prettier re-indented parts of SettingsPageClient.tsx where cards are now wrapped by tab conditionals, so that diff looks bigger than the logic change.
  • There is no backend endpoint for saved searches, activity, or a "recovery code regeneration"; the 2FA card keeps its existing behaviour (backup codes are shown at setup).
  • New unit tests (frontend/__tests__/lib/): toast-events, property-map, settings-stores (saved searches, activity log, payment methods, profile form) and user-analytics (aggregation, normalisation, CSV).

Verification: NOT run

As requested, no tests, type-check, lint or build were run (and dependencies are not installed on my machine, so none could be). That means pnpm run lint, pnpm exec tsc --noEmit, pnpm run build and pnpm run test from the repo's CLAUDE.md checklist are unverified; please rely on CI. The only tool run was Prettier (3.8.1) on the changed files. Likeliest places to need a fix: react-leaflet / Recharts typings, the ToastBar render-prop in toast.tsx, and the apiClient response typing in the new panels.

… system

- Arbitra-Lab#151: Settings dashboard with profile, payments, notifications, security and
  referrals tabs; payment methods and referrals use the existing backend
  endpoints, saved searches are managed on-device, 2FA stays in Security
- Arbitra-Lab#156: personal analytics dashboard (overview, activity, agreements, payments,
  reviews) with trend charts and CSV export
- Arbitra-Lab#150: Leaflet property map with rent-price markers, filter-aware markers,
  details modal and swipe-to-close bottom sheet on mobile
- Arbitra-Lab#149: toast system with success/error/warning/info types, icons, 5s
  auto-dismiss, stacking, click to close and real-time event toasts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@Yormee-103 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
arbitra Error Error Nov 23, 2026 8:19pm UTC

@OsagieCynthia
OsagieCynthia merged commit d4e5b83 into Arbitra-Lab:dev Nov 24, 2026
1 of 2 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 861b14fa Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants