cards: add report (flag-for-fixing) columns #78

Merged
raisondetredev merged 1 commit from refs/pull/78/head into main 2026-07-09 18:18:49 +02:00
raisondetredev commented 2026-07-09 18:14:35 +02:00 (Migrated from codeberg.org)

Adds three nullable columns to cards for a flashcard "report" (flag-for-fixing) feature: reported_at, report_category (typo / grammar / content / other), and report_note. Lets a deck owner flag a card that needs rectifying — a typo, grammar slip, content error, or anything else — instead of co-opting a studyset tag.

One open report per card: the three columns are set together on report and cleared together on resolve. A reported card is otherwise untouched and still studies normally — the flag is metadata only.

Why on cards, not a separate reports table: writes are owner-only and "Add to library" forks a private copy, so a report always lands on a card the reporter owns. Modelled on the existing hidden_at slice (#77). A cross-user table would only be needed to push reports upstream to another deck's author, which the app has no path for today.

Constraints:

  • consistency — (reported_at IS NULL) = (report_category IS NULL), and a note is only allowed on a reported card;
  • category-value — report_category IN ('typo','grammar','content','other') (extend in a follow-up if the set grows);
  • temporal — reported_at >= created_at.

Already applied to the live project (20260709155528_add_cards_report); this mirrors it into the repo. Paired with halkyon-learn PR #743 (the data layer).

Adds three nullable columns to `cards` for a flashcard **"report" (flag-for-fixing)** feature: `reported_at`, `report_category` (`typo` / `grammar` / `content` / `other`), and `report_note`. Lets a deck owner flag a card that needs rectifying — a typo, grammar slip, content error, or anything else — instead of co-opting a studyset tag. One open report per card: the three columns are set together on report and cleared together on resolve. A reported card is otherwise untouched and still studies normally — the flag is metadata only. **Why on `cards`, not a separate reports table:** writes are owner-only and "Add to library" forks a private copy, so a report always lands on a card the reporter owns. Modelled on the existing `hidden_at` slice (#77). A cross-user table would only be needed to push reports upstream to another deck's author, which the app has no path for today. Constraints: - consistency — `(reported_at IS NULL) = (report_category IS NULL)`, and a note is only allowed on a reported card; - category-value — `report_category IN ('typo','grammar','content','other')` (extend in a follow-up if the set grows); - temporal — `reported_at >= created_at`. Already **applied to the live project** (`20260709155528_add_cards_report`); this mirrors it into the repo. Paired with halkyon-learn PR #743 (the data layer).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-infra!78
No description provided.