Skip to content

Add a Print / PDF export button#4

Merged
notadev99 merged 1 commit into
mainfrom
feat/print-pdf-button
Jul 24, 2026
Merged

Add a Print / PDF export button#4
notadev99 merged 1 commit into
mainfrom
feat/print-pdf-button

Conversation

@notadev99

Copy link
Copy Markdown
Owner

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 print in app.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

  • New <button data-export="print">Print / PDF</button> in the export slot, wired to window.print().
  • Because it carries 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.
  • Browser check (print media emulated on-screen), confirming the issue's acceptance criteria:
    • Output shows the summary line, best-row schematic, and results table; input panel + onboarding intro hidden.
    • Schematic prints at a sensible size (220px height, height-sized as before).
    • The button itself is hidden in the print output.

Closes #3

🤖 Generated with Claude Code

https://claude.ai/code/session_01LegpdV1tMs2dUyzAd7tCzH

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
@notadev99
notadev99 merged commit 4626516 into main Jul 24, 2026
1 check passed
@notadev99
notadev99 deleted the feat/print-pdf-button branch July 24, 2026 01:59
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.

Add a Print / Export as PDF action

1 participant