Skip to content

feat: invoice share context, CSV trim, duplicate rename, export date-… - #646

Open
cyberpunk30 wants to merge 1 commit into
Stellar-split:mainfrom
cyberpunk30:feat/601-604-modal-improvements
Open

feat: invoice share context, CSV trim, duplicate rename, export date-…#646
cyberpunk30 wants to merge 1 commit into
Stellar-split:mainfrom
cyberpunk30:feat/601-604-modal-improvements

Conversation

@cyberpunk30

Copy link
Copy Markdown

Title:

feat: invoice share context, CSV trim, duplicate rename, export date-range

Body:

Closes #601
Closes #602
Closes #603
Closes #604

Summary

Implements four independent UI/UX improvements across the invoice modals.


#601 — InvoiceShareQRModal: show invoice context in header

The modal header was context-free. Added two optional props (invoiceTitle, totalAmount) so
callers can pass invoice details directly into the modal. The header now renders:

  • Invoice title (falls back to Invoice #<id> when absent)
  • Total amount + currency below the title
  • "Share via QR Code" as a subtitle

All header text uses truncate so it degrades gracefully on narrow viewports.

File: src/components/InvoiceShareQRModal.tsx


#602 — CsvRecipientImport: trim whitespace before validation

CSV exports from spreadsheet tools often include leading/trailing spaces in address cells,
causing silent validation failures. Fixed in two places:

  • parseCsv: each field (address, percentage, amount) is now explicitly trimmed after
    column extraction.
  • handleUpdateRow: inline-edited values are trimmed before re-running validation.

Genuinely malformed addresses still produce the "Invalid Stellar address" error as before.

File: src/components/CsvRecipientImport.tsx


#603 — DuplicateModal: editable name field

The duplicate was always created with an auto-generated name (Copy of Invoice #<id>) and no way
to change it before saving. Added:

  • A text input pre-filled with the auto-generated name
  • Trim + empty-string validation with an accessible inline error (role="alert")
  • onConfirm signature updated to (name: string, deadlineIso: string)

File: src/components/DuplicateModal.tsx


#604 — ExportModal + API: date-range picker with defaults

Exporting all invoices with no date constraint was impractical for long-running accounts.
Changes:

  • From defaults to 30 days ago, To defaults to today (YYYY-MM-DD)
  • Each picker has a visible label ("From" / "To")
  • Client-side validation blocks export and shows an inline error when From > To
  • The apiFetch call now appends ?from=...&to=... query params
  • The API route reads those query params, merges them into the filter options (overriding body
    values), and returns 400 if from > to

Files: src/components/ExportModal.tsx, src/app/api/invoices/export/route.ts


Testing

  • All existing tests continue to pass (no test logic was modified)
  • Each acceptance criterion from the four issues is satisfied

The Closes #601Closes #604 lines will auto-close all four issues when the PR is merged on
GitHub.

…range (Stellar-split#601 Stellar-split#602 Stellar-split#603 Stellar-split#604)

- Stellar-split#601 InvoiceShareQRModal: add invoiceTitle and totalAmount props to header;
  falls back to 'Invoice #<id>' when title is absent; text truncates on narrow viewports
- Stellar-split#602 CsvRecipientImport: trim leading/trailing whitespace from all CSV fields
  before validation; also trim inline-edited values in handleUpdateRow so
  spreadsheet export artifacts no longer cause silent import failures
- Stellar-split#603 DuplicateModal: add editable name field pre-filled with
  'Copy of Invoice #<id>'; trims whitespace, rejects empty string with inline
  error; onConfirm signature updated to (name, deadlineIso)
- Stellar-split#604 ExportModal: From defaults to 30 days ago, To defaults to today;
  From/To labels added to pickers; validates From <= To before export with
  inline error; passes from/to as query params to the API route
- Stellar-split#604 export/route.ts: read from/to query params, merge into filters,
  return 400 when from > to
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@cyberpunk30 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 Aug 28, 2026

Copy link
Copy Markdown

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