Skip to content

Conversation

@Ranelkin
Copy link

@Ranelkin Ranelkin commented Feb 1, 2026

  • Created minimal TimeReportPDF component that renders time report with "@react-pdf/renderer";
    • Added dependencies for PDF creation to src/routes/time-tracking/reports.tsx
  • Made button in src/routes/time-tracking/reports.tsx create a blob downloadable pdf from TimeReportPDF component

@madisvain
Copy link
Owner

Hi @Ranelkin! Thank you for putting this together — the time report PDF export is a great feature idea and exactly what we needed. 🙏

After reviewing your implementation, we decided to take a slightly different approach for the PDF generation backend. Instead of using @react-pdf/renderer on the frontend, we've moved PDF rendering to the Rust side using Typst as a Tauri sidecar binary.

The output is the same — a clean PDF with the time report title, date range, optional client name, and the grouped entries table (Name, Entries, Total Time). The key advantages of the Typst approach are:

  • Better architectural fit — since Upcount is a Tauri/Rust project, keeping PDF generation on the backend feels more natural and keeps the frontend focused on UI
  • Configurable templates — Typst templates are plain .typ text files, which makes it easy for developers (and eventually users) to customize the PDF layout without modifying application code
  • Multiple template support — we plan to expand this to also support invoice PDF generation, with the possibility of user-selectable templates for different document types
  • Simpler frontend — the React code just calls invoke() with the data and a file path; no need for PDF-specific React components or font loading on the JS side

The implementation is in #209 if you'd like to take a look. Your PR was the catalyst for getting this done, so thank you again for the contribution and the motivation!

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.

2 participants