# Feedback and analyses

Decided with the product owner on 24 Oct 2026. **Built on 26 Oct 2026** (branch `feat/admin-backend`): stage 1 without the
classic button, and stage 2 as the tab "Feedback" of the admin backend (`docs/admin-backend.md`). Still open: the
feedback button in classic, stage 3.

## Decisions

- **Analyses live in kulibri itself**, in the new UI only, for kulibri admins only (the Admin role, `ROLE_ADMIN`).
- **The feedback button also goes into classic**, labelled just "Feedback". It sends the same context as the new UI's,
  with "Oberfläche: klassisch"; stored feedback says which UI and which page it came from.
- **Feedback belongs to an account**: the server takes the account from the session, not from what the browser sends.

## Today

The new UI's button (`utils/feedback.ts`, `POST /api/feedback`, `FeedbackController`) mails support the text, the
address the person typed, and some context: the page (a poll only by its id), signed in or not, window width, browser.
Nothing is stored, and nothing ties it to an account.

## Stages

1. **Store and link** (server, Mitko). A table `feedback`: text, user id (from the session), the typed address, page,
   poll id, UI (new or classic), window width, browser, time, and a status for the team (new, read, answered, done). The mail
   stays as the notice. Participants without an account are tied only to the poll (and their row where known), never
   followed across polls.
2. **An admin view "Feedback"** in the new UI, each entry with the account's picture beside it, mostly from data that
   exists: account since, Premium, Beta or Alpha, new or classic UI; its polls in the last 30 days by type and state
   (created, saved, with participants, deleted). A poll never saved stays at type -1; one cancelled while being created
   is set to type 0 without ever being `initialised`, so "abgebrochen" can be read from the polls table today.
   Example line: "3 Terminumfragen in 2 Wochen, alle abgebrochen, zuletzt im neuen kulibri am Handy".
3. **Where people drop out** (later). Needs events (editor opened, dates chosen, saved, invited, first answer). SignalFlow
   already receives a few ("new-poll-auth", "new-poll-anonymous", "open-poll"); ask Mitko how complete it is in production
   and whether its data can be read back. The alternative is a small event table of our own.

## Data protection

- The privacy policy names the link to the account and the analysis of use.
- The feedback dialog says that the feedback is tied to the account.
- Events get a fixed retention period.
- Participants without an account are not tracked across polls.

## Order

Stage 1 right after the production deploy (small, and every feedback from then on can be analysed), with the classic
button. Stage 2 right after it. Stage 3 only when stage 2 shows that the exact point of dropping out is needed.
