Skip to content

Email validation, rate-limit feedback, rounding handler, and rich text editor - #540

Open
Almikefred wants to merge 4 commits into
Stellar-split:mainfrom
Almikefred:feature/email-validation-rate-limit-rounding-editor
Open

Email validation, rate-limit feedback, rounding handler, and rich text editor#540
Almikefred wants to merge 4 commits into
Stellar-split:mainfrom
Almikefred:feature/email-validation-rate-limit-rounding-editor

Conversation

@Almikefred

Copy link
Copy Markdown

Summary

This PR implements four critical features for invoice management: email validation with MX checking, rate-limit feedback with countdown timer, split amount rounding discrepancy resolution, and rich text notes editor with sanitization.

Changes

#498 — Recipient Email and Contact Validation

  • Added src/app/api/validate-email/route.ts for DNS MX record checking
  • Created useEmailValidation hook with 500ms debounce and 5-minute cache per domain
  • Added EmailField component with real-time validation feedback
  • Email validation errors show on blur, warnings for missing MX records, green checkmark for valid emails

#499 — Invoice Creation Rate-Limit Feedback UI

  • Created useInvoiceForm hook to handle 429 responses and countdown state management
  • Added RateLimitBanner component showing live countdown timer (updates every second)
  • Displays retry-after time extracted from headers or shows static message if absent

#500 — Split Amount Rounding Discrepancy Handler and Warning

  • Added resolveRounding function to useSplitCalculator that handles stroop rounding and redistributes discrepancies
  • Created SplitSummaryCard component showing warning when rounding adjustment applied
  • Added validateRecipientAmountSum to src/lib/stellar.ts for transaction validation
  • Comprehensive unit tests covering 3, 7, and 11 recipient splits

#501 — Rich Text Notes Editor for Invoice Description

  • Created NotesEditor component using Tiptap with StarterKit extension
  • Toolbar with bold, italic, bullet list, and link buttons (keyboard navigable)
  • Added htmlSanitizer utility for DOMPurify sanitization on input and output
  • Safe HTML rendering on public invoice pages

Test Coverage

  • Unit tests for rounding resolution across various recipient counts and percentage distributions

Notes

  • Email validation requires @tiptap/react, @tiptap/starter-kit, @tiptap/extension-link, and dompurify packages (to be installed separately)
  • All HTML output is sanitized with DOMPurify using allowlist for specific tags and attributes
  • Rate-limit countdown updates every second with proper cleanup of intervals

Closes #498, Closes #499, Closes #500, Closes #501

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Almikefred is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant