Fix ordering giveaways, the stuck false label, add Regenerate deck

Ordering cards
- Generation prompt now forbids dates, years, times, step numbers and
  ordinals in ordering items (spec + hard rules), and the server-side
  validation drops any ordering card whose items still contain them
  instead of shipping a giveaway.

True/False
- The 'false ✕' swipe label was permanently visible on the card: its
  opacity curve was inverted, so the clamp at rest was 1. Flipped the
  range (and tightened both ranges for the elastic drag) — each label now
  only fades in while swiping in that direction.

Regenerate deck
- Results screen gains a Regenerate deck button: rebuilds the activities
  from the deck's stored source notes, replaces the deck in storage
  (attempts/best score reset) and starts the fresh run from slide 1.
- StudyFeed tracks the current deck so the header, export and messages use
  the regenerated title/activities.
- Fixed a spurious 0% attempt recorded when a regenerated deck swapped in:
  scroll anchoring held the old results position, so the feed briefly
  reported 5/5 with zero answers. The scroll now resets before the new
  slides render, overflow-anchor is disabled on the feed, and a run with
  no answers is never recorded.

Tests: new deck-fixes suite 15/15 (TF overlay at rest/drag, regenerate
with loading state + storage reset, ordering guard drop/keep); retry
14/14, deck chrome 15/15, pwa 16/16, final-ux 12/12, security 8/8,
contrast 20/20.
This commit is contained in:
Martin Dvořák 2026-10-07 11:25:22 +00:00
commit 33967f9454
6 changed files with 122 additions and 16 deletions

View file

@ -71,6 +71,9 @@ no database, no data leaving your machine except the requests you send to Ollama
- Arrow-key / PageUp / PageDown / Home / End navigation, plus swipe on touch devices
- Progress bar, activity counter, XP counter and answer streak in the chrome
- Instant feedback with a short explanation for every activity, confetti when you finish
- Results screen: **Retry missed ones** (fresh, answerable items), **Study the whole deck again**,
and **Regenerate deck** — rebuilds the activities from the stored notes so you can keep drilling
until you're ready
**Activity types** (each one is its own React component, rendered from JSON by a `type` field)
@ -98,7 +101,8 @@ no database, no data leaving your machine except the requests you send to Ollama
- **Folders**: create named groups ("History", "Biology", …) from the sidebar or the create screen.
New decks freeze straight into the selected folder; anything unfiled lives in **Unorganized**.
Rename, delete (decks survive — they return to Unorganized) and move decks between folders
- Rename, delete (with confirm), regenerate, and **add more activities** to an existing deck
- Rename, delete (with confirm), regenerate (from the library or the results screen), and
**add more activities** to an existing deck
- Export a deck as JSON and import it back — the folder name travels with the file and is recreated
on import