vinterliste/frontend
Ole-Morten Duesund 12d16c0835 Activity export to Markdown file (client-side, decrypts privates)
A new "Eksporter" section on the Profile page generates a markdown
file containing all activities visible to the caller — including
their own private ones — and triggers a download.

Why pure client-side:
  - Private rows are E2E-encrypted; the server doesn't have the
    cleartext. Decryption MUST happen in the browser.
  - Avoiding a server endpoint also means there's no "give me my
    plaintext" target for anyone who steals a session cookie.

Mechanics (frontend/src/lib/export.ts):
  - Fetch /api/activities (same as the dashboard does)
  - For each row, normalise: decrypt private payload via session.dek,
    pass semi/public through as-is
  - Build a markdown doc with sections "Private (N)" and
    "Offentlige og anonyme (N)" plus per-row title/description/tags/
    location/scheduled blocks
  - Wrap in a Blob, create a temporary <a download>, click it, revoke
    the object URL

The Profile section reports the resulting size as a quick confirmation
and surfaces errors inline. No server changes required.

Bundle: 32.7 KB → 34.2 KB gzipped (mostly the export helper itself,
which is plain string concatenation — no new deps).
2026-05-25 14:13:42 +02:00
..
public Public landing, owner-list links, owner-conditional semi, PWA + mobile 2026-05-25 12:57:59 +02:00
src Activity export to Markdown file (client-side, decrypts privates) 2026-05-25 14:13:42 +02:00
index.html Public landing, owner-list links, owner-conditional semi, PWA + mobile 2026-05-25 12:57:59 +02:00
svelte.config.js Scaffold Vinterliste — end-to-end encrypted winter activity list 2026-05-25 12:27:14 +02:00
tsconfig.json Public landing, owner-list links, owner-conditional semi, PWA + mobile 2026-05-25 12:57:59 +02:00
vite.config.ts Scaffold Vinterliste — end-to-end encrypted winter activity list 2026-05-25 12:27:14 +02:00