Skip to content

feat: add CSV invoice export#90

Open
nehayadav827 wants to merge 1 commit into
seetadev:mainfrom
nehayadav827:feature/csv-export
Open

feat: add CSV invoice export#90
nehayadav827 wants to merge 1 commit into
seetadev:mainfrom
nehayadav827:feature/csv-export

Conversation

@nehayadav827
Copy link
Copy Markdown

Summary

Adds CSV export support for invoices using @capacitor/filesystem.

This PR introduces a CSV export flow for the current SocialCalc invoice by parsing the serialized spreadsheet format and exporting it as a properly escaped CSV file for both PWA and hybrid/mobile environments.

Changes

Added

  • src/services/csvExportService.ts

    • Parses SocialCalc serialized spreadsheet content
    • Supports escaped values (\c, \n, \b)
    • Handles formula/result cell types (vt, vtf, vtc)
    • Generates properly escaped CSV rows and filenames

Updated

  • src/components/Menu/Menu.tsx

    • Added Export as CSV option to the existing ActionSheet
    • Added native/hybrid export support using @capacitor/filesystem
    • Added browser/PWA CSV download fallback
    • Updated toast dismissal handling to avoid reopening the Save As dialog after CSV export actions
  • package.json

    • Added @capacitor/filesystem
  • package-lock.json

    • Updated dependency lockfile

Acceptance Criteria Addressed

  • ✅ Invoices can be exported as CSV
  • ✅ Adds Capacitor plugin integration
  • ✅ Works across PWA and hybrid/mobile flows
  • ✅ Maintains existing Save / Save As behavior

Validation

Verified locally by:

  • testing CSV generation from SocialCalc invoice data
  • validating escaped commas, quotes, colons, and newline handling
  • validating formula/result cell parsing
  • running:
npm run build

Build completed successfully.

Screenshot

The screenshot below demonstrates successful CSV generation from serialized SocialCalc invoice data, including:

  • parsed invoice rows
  • formula result handling
  • escaped special characters
  • generated CSV filename output
Screenshot 2026-05-21 141156

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