Open
Conversation
Set up infrastructure for Typst-based PDF generation as a Tauri sidecar binary. Adds shell plugin, capability permissions, externalBin and resource bundling config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Typst template renders a time report PDF with date range, optional client name, and a table of grouped time entries. Bundles Montserrat font files as Tauri resources. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Backend command that serializes report data to a temp JSON file, invokes the Typst sidecar to compile the template into a PDF, and cleans up. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the disabled Export button with a working handler that invokes the generate_time_report_pdf Tauri command via the Typst sidecar. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@react-pdf/rendererapproach (from Added minimal Time Report pdf component #207) with Typst as a Tauri sidecar binary for PDF generationgenerate_time_report_pdfTauri command that compiles a Typst template into a PDF with the time report dataWhy Typst?
Architecture
tauri.conf.jsonexternalBin(excluded from git, downloaded per-platform)src-tauri/resources/templates/time-report.typreads JSON data viasys.inputssrc-tauri/resources/fonts/generate_time_report_pdfincommands.rsserializes data to temp JSON, invokes Typst, returns resultinvoke("generate_time_report_pdf")with report data and file path from save dialogChanges
src-tauri/Cargo.toml— addedtauri-plugin-shellsrc-tauri/tauri.conf.json— addedexternalBin,resources,shell-capabilitysrc-tauri/capabilities/shell.json— sidecar permissionssrc-tauri/src/lib.rs— registered shell plugin and commandsrc-tauri/src/commands.rs—generate_time_report_pdfcommandsrc-tauri/resources/templates/time-report.typ— Typst templatesrc-tauri/resources/fonts/— Montserrat Regular, Medium, SemiBoldsrc/routes/time-tracking/reports.tsx— usesinvoke()instead of disabled buttonSetup
Contributors need to download the Typst binary for their platform:
Test plan
src-tauri/binaries/cargo checkinsrc-tauri/compiles successfullypnpm lintpassesSupersedes #207
🤖 Generated with Claude Code