Skip to content

feat: Add escrow template creation & management system#462

Merged
Cedarich merged 1 commit into
StayLitCodes:mainfrom
swankybae:feature/escrow-enhancements-v2
Jun 30, 2026
Merged

feat: Add escrow template creation & management system#462
Cedarich merged 1 commit into
StayLitCodes:mainfrom
swankybae:feature/escrow-enhancements-v2

Conversation

@swankybae

Copy link
Copy Markdown
Contributor

Description

This PR implements three major enhancements to the escrow system:

  1. Escrow Template Creation & Management:

    • Built-in templates (Freelance Payment, Product Purchase, Service Agreement, Custom)
    • Custom template storage in localStorage
    • Template CRUD operations via /settings/templates page
    • Recent used templates in selection screen
  2. Centralized Toast Notification System:

    • Success/Error/Info/Warning variants with distinct icons/colors
    • Queue management (max 3 visible toasts)
    • Deduplication of identical messages within 5 seconds
    • Persistent error toasts, 5s auto-dismiss for others
    • Action button support in toasts
    • "Dismiss All" button when ≥2 toasts are visible
    • Accessibility (keyboard dismiss, ARIA labels)
    • All alert() calls replaced with toasts
  3. Deadline Countdown Timer:

    • Real-time countdown with days/hours/minutes/seconds
    • Color-coded urgency: Green (>48h), Yellow (24-48h), Red (<24h), Expired
    • Updates every second when <1h, every minute otherwise
    • "Request Refund" button for expired escrows
    • Full datetime with user timezone on hover
    • Countdown pauses during disputes
    • Browser notifications at 24h and 1h warnings
    • Handles already-expired escrows on page load

Files Modified

  • New: apps/frontend/lib/templates.ts
  • New: apps/frontend/hooks/useTemplates.ts
  • New: apps/frontend/components/escrow/create/TemplateSelector.tsx
  • New: apps/frontend/app/settings/templates/page.tsx
  • New: apps/frontend/hooks/useCountdown.ts
  • New: apps/frontend/hooks/useCountdown.test.ts
  • New: apps/frontend/components/escrow/CountdownTimer.tsx
  • Modified: apps/frontend/app/contexts/ToastContext.tsx
  • Modified: apps/frontend/app/contexts/ToastProvider.tsx
  • Modified: apps/frontend/components/ui/Toast.tsx
  • Modified: apps/frontend/components/ui/ToastContainer.tsx
  • Modified: apps/frontend/hooks/useToast.ts
  • Modified: apps/frontend/components/escrow/CreateEscrowWizard.tsx
  • Modified: apps/frontend/components/escrow/detail/EscrowHeader.tsx
  • Modified: apps/frontend/components/escrow/detail/file-dispute-modal.tsx
  • Modified: apps/frontend/components/escrow/detail/ArbitratorResolutionModal.tsx
  • Modified: apps/frontend/components/settings/ApiKeyManager.tsx
  • Modified: apps/frontend/app/settings/page.tsx
  • Modified: apps/frontend/lib/escrow-api.ts

Acceptance Criteria Met

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@swankybae 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

@Cedarich Cedarich merged commit 1158375 into StayLitCodes:main Jun 30, 2026
1 check 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

2 participants