Skip to content

feat(spa): export PDF via le bouton Imprimer du navigateur#40

Merged
sebdraven merged 3 commits into
mainfrom
feat/spa-print-pdf
May 15, 2026
Merged

feat(spa): export PDF via le bouton Imprimer du navigateur#40
sebdraven merged 3 commits into
mainfrom
feat/spa-print-pdf

Conversation

@sebdraven

Copy link
Copy Markdown
Member

Summary

Ajoute un export PDF "propre" au SPA sans dependance externe : un bouton dans le header declenche window.print(), et un bloc @media print transforme la matrice interactive sombre en un rapport noir-sur-blanc lineaire.

Comportement

  • Bouton PDF dans le header (a cote de la barre de recherche)
  • Au clic : window.print() -> dialog navigateur "Enregistrer en PDF"
  • En print :
    • Une phase par page (page-break entre DETECT/INFORM/MEMORISE/ACT)
    • Pour chaque technique, sa description complete + toutes les sections sont affichees inline (alors qu'a l'ecran elles n'apparaissent que dans le panneau au clic)
    • Couleurs de phase conservees (orange/bleu/violet/vert) via print-color-adjust
    • Header, modal et bouton lui-meme caches
    • Page A4, marges 14mm

Test plan

  • python -m http.server -d docs 8000 puis ouvrir le SPA
  • Cliquer PDF -> verifier la prevu d'impression (Chrome/Firefox)
  • Verifier que chaque phase est sur sa propre page
  • Verifier que les descriptions et sections (Exemples, References, etc.) sont bien presentes pour chaque technique
  • Enregistrer en PDF, ouvrir le PDF, verifier la lisibilite

Generated with Claude Code

sebdraven and others added 2 commits May 15, 2026 16:54
Adds a "PDF" button in the SPA header that triggers window.print(), and
a print-specific stylesheet that turns the dark interactive matrix into
a clean black-on-white linear report:

- One phase per page (page-break-before on each .column)
- Each technique's full description and sections rendered inline
  (always present in the DOM, hidden on screen, revealed in print)
- Phase colours kept on borders/headers via print-color-adjust
- Search box, detail modal and the print button itself hidden in print
- A4 page setup with 14mm margins

Users can choose "Save as PDF" in the print dialog for a clean offline
copy of the matrix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The legacy page-break-before: always was being ignored for columns 2-3
(only column 4 happened to overflow naturally). Adding the modern
break-before: page property alongside the legacy one fixes Chromium and
Firefox; the padding-top hack is no longer needed since @page margins
handle the top spacing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Combines the matrix-wide PDF export (this branch) with the campaign
report feature merged from main:

- Header now stacks the campaign chip, the Clear/Rapport buttons and
  the new ⎙ PDF button (unified .btn class for visual consistency).
- A single @media print block carries both stylesheets: the default
  rules render the full matrix in print mode, and the
  body.printing-report-scoped rules take over when the user prints
  from the campaign report modal. Tactic/technique checkboxes are
  hidden in print.
- .technique-details (full description + sections injected per
  technique) stays hidden on screen and is revealed by the matrix
  print rule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sebdraven
sebdraven merged commit 3500d40 into main May 15, 2026
3 checks passed
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