cards: add hidden_at column for retiring a flashcard #77

Merged
raisondetredev merged 1 commit from refs/pull/77/head into main 2026-07-09 01:17:59 +02:00
raisondetredev commented 2026-07-09 00:47:40 +02:00 (Migrated from codeberg.org)

First of three PRs for a "hide" (retire) a flashcard feature. Adds a nullable hidden_at timestamp to public.cards.

A hidden card is retained in full but retired from active learning: excluded from study sessions (spaced-rep + cram), the due-count badge, and mastery %, yet still visible (greyed-out) in browse and carried through export/import so the state round-trips in a backup. Modelled on Anki's suspend — indefinite until the user unhides it, FSRS scheduling state left untouched so unhiding resumes where it left off.

hidden_at is independent of deleted_at (soft-delete → invisible everywhere): a card may be hidden xor deleted xor neither. The CHECK mirrors deleted_at (hidden_at IS NULL OR hidden_at >= created_at).

No new index: due-filtering runs client-side in the local Drift store, and the existing cards_studyset_ordering_idx (WHERE deleted_at IS NULL) must keep returning hidden rows so browse can grey them.

Already applied to the Halkyon Learn project via MCP (version 20260708224607); this mirrors it into version control with the matching filename. Additive + nullable, so existing clients ignore the column until the app PRs land.

Follow-ups: (2) halkyon-learn data layer — Drift column, model, gateway/repository hide/unhide, sync, study/mastery exclusion; (3) halkyon-learn UI — greyed tiles + hide/unhide toggle.

First of three PRs for a "hide" (retire) a flashcard feature. Adds a nullable `hidden_at` timestamp to `public.cards`. A hidden card is retained in full but retired from active learning: excluded from study sessions (spaced-rep + cram), the due-count badge, and mastery %, yet still visible (greyed-out) in browse and carried through export/import so the state round-trips in a backup. Modelled on Anki's **suspend** — indefinite until the user unhides it, FSRS scheduling state left untouched so unhiding resumes where it left off. `hidden_at` is independent of `deleted_at` (soft-delete → invisible everywhere): a card may be hidden xor deleted xor neither. The CHECK mirrors `deleted_at` (`hidden_at IS NULL OR hidden_at >= created_at`). No new index: due-filtering runs client-side in the local Drift store, and the existing `cards_studyset_ordering_idx` (WHERE `deleted_at IS NULL`) must keep returning hidden rows so browse can grey them. **Already applied** to the Halkyon Learn project via MCP (version `20260708224607`); this mirrors it into version control with the matching filename. Additive + nullable, so existing clients ignore the column until the app PRs land. Follow-ups: (2) halkyon-learn data layer — Drift column, model, gateway/repository hide/unhide, sync, study/mastery exclusion; (3) halkyon-learn UI — greyed tiles + hide/unhide toggle.
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!77
No description provided.