17 Commits
Author SHA1 Message Date
6c14797cd6 Culture: what a line means, native recordings by link, and one page for what is usual here (#460)
* feat(situations): a line may name a convention, held to a source

What a line does beyond its words, as an id on the line whose sentence is in
the seven dictionaries: shown after a heard line is answered, above a line the
learner builds, and on the scene's list of lines with its sources linked.

Two conventions on four lines: a polite question from whoever hands out the
work is the assignment; an order is put as a wish. Each names sources opened
for it. The contract suite refuses an unknown id, a convention on a line of
the other direction, one without a source and one no line carries.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* wip(review): a native speaker says a line and sends it

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(review): a native speaker says a line and sends it; approved voices play on the list of lines

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(review): say that a recording was taken back; audit reads the declared upload size

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(audit): the recording walk measures the uploaded audio in the page

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(course): line_recordings is not a course table

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* feat(culture): one page for what is usual here, in the menu after the situations

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* test(audit): the layout walk covers /culture, a scene's lines and the review page

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: forge merge bridge <forge@git.orangecat.ch>
2026-12-03 18:39:07 +01:00
CatoandClaude Opus 5.5 c7d91ffe23 Exercise revamp: questions that teach, time to read, tap the words, choose what to practise, play together, plans (#452)
* Practice: choose or type, one switch above every question

A remembered habit (heidi.practice.habit.v2) decides, for each word that
has both, whether its meaning is chosen or its sentence typed. A flip
swaps the questions still ahead one for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: a word typed right comes back later than one chosen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: one hardness number for every question

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Plans: your own AI key is offered, and the pass card says what a pass is

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Knowledge map: a deterministic layout, and every node's state from the ledger

lib/visual/knowledge-map is the first knowledge-map layout in the fleet,
written to be extracted: plain data in, coordinates out, no app imports.
Clusters packed into columns, nodes in rows under each cluster's name,
labels wrapped with the real font's widths; no two cells meet, so no two
labels can, at 320px as at 1280px. Same input, same picture.

lib/domain/progress reads where a learner stands on every situation, grammar
topic and word group (not started / started / shaky / solid / mastered) from
the learner model, the review memory and the situation readings the
situation pages already use, and orders the few lines worth acting on:
the learner's own situations first, then new ones in their areas, then what
wobbles, then the words that keep slipping. Nothing is counted in advance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* «Was du kannst»: the map page, the weak-spots card, and the ways to it

/[locale]/progress draws the whole course as a map coloured by the
learner's own answers, with a legend and one motion (what is known fills
in, off under reduced motion). Tapping a node opens a sheet with what it
is, the numbers (asked, right, last seen, due) and «Üben», «Bis es sitzt»
(goal=nail), and for a situation «Situation starten»; an area's name opens
its situations and practises the whole area (module=…). Works signed out
from this device and signed in with the synced views; with no data it is
the course, not started, and where to begin.

The card «Was sitzt, was fehlt» is on the personal page and above the
map; /practice links to the map; the avatar menu lists it. Personal and
noindex like settings, so not in the sitemap. Strings in all seven
dictionaries; the responsive audit measures /progress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: an area scope, «Nail it», hardest first, and nothing right today asked again

- module=<area>: every scene of one situation area (care, hospitals, ...) and the words said in them; subjects=<list>: named words and lines, for the weak spots.
- goal=nail (nail.ts): a drill over a scope until each question is right twice in a row, the second at least three questions later and in the typed form where a word has one; a miss comes back after two to four others; at most 30 subjects, hardest not-known first.
- order=hard: hardest first by hardness(); «Harder» prefers the harder question inside its band.
- A sitting's order is shuffled (order.ts), never the same subject back to back and the same kind only where unavoidable; cards keep their most-heard-first order.
- Answered right today and not wrong today, on any screen (stats now date every wrong answer): not new again today in a sitting; read instead of asked in a situation run (withKnownRead), unless its review is due.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Play together: a challenge link and a live round

A challenge is ten fixed questions behind a link (/play/c/<id>): the same
questions in the same order with the same option order for everyone, a
nickname and no account, marked on the server, and a board of names, right
answers and times. It is kept 30 days, and expired ones are removed when
somebody next touches the table.

A live round is a host screen (/play/host) with a six-digit code and a QR
code, players on their phones (/play?code=), 20 seconds a question, points
for right plus speed, counts per option on the host's screen, a short board
on the phones and a podium. Realtime is short polling against Postgres: one
primary-key read with a version, 204 when nothing moved. At most 50 players
per room; a room is gone two hours after its last move, checked on access.
Host actions need the host secret kept on the host's device; creating rooms
and joining are limited with limitkit; nicknames are cleaned, capped at 24
and only ever rendered as text.

Five new tables (migration 0033), two privacy flows, the strings in all
seven languages, one section on /practice and one button at the end of a
sitting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: wrong answers a German reader cannot see through, and «Find the German word»

A harness (scripts/audit/options.ts, not shipped) measures how often a
reader who knows no Zurich German answers each chosen-answer question by
looks alone: most like the prompt, least like it, odd shape, longest.
options.test.ts holds the rates near chance.

- «Say it in Zurich German» (run): the wrong lines are the right line with
  one word changed: a Standard German word from the pack's leaks or the
  course's own cognate pairs, a form the pack places elsewhere, or an
  article the noun never takes. By looks: 99% -> 32%. Other lines only
  where a line has fewer than two such changes.
- Look-alikes skip Zurich words that stand for two standard words (bi:
  bin/bei, wänn: wann/wenn) and course pairs that are not cognates, so a
  planted word is certainly not Zurich German.
- «Stimmt das?»: a false claim is a near miss of the line's meaning
  (near-miss.ts), never another line; no near miss, no false claim.
  By resemblance: 96% -> 64%.
- «What is meant?»: more near-miss meanings (modals, Herr/Frau, times,
  places, colours...), the closest first. Lines with one: 21% -> 42%.
- Cognates («gah», gehen) are asked from German with real course words
  as the other options; the rest by meaning, with distractors as alike
  as the answer (resembles: letters and consonant skeleton).
- Options, banks and columns are laid out from a seed per sitting and
  the question id (present.ts), one helper for practice and the runs.
- hardness.ts counts giveaways, confusable options and odds; a cognate
  asked from Zurich rates easier than the same word asked from German.
- New kind «Find the German word» (spot): a course line with one word in
  Standard German, tap the word; the answer shows the Zurich word and the
  line. Strings in all seven languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: «Tschüss» is never offered as the certainly-wrong German word

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Exercises: read before moving on, and tap the words instead of typing

The moment after an answer (exercises/chrome.tsx, useMoveOn):
- a right answer shows the whole line where the question showed part of it,
  its meaning and the reason, then moves on after a beat as long as that
  text: 1.3 s + 45 ms a character, at most 6 s (move-on.ts);
- a touch, wheel or focus on the session screen, or «Anhalten» beside
  «Weiter», holds it: the bar fades and the control reads «Angehalten» in
  the same box, so nothing moves; Enter or Space continues;
- a wrong answer or a skip never moves on;
- «Von selbst weiter: An | Aus» in the sitting's sheet, remembered on the
  device (heidi.practice.move-on.v1, person-level, on the privacy page);
- reduced motion: no draining bar, the seconds are counted on «Weiter».
The situation run's follow steps use the same hook and controls, and the
run now has the same sheet behind the sliders.

Tap instead of type (tiles.ts, exercises/tiles.tsx, answer-how.tsx):
- every translate question can be built from tiles: its own words plus two
  or three real course words from the same scene, topic or word group,
  look-alikes first; marked against the course line (case and punctuation
  ignored), typed answers stay self-marked;
- the build kind's tile UI is now TileAnswer, shared by both;
- the habit is «Wählen | Antippen | Tippen»; old stored values stay valid;
  on a typed question it is that question's switch, and «Wählen» is not
  offered where there is no meaning question;
- the run's «Lieber schreiben» link is the same «Wörter antippen | Tippen»
  switch, above the question;
- tiles are recorded as mode "tap": not typed, not scheduled as recalled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Heidi Plus: a subscription that renews, monthly or yearly, with an intro price

The one-time pass becomes «Heidi Plus»: a monthly plan that renews until
cancelled, a yearly one at a saving, and an optional lower price for the
first months, through Stripe (paykit 0.6 `stripeBilling`). The pass stays,
offered below as «Lieber einmal zahlen?».

- /plans is paykit's PlanPicker: Free | Heidi Plus (recommended) | Eigener
  KI-Schlüssel | Organisationen. The own-key tier is CHF 0 to Heidi, names
  the providers from ai-kit's BYOK_VENDORS and leads to /settings#model; the
  old own-key section is gone. Without prices, Plus is «Bald verfügbar» with
  the notify form.
- A review step before Stripe (paykit's PlanReview): summary, notes, the
  account, the renewal box that must be ticked (Heidi has no terms page, so
  no terms box), the practice reminders as an optional box, and an active
  pass or subscription shown with «Abo verwalten» instead of a second one.
- Prices only from HEIDI_PLUS_MONTH_CHF, HEIDI_PLUS_YEAR_CHF,
  HEIDI_PLUS_INTRO_CHF, HEIDI_PLUS_INTRO_MONTHS; the proposal is on
  /owner/payments and in .env.example, marked as one.
- Stripe webhook: subscription events verified, handled once by event id
  (pay_events), the record in pay_subscriptions (migration 0034). A paid
  period moves the same entitlements row a pass uses, never back.
- Settings: «Abo verwalten» opens Stripe's portal, with the status line
  (renews / ends / payment failed / ended).
- Deleting the account cancels the subscription at Stripe first.
- Privacy: the passPayments flow names the subscription, its tables and the
  email Stripe receives; the flows have anchors.
- Strings in all seven languages.

package.json asks for @bitbaum/paykit ^0.6.0; the lockfile follows once it
is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Play together: «Find the German word» can be played; the said-too list lives in the packs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Practice: «Was willst du üben?» on /practice and the personal page; «Bis es sitzt» drills

- The builder: what (everything, words, forms and grammar, a situation, an area, my weak spots), which (a searchable list, each row with the learner's state: not started, in progress, strong), how (quick round, Nail it, test; hardest first). It opens a URL of the sitting contract.
- A «Nail it» sitting shows «12 of 20 nailed», says when the drill took only the hardest 30, and ends with a short summary; it resumes where it was left.
- A situation run shows a line answered right today as a line to read.
- «Bis es sitzt üben» on every situation page and grammar topic page with questions.
- Strings in all seven dictionaries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* «Which one is Zurich German?»: a wrong article names its noun; a form Zurich speakers use is never planted as wrong (tested)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Session bar: progress keeps its room, repeats shorten below 380px; audit measures the new answer moment

The top bar's progress bar keeps a minimum width, and the «+1 repeat» note
collapses to «+1 ↻» on the narrowest phones so 2/8 never pushes it off.
The responsive audit gains ONLY= to narrow to changed pages, measures a held
run step, measures a typed question as tiles before switching to typing,
and answers the meaning gate (after hydration) where a language shows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situation run: the reason for each wrong line is shown once, with the article's noun

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Situation run: what a step asks is the sitting's own small line above the question (one shape with practice)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog 2026-12-03: the exercise revamp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Plan test: new questions per sitting checked over 40 learners, not one lucky seed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* /practice: one picker — the quick round's mix sits under «Was willst du üben?» without a second «what / test» row

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Changelog 2026-12-03: plans (Free, Heidi Plus, own AI key, Organisations)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Lockfile: @bitbaum/paykit 0.6.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Heidi: «Was du kannst» answers next step, standing per area, what to do inside

The knowledge map (unlabelled dots in rows, lines that meant nothing) is
replaced by a page that answers, in order: one next step with its reason
and one black button; per area a segmented bar of lines that sit, wobble
and were never asked, with untouched areas collapsed to one line; inside
an area every situation, topic or word group with its bar, status word
and the action that fits it, sorted by what to do next.

The step comes from a pure planOf (lib/domain/progress/plan.ts) that the
personal page's card uses too, so the two never disagree. The map layout
module, its tests and the weak-spots card are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: one standard for practice, runs and play

Every question now passes the same five rules, written down in code in
lib/domain/questions/standard.ts and checked by tests:

1. Ask only what a German reader doesn't get for free. A line that can be
   read straight off its German is read, not asked. «Chasch mer schnäll
   hälfe?» is now a line to read.
2. Wrong options are the same kind of thing as the answer. «mir» is offered
   with «wir», «uns» and «euch», never with «nirgends» or «übermorgen». The
   reading shelf no longer fills a short list with words of another kind.
3. A question must not be solvable without knowing Zurich German. Seven
   solvers that don't know the language (look-alike, longest, odd one out
   and others) may beat chance by at most 15 points per kind; balance()
   drops the questions that let them do better.
4. Feedback gives the rule, other lines with the same word, and a line
   where the word means something else. A later line of the run asks the
   word again (transfer).
5. Hardness is real: it is measured from the options.

Homographs: a word whose meaning depends on the line is asked only when
the line's German proves the taught meaning (provesMeaning). The «wo» cue
", wo" matched «Ah, wo denn?», where «wo» is the question word. That cue
is gone, and comma cues now end at a word boundary. This removes 5 false
proofs, including «wohin». The sourced Einsiedeln text now asks «cho».

Close is not wrong: choosing a look-alike that differs only by a form said
in another Swiss region («geit», Bern) gets «Fast», with where that form
is said. It is scheduled as FSRS «hard», not as a lapse. One rule,
lookalikeVerdict, decides this. A Standard German word stays wrong.

Questions are now chosen from ASKED_ITEMS, the items that meet the
standard. PACK_ITEMS still holds everything, so stored progress, glosses
and reminders keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

* Questions: rules that are rules, fair German-first words, spot, transfer

- A rule line appears only where there is a rule. The line «Merk es dir im
  Satz…» shown under every plain word is gone (ruleOf in
  questions/standard.ts). «mir» and «si» now carry how their line tells the
  two meanings apart (homograph-role, homograph-modal), with examples taken
  from course lines, in all seven languages. The pack names which rule
  applies to which homograph.
- Asked from German: wrong options come from the word's own group, are
  never rude, and look as much like the German word as the answer does. If
  the answer is the only word that looks like the German one, the word is
  not asked. Balance no longer keeps a kind's last question when a solver
  wins it.
- Spot never plants a mere spelling of the Zurich word («bestelle» for
  «bstelle», «gehört» for «ghört»). It never plants a lone word ending in
  «-en» either, since that can be found by its ending alone. The word is
  quoted without its punctuation.
- Transfer: a run asks a word at most twice. A homograph's second question
  goes to a later line that uses the other meaning, when the part has one
  («bi mir» after «Mir händ…»). A contrast question is never the first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-03 13:12:38 +01:00
CatoandClaude ffc2596393 Heidi: plans page, sign-up CTA, privacy choice to Settings (#440)
- /[locale]/plans: Free, Heidi Pass (highlighted), Organisations; 30 days | 1 year
  toggle with a saving badge computed from the env prices; questions a day read
  from lib/config/caps.ts; no price while sales are off, "Coming soon, get
  notified" keeps an address in the new pass_interest table (migration 0032).
- /pass redirects to /plans; the code field is under "Have a code?".
- Four first-party counts in usage_counts: plans views, sign-ups started,
  checkouts started, passes paid.
- Signed-out home: one primary "See plans".
- "Keep on this device only" moves from My space to Settings > Privacy.
- Header, phone menu and footer link "Plans".

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 22:40:05 +01:00
CatoandClaude 37edcd8b99 Round two: situations, reading, dialects map, photographs, R2-ready media (#364)
* feat(dialects): one sourced register of dialect forms, and the language map's data

The same twelve everyday items in seven Swiss German dialects, each form
with the atlas map or article section it was read in (accessed 2026-11-26),
Zurich's column read from the pack, and a cell nobody could read safely
left «nicht belegt». The register lives with the pack (`family.register`),
so the leak gate holds; `lib/dialects/` only resolves, compares and narrows.

Re-reading the Kleiner Sprachatlas maps at full resolution corrected five
cells: Basel and Chur say «eppis», Lucerne «mier», St. Gallen «hend» and
«Chend»; Chur's butter shows Schmaalz beside Butter.

The language map: swissBOUNDARIES3D (©swisstopo) coloured by the BFS
typology «Sprachgebiete 2020»; the language figures moved to
`lib/config/languages.ts`, with the Italian region counted correctly
(121 municipalities, not 114).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(dialects): an interactive language map opens the area, with profiles, comparison and a helper

/dialect opens with one map of Switzerland: every Swiss German dialect area
links to its page, the Romandie, Italian Switzerland and the Romansh region
to a new language page each (/languages/fr, /it, /rm, one template: where,
in BFS figures, what Heidi offers today, what is planned without a date, and
the interest form). Under the map: the seven dialects a learner meets (where,
three forms to recognise by ear against Zurich, what that means for
following), the same words side by side, «which dialect am I hearing?», the
message reader and every area by branch.

Each area page opens with the same map, its area in red, and for the seven
compared dialects the profile and the comparison with Zurich. The home page
shows the map instead of the town dots and links it from its ways in; the
languages page opens the language pages; both new kinds of page are in the
sitemap and the responsive audit.

Dictionary text was checked against the sources: claims without one
(«Lucerne sounds between Bern and Zurich», «asking again is normal») are gone,
the superlative about Valais German is softened to what Wikipedia says.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(practice): the stretch in a sitting stays a stretch

A new question may be one band above the learner's level, and which kinds
take the first seats is luck. With more kinds that have nothing on level 1
than kinds that do, luck alone could deal a beginner a sitting that was
mostly one band too high: seventeen new situations moved the scene items
around and one seed of the "fit" setting came out 3 of 8 on the level.

While a kind still has a question on the nearest level, at most half of
what one deal seats is above it. Seats are never left empty for it: once
the nearest level runs out, the next band is the nearest.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): a purity gate over every line, and seventeen new situations

THE GATE. `lib/variety/purity.ts` holds what we publish in the taught
variety to three things the chat gate does not check, all read out of the
pack: no Standard German word where the pack gives the Zurich form (leaks,
correspondences, every one-word pair of the word list); no marked form of
another dialect (the regional rules, each with a source); one spelling per
word, the pack's. A test runs it over every scene line, the template
validator over every hand-written sentence, and a third test holds the pack
to its own spelling.

What it finds in the 412 lines of 2026-11-25: 37 lines — 29 spellings
(«gschlaafe», «sii», «staa», «umstiege», «laufed», «nüüt» …), 5 Standard
German words («Hauswart» twice, «Nachbar», «redet», «weg»), 4 Weinland «üs»
— four words spelled two ways across scenes, and the pack itself writing
seven words two ways (nüt/nüüt, gä/gää, lüted/lüüted, Aabig/Abig,
blibe/bliibe, blibed/bliibed, gärn/gern) plus «do» for «hier» where every
line says «da». Fixed at the cause: the pack's examples and leak
suggestions, then the lines, then 29 hand-written question sentences.
«gäng» was a Zurich word in the list; German Wikipedia names it a Bernese
speciality and it is now a regional rule. «schwierig» is «schwirig» in the
line and wherever the copy quotes it.

THE SCENES, all `reviewed: false` with the pack: relative on the phone, pain
in more detail, medication round, a new resident's first day, washing and
dressing, the night round, the doctor's round and — new in this commit — a
resident at the front door who wants to go home (care); pharmacy, post
office, a repair with the Abwart, bank, Coiffeur, bakery, asking the way,
Badi, a first evening at a Verein (everyday). The municipality scene gains a
second beat, the permit renewal. Every beat now falls between two exchanges,
not inside one. Words outside the pack were looked up in the Idiotikon
register; the at-the-door scene records the columns.

THE ORDER. The care list runs the way a day runs (handover, morning care,
washing, meals, medication, pain, the doctor, visitors, the phone, the new
resident, the evening, the door, the night); everyday runs the way settling
in does, so a learner who says "I have just moved" is handed the way to the
station, the municipality and the bank first.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(reading): texts to read in Zurich German, held to one purity gate

- /reading: a shelf of texts, easiest first. The course's own situation
  lines composed into short exchanges, and passages from the Alemannic
  Wikipedia's Zurich German pages, verbatim, each with page, revision,
  history link and licence (CC BY-SA 4.0). No text claims a review.
- One gate for reading texts, purityProblems(text, pack): standard forms
  derived from the pack (paradigm rows, cognate headwords,
  correspondences, the article mapping, small leaks with a dialect
  ending, st where the course writes scht); other dialects' marked forms,
  each sourced; one spelling (house rules, shapes of other conventions,
  letters the course never writes, and words that fold onto the course's
  own written another way). A shelf-wide check keeps every word to one
  spelling across texts.
- scripts/reading-harvest.ts lists and fetches all 375 pages of
  «Artikel uf Züritüütsch», gates every sentence and prints the counts
  the page shows; --verify checks each shipped passage verbatim against
  the revision it names.
- A text is read in large type with pressable words (meanings only from
  the vocabulary, none guessed), then three to five questions, then the
  shared ending. Reachable from the menu, home, Mein Bereich and the end
  of a situation with a text of its own.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(dialects): area pages lead with where the dialect is spoken; a thinner, legible map

The map draws thin muted borders instead of white gaps, so its areas read in
the dark theme too; a hovered area gets a red edge, a focused one a thick
one; on the dialects page it is no wider than 56rem. An area page states
where the dialect is spoken under its name rather than repeating the name in
a profile below. «Not attested» is a quiet status rather than a form, and
the Russian label is «нет данных»: the long one ran out of its column at
320 and 390px on the Basel and Graubünden pages (responsive audit).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(glosses): every new scene line in English, French, Italian and Russian

HEIDI.md says these four exist for every word, scene line and hand-written
question text. The new situations arrived without theirs: 381 lines, 54%
coverage of the phrases. All four are now at 792 of 792, drafted from the
Zurich line and its German together, unreviewed like the rest of the set —
and a test now fails the day a line is added without them, so the sentence
in HEIDI.md is a gate rather than a hope.

«Und wie chume ich dänn an See?» was answered «Nei, nur über d Brugg» —
a no to a how. It is «Eifach über d Brugg».

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(reading): the opener names the texts, and a number keeps its unit

The /reading opener said «Alle Situationen», borrowed from the situations
page; it now says «Alle Texte». In a text, «8 km» no longer breaks between
the number and its unit; the words themselves are untouched.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(design): legible in both themes, sharper openers, and a list of 37 situations that reads

THE LIST. The short list of a learner's own situations (practice, Mein
Bereich) printed every one a reason gives — fourteen for somebody in care —
above the rest of the page. It shows five, from where the learner is
(`previewOf`): finished ones drop off the front, the order never reshuffles,
the one recommended next is always there. The full list opens with one line
of links to its two domains, so the ward is not twenty-three rows down.

THE OPENERS. A 16:9 photograph covering a phone screen is drawn about 1500
pixels wide; `sizes` said 150vw, so a DPR-2 phone was served 1200 pixels at
quality 75 and it looked soft. It says 200vw and the quality is 85, one step
each (`images.qualities` allows it). Bytes at 390px, DPR 2 / DPR 3:
home 130 KB / 225 KB → 272 KB / 272 KB, practice 127 / 215 → 257 / 257,
listen 99 / 194 → 240 / 240 — the whole 1600-pixel file at DPR 2 now.

LIGHT AND DARK, measured at 390px over sixteen pages (solid text against its
real background, focus on the first tab stops): every token pair passes. What
did not: controls that cannot be used yet were drawn at 40–60% opacity —
«Leichter» 2.7:1, a disabled «Prüfen» 2.7:1 in dark — and an answer that is
out of the running was muted ink at 60%, grey on grey. They are muted ink at
full strength now (4.5:1 or more on every surface). A wrong answer's words
were flag red on its own tint, 4.4:1; they take the deep red ink
(`--color-incorrect-ink`, 7.1:1; dark keeps its lifted red, 5.8:1).

ALSO. The listening opener's button said «Zwanzig Minuten»; it says what it
leads to, «Drei für heute», in seven languages. The six sectors on
/organisations were a ragged stack of chips on a phone; they are a list
there, chips from `sm`, in their own component. The Badi opens on the
Strandbad picture already in the register. The responsive audit measures two
of the new scenes.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* docs(situations): the short list and the domain links in HEIDI.md, and where each new word was looked up

HEIDI.md §4 says how the list of situations reads with thirty-seven of them.
The new scenes now name, beside the lines, the Idiotikon register entries
their words outside the pack were checked against (volume, column), the way
the at-the-door scene already did.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* merge: dictionaries keep the dialects and the reading namespaces; one entry per source

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(purity): one gate for every line the course prints

The reading gate and the situations' gate become one module,
lib/variety/purity.ts, with one API used by the situations, the reading
shelf and the authored questions. It keeps the stronger checks of each:
paradigm, cognate and inflection-derived standard forms, the scht rule,
letters and diacritics the course never writes, the shelf-wide
one-spelling check, the leaks, correspondences and word pairs, and the
sourced regional rules.

- The other-dialect list is one list in the pack's rules: the Bern and
  Basel forms the reading pack carried move there, deduplicated; the
  shapes of the standard language and of another spelling convention are
  the pack's houseMarks; the distinct spellings are one list.
- The pack gave «Aache» as Wallis/Fribourg butter citing SDS 5/179.
  Kleiner Sprachatlas map 28 (SDS 5/179), opened today, prints no such
  form: Wallis «Aichu», «Aihu», «Öi(c)hu»; Sense «Ou(c)he»; «Aahe» in the
  south-west Bernese Oberland. The rule now says so.
- The pack wrote «gsee» and «gseh» for one word; it now writes «gseh».
- Reading: one situation text per scene from the current lines (36; the
  post-office scene has no word to ask about and waits); the harvest was
  run again against the one gate; «Villa Liebegg» lost one sentence
  («nachhär»), and --verify found all eight passages verbatim.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(dialects): a readable map in dark, the map on the first screen, a row of sections that says it scrolls

- The language map has its own colour roles (land, edge, hatch, water,
  hover) in globals.css; in dark the land is lifted off the page and the
  edges and hatches are light enough to count twenty areas.
- From lg the dialect area's map sits beside its title (PageHeader
  `aside`), so 1280×900 opens on it; the area rows follow (MapAreaList).
- The section rail fades the end that has more behind it and keeps the
  current chip in view, so a cut-off chip no longer looks like the last.
- «Welche Mundart?»: on a phone the verdict rides along the bottom of the
  clues once one is ticked, with a way down to the reasoning (reduced
  motion respected).
- Mein Bereich offers reading from the start, not only after a text.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(photos): stronger openers, places for everyday scenes, and photographs ready for object storage

Every photograph was rendered where it is used, at 390 and 1280, light and
dark. Replaced:
- station (practice, asking the way): the front was crossed by tram wires
  and parked cars; now the main hall (Dining Car from Wien, CC BY-SA 2.0).
- the lake (reading, Mein Bereich, care): a strip of hills and grey water on
  a phone; now the Glarus Alps over Lake Zurich (Roland zh, CC BY-SA 3.0).
- the dawn lake (dark of the same pages): an empty orange gradient on a
  phone; those pages now use the city at night already on the site.
- the night sky on Über Heidi: haze over a dark strip; now the Blüemlisalp
  glacier under stars (Deralpinbergsteiger, CC BY-SA 4.0).
New places: the Seebad Utoquai for the Badi, Butterzöpfe for the bakery,
the Fraumünsterpost for the post office, the Erismannhof courtyard for
neighbours, the laundry room and the Bünzli. Author and licence from each
file's record at Wikimedia Commons; alt text in all seven languages.

Served bytes: next/image now prefers AVIF; every opener at 390px DPR 2 is
58-162 KB (WebP at the same quality was up to 272 KB). A test holds each
registered width and height to the file's own header.

Object storage: NEXT_PUBLIC_MEDIA_BASE (lib/config/media.ts) makes every
photo resolve to <base>/photos/<file> and gives next/image the host;
unset, nothing changes. scripts/media/upload-photos.mjs uploads
public/photos to an S3-compatible bucket with PHOTOS_S3_* settings named
like Solon's: dry run by default, skips objects already there, SigV4 signed
with node:crypto (checked against AWS's published example).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 10:39:16 +01:00
CatoandClaude Opus 5.5 e8018631cb Chat: translate or talk in one tap, a model you can see and pick, /models (#363)
- Two pills in the composer, «Übersetzen» and «Gespräch» (chatkit's
  `modes`), remembered in `heidi.chat.prefs.v1` and sent with every message.
  On Translate the turn gets an instruction that the text is to be carried
  across, never answered, and never declined for its topic
  (lib/domain/chat/intent.ts). Reported from a phone: four sentences about
  tariffs, pasted to be translated, were declined as political analysis.
- Under an answer in mode "answer": «Nur übersetzen» resends the line as a
  translation and leaves the composer on Translate.
- The dock gets the model chip (it mounted the sheet with no button). The
  chip names the model: own key, the free one picked, or the one that wrote
  the last answer.
- The sheet's free-model list is a picker; the pick only reorders the chain
  (`preferred`), and an id the deployment does not run is ignored.
- /models: each free model with what it did here, from every turn since the
  restart (lib/domain/model/stats.ts) and stored answers of 30 days.
- Privacy page declares the new store; /models in the layout audit,
  noindex and out of the sitemap.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 09:52:45 +01:00
CatoandClaude d4e9a58580 Pay in francs (card, TWINT), visible models, a daily limit with a way on (#362)
- A second way to pay for a pass: Swiss francs on Stripe's hosted page,
  where the Stripe account's methods (card, TWINT, wallets) are offered.
  Off until STRIPE_SECRET_KEY and a CHF price are set; each rail is on or
  off by itself. Stripe is told nothing about the Heidi account. Own
  webhook path, /api/pay/webhook/stripe. The provider is paykit's (PR
  bitbaum/paykit#19), copied in lib/pay/stripe-provider.ts until 0.4.0 is
  released, with a test that fails the day the package has it.
- /pass: one card per pass, a price and button per rail; buying is the one
  filled action. A failed checkout no longer prints "fetch failed".
- /owner/payments: each rail, what is set (names only), what is missing,
  and the webhook addresses to paste.
- Chat: a Model button for everyone; the sheet names the free models.
- A daily allowance of free turns (100, HEIDI_FREE_TURNS_PER_DAY), three
  times with a pass, none with an own key; the chat says so and links /pass.
- /pass added to the layout audit.


Claude-Session: https://claude.ai/code/session_019MDtmteJuDGFouA1itJ5tM

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 07:13:14 +01:00
CatoandClaude 59419a1063 release: places on every page, situations as guided runs, profile and Mein Bereich, modular code (#361)
* feat(profile): a learner profile, and a personal page that answers three questions

One profile model as a view over the stores that already hold each answer;
the setup «Dein Profil einrichten», one question per screen; the profile
card on the personal page; «Wo stehe ich?» and «Nutze ich Heidi gut?»;
progress kept with the account by default; reminders only when behind the
learner's own weekly goal.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* docs(profile): record the new sync default and the profile; audit the setup screen

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(profile): interests lead the listening

One more profile question, «Was interessiert dich?»: nine choices that name
the topics every row of the listening register already carries. The
listening page opens with the rows that fit, each saying which choice it is
there for and how much can be asked about it; «Nutze ich Heidi gut?» names
one of them when the thing to do is listen. Chosen in the browser, so the
page stays cached; stored as a field of the profile record.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix: an eight-character password floor, a localised investors door, page titles and four layout leftovers

- A new password needs eight characters (sign-up, change, reset), through a
  plugin the account package accepts; signing in with an older, shorter
  password still works. The message is in all seven languages.
- The investors door says «Passwort / Öffnen» in the reader's language.
- A failed sign-in, the unsubscribe page and the signed-in personal page
  have their own titles; a test holds every page to one.
- The kept sentence under a saved word is no longer hyphenated
  («Schlüs- / sel» at 320px).
- «Warum die Übungen so gebaut sind» is a closed row with a chevron.
- The account forms' primary button is black, like every other.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(sync): the merge policy is a tested function; the profile says when sync failed

What one pull changes in this browser moved out of a useEffect into
lib/domain/progress/merge.ts (planMerge, decodeDevices, statusAfter), with
tests for every rule. The runner only fetches and writes.

A failed request and a 401 used to be swallowed; the personal page went on
saying progress was stored with the account. They are now reported through an
in-memory status, and the sync line shows when it last got through, that it
did not (with a retry), or that this browser is signed out (with the way in).

One deliberate difference: a device that holds no bridge/difficulty choice
no longer hides an older device's choice from a third one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(practice): one recordAnswer, a tested and resumable test run, exercise words by context

Items 2, 3, 7, 13, 16 and the practice and test screens of 12, which share files.

recordAnswer (lib/domain/practice/record.ts) is the one place an answer is
written into history, model, memory and the day. The sitting and the warm-up
wrote it out twice with different rules and the test a third time. Decided:
the first answer teaches (the sitting's rule); the day counts from the first
answer, so a warm-up left half way now counts (the sitting's rule won); a
test answer counts for the day only, kept on purpose and said why.

The test's draw and its stored shape are lib/domain/practice/test-run.ts,
tested. A run survives a reload (heidi.practice.test.v2, per course, on the
privacy page), keyed by sitting, with the clock held as a deadline.

practice-session.tsx 620 -> 217 and test-session.tsx 427 -> 146: state and
rules to use-sitting.ts, use-test-run.ts and lib/domain/practice/sitting-run.ts
(tested); LevelRow, UsedUp, the test's start and result screens, and the
warm-up's result are their own files.

The six dictionary slices every exercise read as props come from one
provider (exercises/words.tsx); the pages build them with exerciseWords().

heidi.voice.v1 is on the privacy page, so 'delete everything on this device'
removes it; privacy.test.ts now checks both directions.

The warm-up and the home page's speech bubble take the variety from the pack
instead of writing 'gsw', and the leak ratchet covers app/.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* revert(auth): accounts stay the package's; no password rule of Heidi's own

Sign-up and sign-in behave exactly as @bitbaum/accountkit defines them. The
eight-character floor added here as a local plugin is removed, with its
message and note; a rule about passwords belongs in the package, for every
app at once, or nowhere.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(model): one chain, a tested judgeTake, and the speaking check says why it has nothing

Items 4 and 8.

lib/domain/model/chain.ts: modelChain() and ownChain() replace four copies of
usableChain(freeChain("HEIDI")), and hold the health tracker three routes
imported from the chat's route file. A test fails on a fifth copy.

lib/domain/speaking/judge.ts: the take's judgement (request reading, the
bridge/target gate, the model call, the gate on the suggestion) with tests
and an injectable model. api/speaking/take/route.ts 222 -> 45 lines.

The route's answer now says which kind of nothing it is (opinion), and the
screen reads the status too: a rate limit, a model that could not be reached
and a model with nothing to add each have their own sentence, in seven
languages. Before, all three printed 'Heidi has nothing to add right now'.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(shell): an error screen inside the site, and loading states where they cannot change a status code

Item 5.

app/[locale]/error.tsx: a page that throws keeps the header, footer and chat,
says so in the reader's language, and offers retry and the way home. Its five
words come from the layout through a small context, so the dictionaries are
not shipped to the browser.

loading.tsx is NOT at app/[locale]/, on purpose. It was added and measured: a
loading file starts the response before the page runs, so 9 of 22 probed
addresses changed status (every unknown page 404 -> 200, /account and /portal
307 -> 200). The same screen is instead the loading state of the six routes
that can only answer 200 (vocabulary, speaking, listen, profile, settings,
warmup), and a test fails if a loading file is put above a page that calls
notFound() or redirect().

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(a11y): the two modal sheets are real modals, and an accessibility pass over existing screens

Item 6.

The sitting's settings and the model connection claimed aria-modal on a plain
div with no focus trap. Both are now chatkit's Sheet (a native dialog opened
with showModal): focus stays inside, the page behind is inert, Escape closes,
and the opener gets focus back. A test fails on aria-modal anywhere else.

The pass, in code:
- the model sheet's close button was labelled with a multiplication sign; it
  is the package's labelled 44px button now (model.close, 7 languages)
- tap targets under 44px raised: the settings chip, saved words' export and
  clear, a take's delete, a failed chat bubble's retry, the word popover's
  button, the invite link's rotate
- a listening question marked the right option by outline colour alone; it
  carries the drill's tick and cross
- seven error lines appeared without role=alert (topics, rounds, recorder)

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(chat): one way to follow a conversation, and the dock in three files

Items 10 and 12 (dock).

chat.tsx, the dock and the group chat each scrolled a marker into view on
every change of the messages. That is now chatkit's useStickToBottom behind
one small hook (chat/use-follow.ts): the thread is followed until the reader
scrolls up, so a token or a message from someone else no longer pulls them
away from an older answer.

chat/dock.tsx 577 -> 235: the panel is chat/dock-panel.tsx (242), and the two
facts only a browser knows about the launcher (is it lying on a control, how
tall is it) are chat/use-dock-launcher.ts.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor: answer view, round list and chat workspace under 300 lines, with their logic in lib

Item 12, the remaining three.

chat/answer-view.tsx 421 -> 185: the glosses, the suggestions and the row of
buttons are their own files; what the row holds (ownRowItems) moved to
lib/domain/chat/row.ts with tests.

round-list.tsx 415 -> 216: the form to open a round is round-open.tsx; what a
viewer may do with a round (roundChoices) and the request a host's form
becomes (newRoundBody) are lib/domain/speaking/round-view.ts with tests.

chat/workspace.tsx 415 -> 263: the transport is a hook, the words handed to
chatkit's ChatApp are workspace-words.ts (tested in all seven languages), and
the offer to keep a browser conversation is adopt-prompt.tsx.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(http): one id pattern, one organiser check, one audio-upload guard

Item 11.

The UUID pattern was defined in eleven files; it is lib/http/ids.ts.
organiserGroup was written out in the invite and the team route; it is in
lib/domain/groups/store.ts beside groupById. The bounded read of an uploaded
recording, copied between the two transcription routes, is
lib/http/audio-upload.ts with tests. A test fails on a second definition of
any of the three.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore: remove dead code and dictionary keys nothing reads

Item 15.

scripts/responsive-audit.mjs is superseded by scripts/audit/responsive.mjs,
which package.json's audit:responsive runs; nothing referenced the old one.

Exports with no reader anywhere (code, tests or scripts), found with knip and
confirmed by search: draftTransport, CowLockup, useHistoryView, recordFor,
Prose, countNewSince, isChannelId, isVideoId, lastChanged, moveId,
forgetInterest (account deletion removes those rows in erase.ts),
isObjective, stretchOf, essaysAbout. useTheme is used only in its own file
and is no longer exported.

36 dictionary keys whose name appears nowhere outside the dictionaries, in
all seven languages: home.{trustTitle,trustBody,trustLink,pillarsTitle,
methodLink,researchLink,contributeTitle,contributeCta}, pillars,
check.{failShort,noteTitle}, technology.directionLabel, privacy.updatedLabel,
contribute.{needTitle,needList}, auth.{portalLead,notSignedIn},
streak.goalLabel, practice.{correctIs,buildPrompt,verifyPrompt,typeLabel,
testAnswer,testDone}, essays.notTranslated, review.noneHint,
organisations.momentLabel, shell.{wordsTitle,wordsDue,wordsNone,wordsOpen,
courseSteady,resumeTitle,resumeProgress,resumeNone,resumeStart}.
Keys read by id (privacy.flows.*, chat.learn.*Label, feedback reasons) were
checked and kept.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(a11y): the modal sheet gives focus back to what opened it

Found in the browser: closing the model sheet with its close button left
focus on <body>. The opener was read in an effect, which runs after the
sheet's own effect has already moved focus into the dialog. It is read while
rendering now.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(shell): no focus ring round the error screen's heading

It is focused by the page so a screen reader starts there; the ring drawn
round it read as a text field.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* refactor(components): one folder per feature under _components

The flat folder of 131 files is sorted the way chat/, exercises/, profile/,
session/ and speaking/ already were: shell, shared, home, languages, dialect,
dashboard, vocabulary, listening, channels, groups, rounds, sync, practice,
situations, warmup, voice, byok, auth, essays. Files moved with git mv; no
barrel files, as before.

The stores that are storage and nothing else (practice, focus, streak, warm-up,
video), the one write path for an answer and the API error wording moved to
lib/browser and lib/http. Tests that scanned or named the old paths follow, and
the two that read 'this folder' still read every component.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(listen): «Für dich» is the first thing under the title

The rows that fit a learner's interests, or the one card that asks for them,
sat below the diglossia warning. They now come straight after the title and its
lead; the warning, the day's picks and the whole register stay below.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore(i18n): drop footer.varietyName, which nothing reads

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* chore: remove four exports and three types nothing references

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(listen, profile): the interest tiles stay under the finger; the sync choice is one column on a phone

Found walking the release at 390px.

/listen: the first tile tapped in the invite card already makes a pick, and the
card turned into the list at that moment, with the tiles pushed below three
rows. The card now stays a card until «Fertig», and then the list is brought to
the top of the screen.

Mein Bereich, signed in: the two answers to the sync notice sat side by side
inside the profile card, some 130px each, and «Nur auf diesem Gerät behalten»
stood four lines tall. One column below sm.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): the logic of a guided run through one situation

A situation was a reference list, and practising it was a random draw of
eight questions. This adds what a guided five-minute run needs, as pure
functions with typed results and no screens.

lib/domain/situations:
- planRun: every heard line in pack order with one question about its
  meaning, then up to two lines built from their words and said aloud,
  then the whole exchange again. Deterministic for a seed; a stored run is
  rebuilt from its step ids (heidi.situation.run.v2, per course, declared
  on the privacy page).
- situationProgress: followed x of y and new / started / followed / due,
  read from the learner model's line traces and the memory's due dates.
  A run's answers are recorded by recordAnswer; nothing else is stored.
- nextSituation, orderSituations: one recommendation with its reason, and
  the list with the learner's own situations first.

lib/situations: optional speaker, addressee, register, answers, reviewed
on a line and beats on a scene, with a validator test. Read from what the
packs and the reply questions already state (lines.ts); beats are written
for the fourteen scenes that were deepened by ten appended lines.

Fixes at the cause:
- a sitting on a scene no longer takes a quarter of its questions from
  the neighbouring scenes, and no longer asks a word inside a line of
  another scene;
- a wrong meaning in «Stimmt das?» is the same sentence type as the right
  one wherever the scene has such a line;
- the speaking task list can be held to one scene.

Strings for the future screens are under situationRun in all seven
dictionaries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(design): every main page opens with a place, lists are rows, and a sitting ends as a moment

Shared primitives in _components/shared: Scene (a full-height photograph
with the page's one headline, one line and one action on it, white on a
shade in both themes), RowList/RowLink (lists as rows with hairlines, no
cards), SectionHeading, and Ending (one full-screen ending for practice,
the warm-up, the test and a used-up scope). The type scale is three roles
in globals.css: headline, subhead, kicker.

Home, practice, listening, speaking, the situations list, languages, about
and Mein Bereich each open with their own Swiss place, by day and by
night: 16 photographs from Wikimedia Commons, author and licence read on
each file's page and listed in lib/config/photos.ts (credits on the
Impressum). During an exercise the question stands alone, without a box.
Motion is CSS only and off under prefers-reduced-motion.

Removes hero-photo.tsx and the card boxes around lists on these pages.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): a situation is a guided run, and every ending hands on to one

A situation page was a reference list with «Üben» at the bottom. It is now
the opener of a five-minute run, one thing per screen:

- /situations/<id>: a photograph of the place, one sentence, lines and
  minutes, one button (start, or pick up at the step it was left on); the
  review state said once; the old list one quiet link away (./lines).
- /situations/<id>/run: each heard line alone with its one question, then the
  German; two lines to build and to say aloud with the speaking recorder held
  to this scene (played back, never marked); the whole exchange again without
  German, by speaker and paced; the shared ending with ONE next situation and
  its reason. Every answer goes through the one ledger; the place is kept.
- /situations: a run left half way pinned on top, the learner's own
  situations, then each domain, as rows with their state. The twenty-chip
  picker on /practice and the board of figures are this list now.
- The endings of practice, the test and the warm-up offer a situation when
  one is the learner's next step; the home page leads a new visitor to the
  warm-up; «Weiter: <situation>» on the home card and the personal page.
- The warm-up's pointer now holds: its own answers made the scene it points
  at read "started", so it was never recommended.

Design: during an exercise only close, progress and the question remain (the
sitting's name and choices are behind one button in the bar); kickers and
actions on one line at 390px; rows instead of boxes on listening, speaking,
grammar and vocabulary; on a wide screen the shade is only where the words
are. Openers with a crane, a scaffold or a flat sky are replaced, and the
situations open with their own places (Wikimedia Commons, credited in
lib/config/photos.ts).

The responsive audit walks a run through every kind of step to its ending.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(photos): the care briefs open on the lake, and the night opener has no cranes

The two pictures of the hospital were a dark office front behind a parked
car, and they opened every care situation. No better licensed picture of the
place was found, so the care scenes open on the lake by day and at dawn,
both already in the register. The blue-hour picture on the home page, the
practice page and the tram brief is replaced by one without building cranes
(Dark Blue Zurich, kuhnmi, CC BY 2.0, read on the file's page at Wikimedia
Commons). The tram brief keeps the tram's front on a phone and leaves the
car beside it out. The three unused files and their entries are removed.

The alt texts of the removed pictures go with the next commit, which
touches the same dictionaries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(situations): a run is one part of a situation, about five minutes

A run through a whole situation was twenty-two steps, seventeen of them the
same «Stimmt das?». A run now takes one part: a beat where the scene has
one, about eight heard lines otherwise, with up to two lines to build, one
to say aloud and the replay of that part. The next run goes on with the next
part, read from the ledger (no second record); once every part has been gone
through, a run revisits the part with the most lines missed or due.

The brief says what the next run is (heard lines, minutes, part n of m), the
ending counts the part and, while a part is ahead, its one next step is that
part. Progress on the list still reads across the whole situation.

Questions vary: a «Stimmt das?» can be asked the other way round as three
meanings of the same scene, recorded against the same item, so one shape
does not come three times running where the line can be asked another way,
and the claims put to the learner are wrong about as often as right. The
claim is drawn as a claim, in its own labelled frame, not as the line's
translation.

Stored runs keep their shape; the replay's step id now names its part, so a
run stored before this is planned afresh.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(model): the free chain is built in one place, pass model included

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-26 03:58:15 +01:00
CatoandClaude 38efcba8ed release: calmer shell, exercises that stay fresh, and the languages of Switzerland (#357)
* feat(practice): sittings that stay fresh, a level the learner moves, and a summary worth reading

Half of every sitting is new while the scope has anything new; reviews
that find no seat lead the next one. A question answered and not yet due
is not asked again, and a used-up scope says so and offers the wider
sitting. One question per word or line per sitting. The level of new
questions follows the learner's own setting (easier, just right, harder)
and moves by itself on a run of right answers or repeated misses, said in
a line with the way back. Five named modes over the existing kinds. The
end of a round names what was new, one thing to take away, tomorrow's
reviews and how far through the course.

Also: «Pack» is gone from what a learner reads, a typed answer is told
whether it counts with only the differing words marked, picked tiles are
outlined instead of filled, and the session screen cannot be double-tap
zoomed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* feat(shell): a calmer header, menu, footer and personal page; the languages of Switzerland; du in Swiss German

Header: on a phone the bar is the brand, the account and one menu control,
as plain glyphs. Language and light/dark moved into the menu sheet (and stay
in the settings and the footer); from 1024px the language stays in the bar
and its panel carries the appearance. site-header.tsx is 166 lines; the wide
bar is header-nav.tsx.

Menu sheet: rows with a line saying what is behind each page, one filled
action, language and theme at the foot. Footer: the menu's groups, said once.

Personal page: one action that names what it starts, one due line, three
facts (where you left off, course progress, your words) and everything else
behind one disclosure. Situations show their name, started ones only;
channels are grouped with dates as people write them; no filled status pills.

Languages: /languages and a home section from lib/config/languages.ts — one
available, the rest planned, no dates. A 'tell me' form stores address,
language, optional region, locale and time in language_interest (migration
0016, additive), rate-limited, listed on the privacy page, erased with the
account whose address it is. No confirmation mail is sent, and the form says so.

Feedback widget: drawn by the page (footer and menu entry, the widget's
data-fc-place=host contract) instead of a tab floating over the text.

Copy: Swiss German says du throughout; the German white paper and changelog
too. 'Pack' is gone from learner-facing text in all seven dictionaries.
French, Italian, Romansh and Russian still address the reader formally.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

* fix(practice): a takeaway that is true on its own, the answered states in the responsive audit

The summary's takeaway and its list of new things read a pair that holds
by itself (a gap's word is no longer shown beside its whole sentence's
meaning) and prefer the line furthest from German. A wrong answer keeps
one short part in sight (the reason, else the rule, else the word) and
folds the rest under «more on this». «Stimmt» is outlined like every
other picked answer. The responsive audit now opens a typed answer, its
comparison and a revealed gap, the states a phone reported cut off.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-25 16:53:18 +01:00
CatoandClaude Sonnet 5.5 43f9109794 chore(chatkit): the broken-word audit runs on every page (#208)
* chore(chatkit): the broken-word audit runs on every page

audit:responsive now also lays out every word with findBrokenWords from
@bitbaum/chatkit/audit (chatkit ^0.13 -> ^0.14.2) and fails on one drawn
across two lines, at rest and with the header's dropdowns open.

Its first run found three, fixed in CSS, never by trimming copy:
- the footer's language list: two 56px columns inside one grid cell drew
  «Schwiizerd / ütsch» on every page; one column, break-words.
- the listening row: «Wissenschaftsma / gazin» beside «Подписаться» at 320;
  the row wraps and the button drops under the name instead.
- the answer card's «Schriftdeutsch» badge at the end of a long label:
  inline-block, nowrap, so it moves to the next line whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* fix(vocabulary): a known word is never cut — break-words, not wrap-anywhere

The word audit found «Entschuldigung» split across two lines on the
vocabulary list at 320px in de, fr and ru. The list is words we wrote, so it
gets a column wide enough for them (AGENTS.md); wrap-anywhere and
hyphens-auto were willing to cut them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* fix(vocabulary): on a phone the German sits under the dialect word, so no word is cut

break-words still cuts a word whose column is narrower than it, and the
third column of the row was ~100px at 320px against «Entschuldigung» at
~110px. Below sm the row is two lines (word, then its German); from sm it is
the three columns it was.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-23 18:09:16 +02:00
CatoandClaude f62286ee7a feat(chat): one row under an answer — suggested replies first (#186)
Since #185 the latest answer could carry three rows of buttons under three
captions: chatkit's suggested replies, «What now?» (`next` moves) and «Learn
from this» — up to ten buttons. Now every answer has at most one row.

- lib/domain/chat/row.ts `answerRow`: replies first, then the moves, then the
  learn chips; nothing twice (case- and accent-insensitive, on the label and
  on what it sends — the reply "Wie antworte ich darauf?" and the reply move
  that sends exactly that are one button); at most five. The grammar move is
  the one button that NAVIGATES instead of sending, so when the replies fill
  the row a sentence gives way, never it.
- answer-view.tsx: NextMoves + LearnRow + <ChatReplies> folded into one
  AnswerRow. Styled with chatkit's `ck-replies`/`ck-reply` classes (themed by
  the existing `--ck-*` tokens), not <ChatReplies> itself, because the grammar
  item stays a <Link>. One `role="group"` named by `chat.moves.title`. Replies
  still appear only under the latest answer and never while a turn runs; every
  send goes through the conversation's own `send`.
- i18n: `chat.replies` and `chat.learn.title` were only the names of the rows
  that no longer exist; removed from all seven locales.
- scripts/audit/responsive.mjs: the fixture answer now carries four replies
  (one 43 characters long, one a duplicate of the reply move) and a grammar
  move, so the full row is measured at every width.


Claude-Session: https://claude.ai/code/session_01Mg5wrkfw95JWfmAz8yRT1j

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-09 07:42:01 -07:00
CatoandCursor 74adcda92e feat(practice): exercises run on their own session screen (#150)
Practice, the test and the warm-up open /practice/session and
/warmup/session: close and progress on top, the question as the only
scrolling part, answer buttons in a bottom bar. No site header, footer
or dock launcher. /practice and /warmup become launchers.

- views hand their buttons to the bar through ActionSlot/Actions
- a sitting is saved after every answer and resumed for 12 hours
- close target via ?back=, guarded by safeNext
- FocusSurface is now the home chat's only
- fix: a card reported its answer twice and skipped the next question

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 11:06:19 -07:00
CatoandClaude Opus 5.5 8cc909dc80 fix(dialect): Zurich German is Züridütsch — and the gate now knows more regions (#136)
The site named the variety it teaches «Züritüütsch» 90 times in 7 languages,
on the dialect map and in its URL, while its own gate called the t-onset an
eastern form: the rule exempted compounds. Now:

- Züridütsch / Hochdütsch / Schwiizerdütsch everywhere; the Zurich area slug
  is zueriduetsch, with a 308 from zueritueuetsch. Other regions' own names
  for their dialect (Glarnertüütsch, Ostschwiizertütsch) stay — they are names.
- The rule matches the bare word and the Zurich/generic compounds.
- lib/variety/zurich-name.test.ts runs the name rule over every reader-facing
  string in every language (mutation-checked).
- Eight more regional rules (Bern: ig, wosch, het, Grüessech, vilmau; Basel:
  nit, goht, stoht). They immediately found 17 errors in Heidi's own Swiss
  German copy (het -> hät, stoht -> staht), now fixed. They also feed the
  dialect pages' marks, the message reader, and the gate on every chat reply.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 09:07:43 -07:00
CatoandClaude Opus 5.5 e49acd7849 fix(nav): sign-in in the corner at every width, and 44px targets at desktop (#116)
Reported from a phone: "log in log out should be easier on the mobile
version", and "i hope we do use the packages for header, footer, etc."

SIGN-IN VANISHED BELOW 1024px. Signed out, the bar showed sign-in only from
`lg` up. On every phone AND every tablet it sat inside the menu sheet, while a
signed-in reader had their avatar in the corner at every width. The old reason
was a real measurement — a gear, a labelled button, the wordmark, the language
switcher and the menu do not fit in 320px — and the answer was a SMALLER
control, not a hidden one. Below `lg` sign-in is now a 44px person icon in
exactly the slot the avatar takes once you are signed in; from `lg` it is the
labelled button beside the gear, as before. Settings moves into the phone
menu, labelled, which the bare gear never was. Sign-OUT was already in the
avatar menu at every width.

ON SHARED PACKAGES FOR THE HEADER: the fleet deliberately does not share nav
markup. `fleet/SHARED.md` records the experiment — `sitekit` served 2 of 20
repos and shipped 28px targets and no focus style to both, unfixable
downstream: "centralizing the markup centralized the bug." What IS shared is
the eight-rule navigation contract. So this checks Heidi against the contract
rather than swapping its header for a package.

THE CONTRACT FOUND TWO BREACHES, at widths this repo never rendered:

  1440px  the desktop nav — Start, Chat, Lernen, Üben, Über Heidi — was 16 to
          20px tall against rule 3's 44px, and had been since it shipped.
  320px   the logo link was 30px wide once the wordmark stands down.

Both fixed; the bar does not grow, because the header is a fixed token height
and 44px fits inside it. Measured after at 320 / 390 / 834 / 1440: sign-in
visible at every width, nothing under 44px, nothing crossing an edge, no
sideways scroll.

WHY IT WAS INVISIBLE: `audit:responsive` sweeps 320-390px only. The contract's
own note is that one width "was never a sample of the layout, only of one
branch of it". The audit now checks the header at 834 and 1440 per locale for
rules 3 and 7 — six renders, not a doubled sweep. Mutation-tested: restoring
the old desktop links fails it with "SMALL Start 32x16", "SMALL Chat 30x16".

Verified: verify exit 0, 882 tests.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 23:00:48 -07:00
CatoandClaude Opus 5 398b472978 fix(nav): make the mobile section rail actually stick, and give the header one height (#104)
THE DEFECT, FOUND BY MEASURING RATHER THAN READING. `SectionNav` carries a
full mobile treatment — `sticky top-0 z-20`, a translucent background, a
backdrop blur, a bottom border — for a state that could never occur. Scrolled
to 2500px on `/de/method` at 375px wide, the rail sat at `top: -1489`: it had
scrolled away like any static block.

A sticky element can only travel inside its containing block, and
`SectionNavLayout` wrapped the rail in a grid-item div exactly as tall as the
rail itself. Zero room to travel, so `position: sticky` did nothing and every
style written for the stuck state was decoration. `display: contents` below
`lg` takes the wrapper out of layout, the nav becomes the grid item, and it
inherits the grid's full height.

And it had pinned to `top: 0`, which is where the 69px site header already is
with a higher z-index — so had it ever stuck, it would have stuck underneath
the header.

WHILE FIXING IT, THE ROW GOT HONEST ABOUT SIZE. Seven sections wrapped to four
rows: 153px, a fifth of an 800px phone screen, held permanently to show a table
of contents nobody asked to keep looking at. It is now one row that scrolls
sideways — 57px — which is what documentation sites converged on for the same
reason. Measured after: pinned at exactly 69px, links clickable, and the
document still 375px wide in a 375px viewport.

ONE HEADER HEIGHT, REPLACING FOUR GUESSES. The header had no height; 69px
emerged from `min-h-11` plus `py-3` plus a border. Headings meanwhile carried
`scroll-mt-20`, `scroll-mt-24` AND `scroll-mt-28` — 2, 15 and 7 of them — three
answers to "how far below the top does an anchor land", each clearing 69px by
luck. `--header-height` in globals.css is now the single value: the header is
given it, the rail pins below it, and one `scroll-mt-anchor` utility (which
also accounts for the rail on phones) replaced all 24 occurrences.

TWO MORE DUPLICATIONS, EACH WITH A COPY THAT HAD DRIFTED:

- `lib/text/words.ts` replaces FIVE whole-word matchers. `saysWord`,
  `says` and `demonstrates` were byte-identical under three names; `check.ts`
  and `text.ts` each kept a private `escape`. `display.ts` says in its own
  comment that it is copying the variety gate — the author knew they were
  writing the second one, because there was nowhere to put it. `text.ts` opens
  by arguing these operations belong "in one place" while holding a fifth copy.
  Eight tests pin the cases the five copies each half-knew.

- `lib/i18n/dates.ts` replaces THREE date formatters whose comments all said
  "the reader's own date format, never a hardcoded one" and which then
  disagreed about the month and the fallback. The tag was resolved at three
  different layers: not at all, at the caller, and at the use site — so
  `SavedWords` declared `locale: string` and was handed a pre-resolved
  `de-CH`. Now the formatter owns it and the prop is `Locale`. A test asserts
  the chat workspace's date is byte-identical in all seven locales, because a
  refactor that changes a glyph is not one. Also ends `essays/[slug]`
  importing a helper out of another page module.

THE AUDIT LEARNED TWO THINGS, BOTH PROVEN BY MUTATION:

- Its two checks disagreed about scrollers. `clipped` exempts a deliberate
  `overflow-x: auto` ("a real scroller is a deliberate choice"); the horizontal
  `over` check did not, and reported four findings against a correct page whose
  document did not overflow. They now agree. Mutation-tested: widened the rail
  to 900px and `OVER` still fires, on the nav itself.
- It now fails if the header's CONTENT outgrows the token height. The first
  version compared the header to the token and could never fail — the header
  IS the token — which is worse than no check. Mutation-tested at `2rem`:
  "the header contains 68px of content in a 32px bar".

Note that lint and type-check both passed while globals.css was unparseable
(`@utility` cannot nest inside `@media`); neither compiles CSS. The dev server
was what said so.

Verified: verify exit 0 — 852 tests, 72 suites; audit:language 20 pages / 0
English; audit:responsive 116 renders across de/fr/ru, 320–375px, light and
dark — 0 overflow, 0 header drift; `/de/method` screenshotted at 390px
scrolled to 2200, rail pinned under the header.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 02:12:43 -07:00
CatoandClaude Opus 5 5e09a7ba5c Learning surfaces: navigable reference, scoped practice, two new exercise kinds, a learner model — and 3× the content (#90)
* feat(practice): scoped sessions, two new exercise kinds, a learner model, and enough material to stop repeating

The complaint was that the questions repeat, the system is not smart, and the
exercise code is one file doing four jobs. All three were true.

REPETITION WAS ARITHMETIC, not scheduling: eight questions a sitting out of
sixty-seven items means meeting the same ones within the week, and no shuffle
fixes that. So: a second situations domain (`everyday` — the shop, the tram,
the stairwell, the telephone, the lunch table), the short words no
correspondence rescues (`grad`, `äbe`, `gäng`, `aalüte`), and paradigms for
`si`, `gah` and `cho` built only from forms the packs already publish, so each
table is a reorganisation rather than a new claim. `gsi` is in it because it
carries every past tense in a variety with no preterite.

  practice items  67 → 136      scenes 6 → 11      lines 60 → 110
  vocabulary      48 → 61       and the pool is no longer 76% one kind

SCOPE is the spine. `/practice?topic=…&scene=…&group=…` filters the existing
pool, so every reference surface now opens a sitting about ITSELF. It works
because `ItemSource` already recorded where each question came from — the
field built to make a wrong answer traceable turned out to make a pool
addressable. A topic scope unions the topic's own examples with the real scene
lines that turn on the same rule.

NAVIGATION. `/grammar` was four screens with every topic expanded; it is now an
index in two bands — the topics a sentence does not survive, and the ones it
survives while you do not — with a page per topic carrying practice, previous
and next, and the scenes where the rule actually occurs. `/vocabulary` gained a
filter over both languages, jump links, a session per group, and the scenes
each word is said in.

TWO NEW KINDS, both objective, neither inventing language. `match` is four
words and four meanings; `gaptext` is a four-line passage from a scene with
three words lifted out and offered back — the word bank is what makes a passage
markable in a variety with no settled spelling. A word-order exercise was
considered and refused: this variety tolerates more than one order.

SMARTER. A learner model in the browser, beside the kept words and for the same
reason: it keeps Heidi from holding a record of what a person cannot
understand. It reorders every sitting so the weak half leads and names the two
or three areas worth going back to. No number is shown anywhere — the diagnosis
points at the material, never at the person. Declared on /privacy and deletable
from /settings, along with the seen-history, which had been undeclared since
the exercises shipped.

ENGINEERING. `lib/domain/practice/kinds/` — one module per kind plus a
registry. Adding `match` had touched five places, one of them a bug shipped in
the same commit as the feature.

Four defects found by the new tests rather than by review:

- two cloze items from one topic could share an id, so answering one marked
  the other asked and one of the two was never served again
- the model's first smoothing let one wrong answer out of one outrank a topic
  missed nine times in twenty
- the pack spelled `Chunnsch` in its showcase and `Chunsch` in a grammar
  example, against its own orthography note
- four places still linked `/grammar#<topic>` after topics became pages,
  including the chat's grammar button — the product's main loop

verify green (797 tests); responsive audit 522 renders, 0 overflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(learn): three new grammar topics, 35 more words, three more scenes — and the renderers become modules

Content, design and engineering, in one pass over the learning surfaces.

CONTENT. Practice items 136 → 195 (67 at the start of this work), scenes
11 → 14, lines 110 → 140, vocabulary 61 → 83, grammar topics 8 → 11.

  - `question-words`, `indefinite-article` and `imperative` — each names
    something the packs had been teaching by example without ever saying it.
    `wänn` heard as German `wenn` turns a question into a condition; the
    article `es` is identical to the pronoun `es`; the polite imperative ends
    `-ed`, not `-en`. Every example is a line the packs already publish.
  - Twenty-two nouns WITH their articles, which took the article drill from 3
    questions to 24. Gender is the error a German reader is least able to
    avoid, because it is carried by a word they never had to learn. Every row
    differs from German in the word too — the vocabulary test refuses a row
    whose halves match, so `Zimmer`, `Tür` and `Bahnhof` are deliberately
    absent. `s Tram` is the sharpest: Germany says `die Straßenbahn`.
  - `restaurant`, `at-work` and `school-parents`. The last aims at PARENTS,
    because kindergarten in the canton of Zurich is conducted in dialect — the
    electorate decided that in 2011 — so the people who cannot follow it are
    the adults.

ENGINEERING. The renderers followed the generators into modules:
`_components/exercises/` is one view per shape plus a registry, and
`practice-session.tsx` went 1123 → 390 lines. A view now owns its whole
question — prompt, controls, keyboard, verdict — which removes the last shared
`item.kind ===` chain. That chain is not a style complaint: its fallthrough was
the self-marked branch, where Enter means "I knew it", so adding `match`
shipped a grid a single keypress answered correctly.

Two registries now meet at the kind id, with a test in both directions, plus
one asserting the session component binds no `keydown` at all — the structural
form of "no shared handler to fall through".

DESIGN. The matching grid was collapsing to ONE column on a phone, which put
the four dialect words above the four German ones and made a matching exercise
impossible to do — fixed to two columns at every width. And the situations lead
and the grammar "where this comes up" line both described a care SHIFT, which
stopped being true the day `everyday` became the first domain.

verify green (800 tests); build 413 static pages; responsive audit 522 renders,
0 overflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 16:18:06 -07:00
CatoandClaude Opus 5 cfa55d349c feat(situations): where you need it — six care scenes, and the claim they were standing under (#89)
Adds a third axis beside the variety and the locale: domain, as data.
`lib/situations/` holds the contract, the seam that filters packs by the
variety this build teaches, and a projection guarding the same prose leak
`lib/variety/display.ts` was built for.

The first pack is care and nursing homes: six scenes from a shift — handover,
the morning, pain, meals, the evening, visitors — with sixty lines, each
carrying its Standard German, a direction (`hear` or `say`) and the grammar
topic it turns on. `/situations` and `/situations/<scene>` render them in all
seven locales; twenty-seven `hear` lines became practice items, taking the
pack's question count from forty to sixty-seven.

It was built now because `/organisations` had been telling care homes that
Heidi "practises the sentences that are actually said on your ward" while the
product held forty-eight words, none of which was said on a ward — a claim
with nothing behind it, on a live page, which `sectors.ts` says in its own
header it must never do. The sentence now says what is actually there, and the
row links to the scenes; a sector with proof links to it and one without does
not.

Three things hold the content honest:

- every line passes the deterministic gate at the generation threshold, so a
  Bernese form fails the build rather than reaching a learner who could not
  detect it — proven by mutating a line to `güet` and watching it fail
- every line names the source vouching for its lexis, while the arrangement
  stays ours, because examples must be written for this product rather than
  lifted from non-commercial resources
- a pack declares whether a native speaker has read it. `care` says NO, and
  the pages print that above the lines. It flips when a named person has read
  every one, and a test refuses a claimed review that names nobody

Nav: `reference`, not `use` — the header test caps `use` at five, and the
doing half of a situation is `/practice`, which every scene links into.

verify green (767 tests); responsive audit 468 renders, 0 overflow.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 15:39:23 -07:00
CatoandClaude Opus 5 e227509827 Mobile layout, the personal page, dialect depth, essays and practice (#87)
* fix(chat): stop the transcript scrolling the page sideways; open on the chat

Two things, both about what the app shows first on a phone.

OVERFLOW. A long link in an answer — an ordinary zuerich.ch URL, pasted by a
learner asking what it said — has no break opportunity in it, so the line ran
past the edge of the card. A block does not grow to fit its overflow, but the
DOCUMENT does: at 320, 360 and 390 the page became 710px wide and scrolled
sideways, and the reader had to drag it back and forth to read one reply. The
same defect hit the flex rows (a gloss, a suggestion's label beside its Speak
and Copy buttons), which size themselves from min-content and pushed their
neighbours off the edge.

One declaration fixes all of it, because `overflow-wrap` inherits: the
transcript's root wraps anywhere, and every descendant gets it — including
ones added later by somebody who never reads the note. `anywhere` rather than
`break-word` is the load-bearing half, since only `anywhere` shrinks the
min-content contribution that the flex rows measure.

That holds only while the transcript is the one gate, so `transcript.test.ts`
pins it: the root carries the class, and `AnswerView` and the bubbles are
rendered there and nowhere else. It covers all four chats — home, dock, full
screen and a group — because all four already share this component.

The composer got the same treatment one element down: a textarea is a flex
item that refuses to shrink below its `cols`, which on a 320px phone plus
three 44px buttons is wider than the row.

Verified in headless Chromium at 320/360/390 with a hostile answer (a long
URL, a 48-letter compound, a flag list): document width was 710px before and
equals the viewport after, on the home page and the full-screen chat.

DEFAULT SCREEN. Signed in, the locale root rendered the dashboard — a list to
look at, when what someone with an account opened it for is the conversation.
It now renders the full-screen chat, sidebar and all. The dashboard is not
gone: `/portal` is still its address and the account control is still the door
to it. Signed out is unchanged, so the indexed landing page and its pitch stay
exactly where a crawler and a first-time visitor find them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

* fix(mobile): every page measured for overflow; align the read/copy pair

The last fix went on the transcript and stopped there, so three reported
pages stayed broken. This one starts from a measurement instead of a
screenshot.

WHAT WAS ACTUALLY WRONG. A grid track defaults to `auto`, whose automatic
minimum is min-content — it will not go narrower than the widest unbreakable
thing inside it. One `truncate` line is `white-space: nowrap`, so its
min-content is the whole sentence. `/portal` with eleven ordinary kept words
was therefore 516px wide in a 360px viewport, and 912px once one word had
been kept from a link. Nothing on that page was doing anything unusual, which
is why nobody caught it by reading the code.

`grid-cols-safe` is that missing `minmax(0, 1fr)`, named once in globals.css
with the reason beside it, and applied to every grid whose base layout is one
column. Kept words and the vocabulary list also hyphenate now: a German
compound longer than a phone column is the whole subject of this product.

`overflow-x: clip` on the body is the backstop and explicitly NOT the fix —
it turns the next mistake into a clipped card instead of a site that scrolls
sideways. `clip` rather than `hidden` because `hidden` makes the body a
scroll container and silently kills the composer's `position: sticky`.

MEASURED, NOT INSPECTED. `pnpm run audit:responsive` drives every page in
every language at 320/360/390/414 in both themes, with a browser that has
been used — a dozen kept words in three scripts, one of them kept from a
100-character URL — and fails on two things: an element whose box leaves the
viewport, and an element whose content is wider than itself and cannot
scroll. The second is the one no amount of reading finds. 532 renders, zero
overflow. Not in `verify`: it needs a server and a browser binary.

THE READ/COPY PAIR. They were two halves of different components bolted
together, and looked it: Speak is a 44px control, Copy was 36px, so
"Kopieren" rode eight pixels above "Vorlesen". Equal heights now, because the
alignment IS the two numbers being equal. Their row also stopped being rigid:
in Russian the label wrapped to four lines beside them, and the moment Speak
opened its caveat — two sentences about which voice the device really has —
the cluster pushed the whole card off the right of the screen.

YOUR OWN MESSAGES, FROM A STRANGER. Sending a line in a signed-in
conversation returned the stored ROW, whose author is the OIDC `sub`. The
transcript is built on `LEARNER_ID`, so it rendered the reader's own sentence
in the shell reserved for a third person, left-aligned, with their raw actor
UUID printed above it as that person's name. The conversation GET had it too,
and was handing the `sub` back over the wire besides. One mapping now, shared
by all three boundaries, pinned by a test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

* feat(dialect): the three branches, and where each dialect can be heard

"Swiss German is not one language" was the third fact the page led with, and
then it illustrated the claim with eleven names in a flat grid — which reads
as eleven flavours of one thing, the opposite of what it says. The structure
is the interesting part, and it is not ours to invent: the Alemannic dialects
divide into Low, High and Highest, and the divisions are drawn by sound
changes that stopped in different places.

So the atlas now carries that structure. `DialectGroup` is generic — nothing
in the pack type says Alemannic — and each group holds the pair of FORMS that
draws its line rather than a sentence about them: `Kind` inside Low Alemannic,
`Chind` outside it, `Kind` in the standard both are versions of. A reader sees
the line instead of being told about it, and a pair of forms is the same in
all seven languages.

ABSENT IS AN ANSWER. Innerschwyzertütsch spans Lucerne, which is High, and
Uri and Unterwalden, which are Highest; Bündnerdütsch covers Chur and the
Walser settlements, likewise on two sides. Both carry no branch and the page
says the area straddles the line, because the tidier page would be the false
one.

WHERE YOU CAN HEAR IT. Every row in the listening register has carried an
atlas `area` id since the first commit and no page ever followed the join, so
the one question a dialect page could not answer — "where do I actually hear
this?" — was already answered in the data. The area pages now list the
programmes recorded in that dialect, sharing `/listen`'s own row component
rather than growing a second copy of it.

STILL NO PER-AREA PROSE, and the page got substantially longer anyway. That
is the part worth keeping: three branch explanations, translated once, serve
all eleven areas, where eleven descriptions would have been seventy-seven
blocks nobody here can check. Everything else added is data.

What is deliberately NOT here: invented dialect forms. Seven of the eleven
areas still say Heidi cannot tell them apart by form, because that is true.
The container for per-area vocabulary and grammar contrasts is what this
commit builds; filling it needs rows somebody can cite, not rows that look
plausible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

* feat(essays): somewhere for the long answer, and the first one

The dialect pages answer "which forms" and "where", and they are made of data
on purpose — eleven areas of translated description would be seventy-seven
blocks nobody here can check. But the question a visitor actually arrives
with is not a form and not a map: why does a country this small have this
many dialects, and why did the big neighbour lose its own? That is an
argument with sources, and it had nowhere to live.

TYPED BLOCKS, NOT MARKDOWN. A parser is a dependency this repo has spent real
effort avoiding, and Markdown would let a page render anything at all — the
design system would be one stray element away from not applying. Blocks
render through components that already know the type scale, the measure and
the one accent, and a block kind nobody implemented is a build error instead
of a paragraph that looks wrong in production. `inline.ts` gives prose the
three things it needs inside a sentence — a link, emphasis, and a language
form set in the dialect face — in forty lines of pure, tested code, so
writing an essay is writing sentences.

TRANSLATION IS NOT REQUIRED, and that is the whole reason essays are not
dictionary entries. A dictionary must have every key in all seven languages
or the build fails, which is right for interface copy and impossible for two
thousand words of argued history: machine-translating that into Romansh and
publishing it under our own name is exactly the overclaiming `/method`
exists to refuse. An essay exists in the languages somebody wrote it in, a
reader in another gets the version that does exist, and the page says which
language it is in rather than letting the site look broken. The sitemap
follows the same rule — hreflang names only real translations.

THE FIRST PIECE argues that it is not the mountains. Austria is as
mountainous and kept a spoken norm, because Vienna was a court and a capital;
the Confederation had neither, and until 1848 not even a capital, so there
was no place whose pronunciation anyone was supposed to imitate. Where it
reaches the causal story it marks it as a conjecture, because the sources
under it — Ferguson on diglossia, the HLS on multilingualism and on the
Geistige Landesverteidigung — describe the language situation and not why it
arose. Every URL was resolved before it was cited, per this registry's own
standing rule.

`sources.test.ts` now counts essays and dialect branches as citers, and
refuses an essay that names no source at all — the reverse check, and the one
that matters more on the pages that make the strongest claims.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

* feat(practice): a second attempt before the sitting ends, and the papers on the page

Practice is the half of this product that decides whether anybody comes back,
and it is the half where guessing is least excusable. Two changes, both
argued.

A MISSED QUESTION COMES BACK. It used to reveal its answer and move on, which
makes a sitting a test with feedback and never a second chance to produce the
thing. Rawson & Dunlosky (2011): the durable gain comes from retrieving
something correctly more than once, spaced — not from having seen it. Butler
& Roediger (2008) is the sharper case here, because three of the five item
kinds are multiple choice and choosing a lure can leave the learner holding
the lure unless something corrects them. So a missed item returns three
questions later, once, labelled as the second attempt rather than appearing
again unexplained.

The gap of three is OURS and says so. The literature gives the direction and
not the number, and a cited estimate presented as a finding is an uncited
claim one step better disguised.

THE SCHEDULE HEARS THE FIRST ANSWER ONLY. A word got right a minute after
being revealed has not been retrieved; grading it twice would advance the very
interval the spacing exists to protect, which is the same inflation
`review.ts` already refuses when it sends a missed word to the start rather
than back one step.

MY FIRST GUARD WAS WRONG, and reading it did not show it. It refused to
requeue an item already in the QUEUE — but a requeued item leaves the queue to
become the current question, so a second miss put it back again. Found by
driving a whole session wrong on purpose: eight questions became thirteen and
would have kept going, which punishes exactly the learner who is finding it
hard. The rule is now stated on what decides it — an item already answered
this sitting has had its go — and a test pins the worst case at exactly twice
the session size.

THE PAGE ARGUES FOR ITSELF. Seven claims on `/practice`, each linking to the
study behind it, on the page the design belongs to rather than on `/method`:
the person reading has just been told they got something wrong and is entitled
to know whether the thing telling them knows anything. The interleaving row
states the meta-analysis's moderator — the benefit depends on how similar the
material is, and on very similar material blocking can win — instead of
quoting the headline and hoping. Every row carries the guarantee the research
page already had: a test refuses a row citing nothing, and refuses a locale
citing something different for the same sentence.

Four sources added, each resolved through Crossref before being written down.

HEIDI.md §9 now carries the exercise track in order, including what is
deliberately refused: streaks, points, levels, percentages, a daily goal. If
that ever costs retention against a competitor with a flame icon, we lose that
comparison on purpose.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

* fix(portal): a way around your own page, and the account where people look

THE DASHBOARD HAD NO NAVIGATION. Five sections stacked down roughly two
thousand pixels of phone with nothing to steer by — no index, no counts, no
sign that anything existed below the fold. Somebody wanting their groups
scrolled past everything else to find out whether they had any.

`DashboardNav` is one component in two shapes, because a phone and a laptop
want different things from the same list: a strip that sticks under the header
below `lg`, the sidebar this page always needed above it. A second component
for the second shape would be two lists that disagree about what sections
exist. It wraps rather than scrolling sideways — a strip that scrolls hides
its own last item, on the exact class of page this repo has shipped scrolling
sideways by accident. The counts are the point: "Groups" says a section
exists, "Groups · 1" answers the question a personal page is being asked.

THE ACCOUNT IS IN THE CORNER NOW, at every width. It used to appear there only
from `lg` up and hide inside the mobile menu sheet below that. "Log out" is
the one control people look for without being told where it is, and on a phone
there was nothing in the corner at all. Signed OUT it stays in the sheet, and
that is not inconsistency: a signed-out bar needs a gear and a full-width
sign-in button beside the wordmark, the language switcher and the menu, and
five controls do not fit in 320px. An avatar is 44px and does.

The right-hand rail is gone. It held the account (now in the header), the
roadmap (the project talking about itself on a page about the reader) and the
way back into the product — which is now at the END of the page, where you are
when you have finished reading your own words.

TWO DEFECTS THE CHANGE CAUSED, both caught before shipping and both worth
recording because they are the same shape as each other:

The account dropdown is `absolute right-0`, which hangs from the nearest
positioned ancestor. That was its own button — correct only while the avatar
was the LAST control in the bar. It no longer is, so at 360px the 328px panel
ran from x = −78 with its labels cut in half. The anchor belongs on the
control row, whose right edge is the page gutter.

And the bar stopped fitting: 342px inside 320 in Russian, once the avatar was
paid for. The wordmark stands down under 380px and the cow stays. That needed
a breakpoint Tailwind does not have — every real decision in this product is
between a 320px phone and a 390px one, and `sm` at 640 is a tablet.

THE AUDIT NOW OPENS THINGS. It found neither of the above, because it measured
pages at rest and every dropdown on them was shut. It opens the header's
disclosures one at a time on two representative pages and measures each state
— which immediately found a third: the theme row inside the dropdown is 328px
of Russian in a 302px panel, cut off at the panel edge.

AND IT RUNS IN CI. An opt-in script nobody remembers to run would have caught
none of the three overflow defects reported from a phone this month. It needs
a browser and a built server, which is why it cannot live in `verify` — so it
is its own step, against the real build.

`AGENTS.md` now opens with the four rules behind every one of these, because
they are not obvious and this repo has now made all four.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bciJMTkW3WZ3AmpTZNvAC

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-20 07:52:58 -07:00