Add a Print / PDF export button#4
Merged
Merged
Conversation
The @media print stylesheet already reduces a solved train to a clean spec sheet — summary line, best-row schematic, and results table, with the input panel, onboarding intro, and export controls hidden. There was no affordance for it, so a user had to reach for the browser's own print command. Add a "Print / PDF" button alongside Copy link / Copy JSON / Download CSV that calls window.print(); the browser dialog covers "Save as PDF" for free. The button carries data-export, so the existing print CSS hides it in the output. Closes #3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LegpdV1tMs2dUyzAd7tCzH
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.
What
Adds a Print / PDF button alongside Copy link / Copy JSON / Download CSV. It calls
window.print(), so the browser's dialog also covers "Save as PDF".Why
A print stylesheet (
@media printinapp.css) already turns a solved train into a clean spec sheet, but there was no visible affordance — a user had to know to reach for the browser's own print command.How
<button data-export="print">Print / PDF</button>in the export slot, wired towindow.print().data-export, it inherits the existing button styling and the print CSS hides.export-slot— so the button removes itself from the output. No CSS change needed.Verification
pnpm --filter @involute/web test— 34 passed, including a new test asserting the button opens the print dialog.pnpm --filter @involute/web build— clean.Closes #3
🤖 Generated with Claude Code
https://claude.ai/code/session_01LegpdV1tMs2dUyzAd7tCzH