📌 Description
InvoicesTab (src/features/settings/components/billing/InvoicesTab.tsx) has a handleDownloadInvoice() that sets link.href = '#' and never downloads a real PDF, with no error handling and a table that overflows on mobile.
💡 Why it matters: Users click "Download" and nothing usable happens.
🧩 Requirements and context
- Fetch the real invoice file from the API and trigger a download.
- Show a loading state on the row and an error message on failure.
- Make the invoice table responsive on small screens.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b fix/invoices-download
2. Implement changes
- Write/modify the relevant source:
src/features/settings/components/billing/InvoicesTab.tsx
- Write comprehensive tests:
src/features/settings/components/billing/InvoicesTab.test.tsx
- Add documentation: inline TSDoc
- Include TSDoc doc comments
- Validate security assumptions: use object URLs and revoke them
3. Test and commit
- Cover edge cases: download success, download error, mobile layout
- Include test output and security notes in the PR description.
Example commit message
fix(billing): real invoice download with error handling
✅ Acceptance criteria
🔒 Security notes
Create and revoke object URLs; never trust unsanitized filenames.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
InvoicesTab(src/features/settings/components/billing/InvoicesTab.tsx) has ahandleDownloadInvoice()that setslink.href = '#'and never downloads a real PDF, with no error handling and a table that overflows on mobile.🧩 Requirements and context
Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/features/settings/components/billing/InvoicesTab.tsxsrc/features/settings/components/billing/InvoicesTab.test.tsx3. Test and commit
npm run testExample commit message
✅ Acceptance criteria
🔒 Security notes
Create and revoke object URLs; never trust unsanitized filenames.
📋 Guidelines