Skip to content

feat(export): richer mailto flow — recipients, team context, signed footer - #36

Merged
alexbelij merged 1 commit into
mainfrom
feature/mailto-enhance
Jul 9, 2026
Merged

feat(export): richer mailto flow — recipients, team context, signed footer#36
alexbelij merged 1 commit into
mainfrom
feature/mailto-enhance

Conversation

@alexbelij

Copy link
Copy Markdown
Owner

Composer modal collects To / Cc / Subject / Message before we assemble the mailto: link (Gmail/Outlook web need a recipient before Send is active). Subject carries the active team name; body starts with From: <team> · <formation> · <coach> and ends with the device pubkey fingerprint so the recipient can cross-check identity.

Three buttons in the footer:

  • Copy report — full plain text (no 40-line cap) to the clipboard, fallback for long reports
  • Download PDF too — triggers the existing exportPdf() so attaching becomes one click
  • Open mail client — assembles the mailto: with to, cc, subject, body; preflights URL length and warns instead of silently truncating.

Last-used recipients persist in localStorage. Verified end-to-end via jsdom: modal opens, subject has team, From line present, live URL present, trim indicator present, mailto correctly assembled, recipients persisted, empty-report path shows warning.

…ooter

Rework the "Email report" button so the report actually leaves the
device the way a real coach would send it, without the previous
guesswork:

- Composer modal collects To / Cc / Subject / Message before assembling
  the mailto: link (Gmail, Outlook web, and native clients all need a
  recipient before they enable Send).
- Subject now carries the active team name (from MisterTeams); body
  starts with a "From: <team> · <formation> · <coach>" line.
- Body footer appends the device's public-key fingerprint (from
  MisterSigning) so the recipient can cross-check identity.
- "Copy report" button dumps the FULL text (no 40-line cap) to the
  clipboard as a fallback for extra-long reports.
- "Download PDF too" button triggers the existing exportPdf() side by
  side, so the attachment reminder becomes a one-click action.
- Last-used To / Cc addresses persist in localStorage.
- Preflights the URL length — if the client would truncate, we warn and
  suggest the clipboard route instead of dropping content silently.

- demo/styles.css: .em-modal (wider), textarea, meta chips, footer
- demo/index.html + demo/sw.js: ?v=34 / CACHE_VERSION → v34

Verified in jsdom: modal opens with team-aware subject + From line + live
URL + trim indicator; mailto assembles with to/cc/subject/body;
localStorage remembers recipients; empty report path shows warning
toast; clipboard copy delivers the full report.
@alexbelij
alexbelij merged commit 96802c6 into main Jul 9, 2026
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
Source commit: 96802c6

Message: feat(export): richer mailto flow — recipients, team context, signed footer (#36)
@alexbelij
alexbelij deleted the feature/mailto-enhance branch July 9, 2026 10:39
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.

1 participant