Skip to content

Improve customer dashboard for lead recovery demo flow - #65

Merged
DevCalebR merged 2 commits into
mainfrom
dashboard-lead-recovery-redesign
May 23, 2026
Merged

Improve customer dashboard for lead recovery demo flow#65
DevCalebR merged 2 commits into
mainfrom
dashboard-lead-recovery-redesign

Conversation

@DevCalebR

@DevCalebR DevCalebR commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • improve the customer /app dashboard for lead-recovery demo flow and average job value setup
  • fix the customer /app/settings toll-free messaging compliance save path so toll-free verification can be saved without crashing the dashboard
  • keep A2P and toll-free compliance paths separate and truthful across settings, readiness, and admin setup views

Toll-free compliance save crash

Root cause

  • the customer settings action wrote toll-free compliance changes through a save path that did not validate the toll-free SID separately from A2P metadata
  • normal save failures were allowed to escape as uncaught server-action errors instead of being turned into user-facing form errors
  • Business.tollFreeVerificationSid was also modeled as globally unique, which is too strict for shared main-account toll-free verification data and could trigger a Prisma P2002 write failure

What was fixed

  • added shared Twilio compliance SID validation helpers and wired both customer and admin save actions to use them
  • made validation path-specific so toll-free saves do not require A2P customer profile, brand, or campaign SIDs
  • accepted BU-formatted toll-free verification SIDs and return friendly validation errors for invalid SID formats instead of crashing
  • wrapped normal Twilio settings persistence failures so the customer settings page redirects back with an error message instead of hitting the app error boundary
  • removed the global unique constraint from tollFreeVerificationSid and added a migration to drop the index
  • added a historical no-op migration placeholder so local Prisma migration history matches the recorded database state
  • updated readiness and setup tests to use real BU-style toll-free verification SIDs

Average job value and dashboard work from this PR

  • keep the /app home screen in a more action-first two-column layout with a right-rail setup card
  • standardize home-page demo/test CTAs to Test recovery flow
  • add Business.averageJobValueCents support so recovered revenue uses business-specific math instead of the fallback forever
  • keep sample/demo lead actions frontend-only and safe

Validation performed

  • npx prisma generate
  • npx prisma migrate deploy
  • npx prisma migrate status
  • npm run typecheck
  • npm run lint
  • npm test
  • npm run build
  • npm run vercel-build
  • focused test pass: npx tsx --test tests/twilio-compliance.test.ts tests/managed-twilio-status.test.ts tests/twilio-setup-flow.test.ts tests/admin-dashboard.test.ts
  • browser automation attempt to open /app/settings on local dev redirected to Clerk sign-in because the dashboard route is authenticated, so the protected save click could not be completed in automation without a signed-in session

Preview

@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
callbackcloser Ready Ready Preview, Comment May 23, 2026 1:50am

Request Review

@DevCalebR
DevCalebR merged commit f58fc26 into main May 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant