Skip to content

feat(spa): selection de techniques + rapport de campagne PDF#41

Merged
BartM82 merged 4 commits into
mainfrom
feat/spa-campaign-report
May 15, 2026
Merged

feat(spa): selection de techniques + rapport de campagne PDF#41
BartM82 merged 4 commits into
mainfrom
feat/spa-campaign-report

Conversation

@sebdraven

Copy link
Copy Markdown
Member

Summary

Ajoute la capacite de marquer des techniques observees dans une campagne reelle et de generer un rapport PDF dedie.

UX

  • Case a cocher sur chaque technique (clic sur la case = selection, clic ailleurs = ouvre le panneau detail comme avant).
  • Header : un chip "Campagne : N TE" + boutons "Effacer" et "Rapport" qui s'activent des qu'au moins une technique est cochee.
  • Modal Rapport :
    • nom de campagne, periode d'observation, contexte general
    • chaque technique selectionnee a son champ "Observation" libre
    • bouton "Imprimer / PDF" -> dialog navigateur (Save as PDF)
  • localStorage : la selection, les observations et les metadonnees persistent au refresh.
  • Echap ferme le rapport en priorite, sinon le panneau detail.

Print stylesheet dedie

Quand l'utilisateur lance l'impression depuis le rapport, body.printing-report est ajoute. Le @media print correspondant masque la matrice et le header, et affiche un container imprimable propre :

  • titre de campagne en h1, metadonnees (date, nb TE, date de generation)
  • contexte general dans un encart
  • pour chaque technique : phase, ID, nom, description complete, sections (Exemples, References...) + l'observation analyste dans un encart jaune
  • A4, marges 14mm, page-break-inside avoid sur chaque technique

Independant des autres PR

Ce PR ne touche que docs/index.html et n'a pas de conflit attendu avec #40 (qui ajoute l'export PDF de la matrice complete) -- les deux features peuvent coexister.

Test plan

  • python -m http.server -d docs 8000, ouvrir le SPA
  • Cocher quelques techniques dans differentes phases -> verifier le chip et l'activation des boutons
  • Cliquer "Rapport" -> remplir nom, date, notes globales, observations par technique
  • "Imprimer / PDF" -> verifier la prevu d'impression : titre campagne, sections, observations bien presentes
  • Recharger la page -> selection et notes restaurees depuis localStorage
  • "Effacer" -> selection videe apres confirmation

Generated with Claude Code

sebdraven and others added 3 commits May 15, 2026 17:15
Adds a per-technique checkbox in the matrix so an analyst can mark
techniques observed in a real campaign. Selection state, free-form
notes and the campaign metadata persist in localStorage so they
survive a refresh.

The header gains:
- a "Campagne : N TE" chip when at least one technique is selected
- "Effacer" to wipe the selection (with confirm prompt)
- "Rapport" to open the report modal

The Rapport modal lets the user fill in:
- campaign name, observation period, global context
- a per-technique observation textarea (visible alongside the
  matrix description in the printout)

The "Imprimer / PDF" action populates a hidden printable container,
toggles a body.printing-report class, and triggers window.print().
A dedicated @media print rule then hides the matrix UI and reveals
the report container as a clean black-on-white A4 layout.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an "Exporter JSON" action next to "Imprimer / PDF" in the report
modal. The downloaded file is named after the campaign title (slugified)
and contains: title, date, free-form notes, generation timestamp, and
the full list of selected techniques with phase, tactic, description,
sections and the analyst's per-technique observation. PDF and JSON
share the same configurable campaign title.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the export/import loop: the report modal gains an "Importer JSON"
button that reads a previously exported campaign file, validates the
shape, ignores unknown technique IDs (e.g. from a stale matrix), and
restores the selection, observations, title, date and global notes.
Confirms before overwriting an existing in-progress selection.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sebdraven
sebdraven requested a review from BartM82 May 15, 2026 15:21
Adds a right-aligned checkbox to each tactic header. Clicking it ticks
or unticks every technique under that tactic in one go; toggling
individual techniques keeps the parent box in sync (checked when all
are selected, indeterminate when some are, unchecked when none).
Resync also fires on Clear, on Remove from the report modal, and after
importing a campaign JSON.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@BartM82
BartM82 merged commit 1403565 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