mirror of
https://github.com/bitbaum/heidi.git
synced 2026-12-04 05:17:27 +01:00
run-effort
47
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
df3796b9b6 |
Photos that follow the theme, better openers, R2-ready media (#365)
* Photos: theme-aware scenes, and served from R2 with no image work on the box - Scenes follow the theme the way Solon's do: a day photograph for light, an evening one of the same kind of place for dark where one is worth it, shown by CSS (lazy, neither preloaded when paired). The words stand on a veil of the theme's own page colour, ink >= 4.5:1 over any picture. - New station pair (hall at eye level / against the light), the tram at the blue hour, a bakery without a label, a rowing club for the Verein; the Stadthaus courtyard with its art installation removed. - lib/media/: fixed-width AVIF and WebP variants keyed by content hash, a manifest, and a next/image loader that is on only with NEXT_PUBLIC_MEDIA_BASE. scripts/media/ensure.mjs makes the deploy's build upload what the bucket lacks and turn the base on only after a probe; it never fails the build. Shaped like Solon's for the sitekit move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * Photos: the deploy's build uploads to R2 itself; restaurant and city pairs - scripts/media/ensure.mjs runs first in `pnpm run build` when SELF_HOST=1: with PHOTOS_S3_* and MEDIA_PUBLIC_BASE it uploads only the variants the bucket lacks (one image at a time, sharp on one thread), probes one through the public base, and only then writes NEXT_PUBLIC_MEDIA_BASE into .env.production.local. Anything missing or failing: one line, local serving, exit 0. An explicit NEXT_PUBLIC_MEDIA_BASE is the override. - Same widths, key scheme (photos/<name>.<hash12>/<w>.<fmt>), manifest shape and env names as Solon's src/lib/media/, for the sitekit move. - Restaurant and the situations index: the guild houses on the Limmatquai by day and lit at night. The tram is the blue-hour Bahnhofstrasse in both themes, wearing the dark theme (scene-night). The old-town lane with a restaurant's name is gone; the city default is the Schipfe and the Limmat on a winter evening. Apéro and small talk open on the lake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
083dd52f0d |
feat(engine): courses in data, pack-declared forms, level sources, and meanings in the learner's language (#355)
* feat(course): every stored record names its course, and today's progress is the Zurich course's A course registry (lib/course/registry.ts) lists the one course there is; lib/variety/active.ts resolves its pack. Browser stores that hold course progress move to an envelope keyed by course under .v2 keys, and a value under the old .v1 key is read as the default course without being rewritten. progress_devices, certificates and entitlements gain a course column that defaults to the Zurich course. Item ids are unique across courses, and the default course's ids are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * refactor(variety): the pack declares its articles, persons, respellings, voices and prompt lines Article, FormLabel and VocabularyGroup were closed unions of the Zurich values, the answer comparison folded Zurich respellings for every language, word distance lower-cased as German, the voice ranking named two German tags and the prompt builder carried Swiss spelling advice. Each is now a field of the pack, read by the engine; a contract test over every pack refuses a value the pack did not declare, and the leak test also looks for the taught language's own words in engine code. The Ukrainian pack gains one verb with its own pronouns and no articles. The 2,956 published items and the system prompt are byte-identical. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * refactor(practice): an item's level comes from a source the course chooses A course entered from a sibling language measures each item's distance from that language, exactly as before; a course entered from zero reads a declared CEFR band on the word, the line or the topic. levels.ts exposes both as LevelSource and picks by Course.entry. Every published item keeps its level. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * feat(meaning): a meaning can be shown in the learner's language A meaning is the bridge form plus an optional gloss in the interface language. One pure rule (lib/domain/meaning/meaning.ts) decides what is printed from the learner's answer to «Wie gut ist dein Deutsch?»: good shows German only, as before and by default; some shows German and the gloss; none shows the gloss; without a gloss German is always shown. Every exercise, the word list and the scene pages print meanings through one component. The answer is a course store, set in the settings and asked once after the start card, only in an interface language that has glosses. Gloss sets are one file per course and language, loaded on demand. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * content(glosses): English and Russian meanings for every word and scene line; French and Italian for every word Machine drafts from the Zurich form and its German meaning together, marked unreviewed in the data. One file per language beside the pack, keyed by the German the course gives. Tests refuse a key no entry carries, an empty gloss and two glosses for one German form; pnpm run glosses:coverage prints what is covered. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * content(glosses): French and Italian meanings for every scene line Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * docs: courses, pack-declared forms, level sources and glosses, as they now are Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T * refactor(variety): the pack says which grammatical person each of its labels is The gloss check and the prompt's auxiliary table, both new on main, matched the Zurich labels «ich» and «er» by name. The forms pass of the leak test caught it on rebase. The pack now declares personOf, and both read it; the system prompt and the published items are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
74cd7d05e9 |
chore: .env.example names the keys the app reads; the speaking audit takes CHROMIUM (#344)
.env.example listed three SPEECH_* names that only a one-off script reads and omitted the model keys the app does read. It now names GROQ_API_KEY, OPENROUTER_API_KEY and GEMINI_API_KEY with what each is for, and says the SPEECH_* names belong to the script. scripts/audit/speaking.mjs takes CHROMIUM the way responsive.mjs does. Claude-Session: https://claude.ai/code/session_019MDtmvb6xi489TfZMg7n9T Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0bb131b1fb |
refactor(clipboard): copying is chatkit's useClipboard, and two unused files are gone (#299)
The copy button under every dialect line and the invite link's copy both carried their own clipboard write and reset timer. Both now use the fleet hook. The invite panel keeps one thing of its own: "copied" belongs to one link, so rotating the token clears it. lib/config/check.ts and scripts/tmp-labels.mjs had no importer and no script entry. Claude-Session: https://claude.ai/code/session_019MDtmsxWVjuhCQowciDEYR Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
fedd14f6cb |
fix(seo): per-page canonical, og:url and hreflang, an absolute share image on every page, favicon.ico and apple-touch-icon (#285)
The locale layout wrote canonical, og:url and hreflang once, for the locale home, and every page below inherited them: /en/practice declared /en. Its openGraph object also replaced the one Next builds from opengraph-image.tsx, so no page had og:image or twitter:image. An unknown path matched no route, was answered outside the layout, and emitted the image against localhost. - lib/config/seo.ts: one helper every page calls with its own path. - app/[locale]/[...rest]: unknown paths 404 inside the locale layout. - favicon.ico, apple-icon.png and /apple-touch-icon.png, rasterised from app/icon.svg by scripts/build-icons.mjs. Claude-Session: https://claude.ai/code/session_019MDtmsubNtjznXC5pMf4fD |
||
|
|
1517340bfd |
feat(auth): prove email recovery in both mail states (#252)
Heidi already had AccountKit's shared mailer wired, but nothing held what it should do, and the env that turns it on was undocumented, so it never got set and live sign-in offers no way back from a forgotten password. - lib/auth/mail.ts: Heidi's account mailer (createAuthMailer over @bitbaum/mail-kit) as one factory, so tests exercise the real adapter. - lib/auth/recovery.test.ts: with no mail env (or a placeholder key, or a sandbox sender) no reset, link or address check is offered and a reset request sends nothing; with it, a reset email goes to Heidi's origin and its link sets a new password once. - scripts/audit/account-recovery.mjs, run by the shared account journey: in a real browser, "Forgot your password?" and the sign-in link are shown in de, fr and ru at 320 and 390px and the forgot form ends in its notice; the same build started without mail env shows neither. - .env.example: BETTER_AUTH_SECRET, RESEND_API_KEY, RESEND_FROM. Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
266e536b69 |
feat(channels): follow YouTube channels, get told about new videos, answer questions about them (#202)
The listening lab, built on the media that already exist. A learner follows
YouTube channels they watch anyway (a link, a video link or the @handle, or
one of the register's rows with what is spoken beside it); Heidi reads each
channel's public Atom feed — no API key — hourly on the box and inline when
the page opens, lists what is new since the last visit, and sends a Web Push
to the browsers that asked. Following rings for the next video, never the
back catalogue, and nothing here reminds anyone to practise.
One video is the lab's exercise in HEIDI.md's order: a gist question before
the first listen, three to five detail questions in the bridge after it,
each wrong answer answered with the line that was said and a button that
plays that second (IFrame API seek), then the transcript, tap a line to hear
it. A count with its denominator, no score. What was answered stays in the
browser (heidi.videos.v1) and feeds the streak.
The transcript is the platform's captions, in a language the pack accepts
(lib/channels/accepted.ts: the target, then sibling/roof bridges; never a
gloss language; automatic captions only where the pack trusts the
recogniser), and its source is printed every time: the publisher's,
automatic («bei Mundart oft falsch») or pasted. YouTube refuses data-centre
addresses the caption tracks often enough that the refusal is a first-class
state: the screen then shows the three steps to copy the transcript from
YouTube's own panel, and parsePasted reads that format, SRT and WebVTT.
Questions are written by the model from the transcript once per video, on
the first follower's request (never in the sweep — no background job spends
the free pool), refused unless every detail question cites a real line, and
shared with every follower.
Schema: channels, channel_videos, channel_follows, push_subscriptions
(drizzle/0008). Routes: /api/channels, /api/videos/[id]/{transcript,
questions}, /api/cron/channels (bearer CRON_SECRET), /api/push/*. Pages:
/channels, /channels/[video], a dashboard panel, a settings section, an
invitation on /listen. Seven dictionaries, privacy flows, HEIDI.md,
CHANGELOG. The box's hourly timer row is in loki's install-app-crons.sh;
CRON_SECRET and VAPID_* in .env.example.
Claude-Session: https://claude.ai/code/session_01RKRxpcVWoZwtg6Gfr9m6Rb
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
2093dd401a |
feat(accounts): Heidi has its own accounts; OrangeCat is one way in, not the only one (#191)
* wip(accounts): Heidi on @bitbaum/accountkit/auth (accountkit pin pending) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3 * feat(accounts): Heidi has its own accounts; OrangeCat is one way in, not the only one Email and password, passkeys and two-step codes from @bitbaum/accountkit/auth, with the shared screens in Heidi's seven languages. People whose first way in was OrangeCat keep their actor id, so no row moves. next-auth removed; the session secret falls back to the existing AUTH_SECRET. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QDMxjTqKNLXETMYYuapMa3 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
6da90a513f |
feat(investors): the investor page is the door to Heidi's room on OrangeCat (#182)
/investors stays the address people are told, with the password for people told in person. When HEIDI_INVESTOR_ROOM_URL is set on the box, the password leads into Heidi's investor room on OrangeCat (OrangeCat ADR-0012), where each investor can also get a link of their own and the founder sees who opened what. Unset (or not an https://orangecat.ch/room/<uuid> address), the page renders from investors.ts as before. The URL comes from the environment, never the repository: the link is the credential, and the room can hold what a public repo must not. investors.ts stays the one place the pitch and numbers are written, because it is the place they are checked; lib/config/investor-room.ts turns it into the room's content (scripts/investor-room-payload.ts prints it), with a test that it fits OrangeCat's limits. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cc1fcfa869 |
feat(vocabulary): rank words, show status, and start a session on the next ten (#159)
* feat(vocabulary): rank words, show status, and start a session on the next ten The page printed 226 words with up to 17 scene links each (23,217 px on a phone) and never said what to learn or what the reader knew. It now leads with the ten highest-ranked unknown words and a session on exactly those, ranks by scene frequency and non-guessability, derives new/learning/known from the learner model and kept words, opens rows on demand, and searches across accents and spelling. Adds a words practice scope. Co-authored-by: Cursor <cursoragent@cursor.com> * ci(audit): skip in-flow disclosures in the overlay audit A word row on /vocabulary opens in the flow; the floating dock passing over it on scroll was reported as a covered overlay. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
038339232d |
fix(practice): ask Heidi why; no giveaway article questions; dark mode chrome (#157)
- «Heidi fragen, warum» under every answer (practice, warm-up): question, right answer and the learner's own go to the dock over the session. - Write mode names a different FORM («schlof – schlaft»), never a respelling; «D'Chatz» is two words, so «Chatz» is no longer reported missing. - Article questions only where the Zurich article differs from the German (bridgeArticle in the pack): 37 → 5. Pool 1793 → 1761. - A kept word's sentence always contains it (saved/context.ts), also for words kept before; no more English requests under a card. - Dark mode: dock pill and avatar use float tokens, backdrops use scrim (were white). Token test and overlay audit (BRIGHT) guard both. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
b6a81848c1 |
fix(ui): header menus on top everywhere; «Mein Bereich» leads with today (#154)
- /chat unpositioned the header (position: static), so its z-index was off and its menus hung off the page, below the screen and behind the conversation list. Header is positioned again and on its own layer (45). - One layer scale held by lib/config/layers.test.ts; scripts/audit/overlays.mjs opens every disclosure in light and dark and runs in CI. - Language switcher left of the account; its panel anchors to the header row. - Dashboard: «Heute» panel (streak, due questions and words, two actions, weekly goal); empty progress panels render nothing; jump strip and duplicate CTAs removed; words one section; conversations and groups side by side. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
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> |
||
|
|
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> |
||
|
|
f0cc2f395f |
fix(sh): grep -q reads a here-string, not a pipe — no SIGPIPE false negatives under pipefail (#134)
Under pipefail, `producer | grep -q PAT` can report a miss for text that is there: grep -q exits on its first match, the producer dies of SIGPIPE, and pipefail returns 141. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
d73ac3c391 |
refactor(speech): the engine is @bitbaum/speechkit now — and grammar stops presenting a guess as the answer (#125)
* refactor(speech): the engine is @bitbaum/speechkit now — and grammar stops presenting a guess as the answer Heidi's speech engine — signal measurement, the evidence rule, fluency, hesitations, dialect markers, grammar mapping, the LanguageTool client — moved into github:bitbaum/speechkit#v1.0.0 (dist committed, no build step; npm once bootstrapped). 20 files leave this repo; 82 of their tests moved with them and run there (90 in the package). Heidi keeps what is Heidi's: which measures it CLAIMS (capability.ts), the Zurich pack's marker tests, and the product. The package reads no environment, so the route now passes LANGUAGETOOL_URL itself. THE WIRED GUARD, REBUILT. It checked that a measure's FILE was reachable from app/; once the engine is a package nothing imports its internal files. Each measure now names its entry function and the test requires something reachable to import it. Mutation-proven: dropping checkGrammar from the route fails it by name. The source-link test also now checks the file EXISTS — the old one checked only that a string looked like a path, which is how /technology linked readers to a gate.ts that never existed. The links are real links now. GRAMMAR SHOWED A WRONG CORRECTION. Measured on the live site after #123: LanguageTool offers "dem Buch" FIRST and "das Buch" second for "Er hat den Buch gelesen", and the page showed only the first — a wrong fix presented as the answer. All alternatives now, and a line saying which one fits depends on what the speaker meant (seven languages). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(investors): count the tests that moved, instead of overstating them The data room claimed 111 test files; the speech engine's 11 moved into @bitbaum/speechkit, leaving 103 here. The ratchet caught it. The figure is now 842 across 103, plus its own row for the open-source engine (94 tests, checkable at github.com/bitbaum/speechkit) — moved, not dropped. Also: ADVERTISED_TEST_FILES was declared below METRICS, so the string could not reference it and carried its own literal 111 — 'said once' was false. It is declared above and used now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
87f7e8bad9 |
feat(speaking): grammar and word-search feedback, and a claim may not outrun the product (#123)
* feat(speech): self-hosted grammar checker, and the client that says 'not checked' instead of 'clean' LanguageTool 6.8 on the box, loopback-only and memory-capped (scripts/box/provision-languagetool.sh). checkGrammar() returns null when the checker is down — never [], which would tell a learner their German was clean on the day the checker was off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(speaking): grammar wired, hesitations located, and a claim may not outrun the product GRAMMAR. The Swiss Standard German take is now checked by LanguageTool on our own box, gated on mayJudgeForm (WER within the line), filtered to what a listener would notice. null = not checked, never []. WHERE YOU HESITATED. ai-kit 1.16.0 word timings name the word that came after each long gap — usually the one being reached for. Deliberately NOT a second fluency computation: #83 measures rate and pauses on the device from the signal (the better clock), and two answers from two sources would disagree on one screen. The server adds only what the device cannot know. THE GUARD. capability.ts computed what was POSSIBLE and never asked what was WIRED, so /technology claimed grammar while nothing called it. The new test walks the import graph from app/ and requires every offered measure's module to be reachable. It found a second bug on its first run: the "words" row pointed readers at lib/variety/gate.ts, which never existed (now check.ts). Proven by mutation: detaching grammar from the route fails it by name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(speaking): grammar and hesitations on screen, and the upload the privacy page never listed ON SCREEN. A Standard German take now shows what was said and what to say instead ("den Buch → das Buch"), at most three, with "the first 3 of 5" when there were more, and where the long pauses fell ("1.8 s before «Termin»"). Not-checked renders as a sentence, never as an empty space that reads as "no mistakes". The checker's German explanations are deliberately not shown — they would leak German prose into six other locales; the pair needs no translation. The limit is printed beside the result: it catches agreement, case and verb forms, not verb position after «weil» (measured on the box). PRIVACY. /api/speaking/transcribe has uploaded Standard German takes to Groq since the transcription mode shipped, and the privacy page had no row for it — its code comment still said there was "no upload endpoint for takes". The claim lived in a comment rather than a test, so nothing noticed it go false. New flow `speakingTranscription` in all seven languages: only when you choose Standard German, audio not kept by us, grammar checked on our own server. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(speaking): name hesitations from the signal's pauses, because Whisper swallows them Tested on real audio before shipping: Commons recordings stitched as "Er hat den [1.8 s] Buch gelesen", sent to Groq whisper-large-v3-turbo with word timings. Text right, grammar error preserved — and NO gap between any words: "Buch" came back as 1.84–4.14 s, stretched across the whole pause. Detecting hesitations from word gaps would never have fired on real speech; the unit tests passed only because their timings were idealised. So measure() now records where each pause was (pauseSpans), the route returns the word timings, and the page joins them: a pause belongs to the word still being spoken when sound resumed. Same answer whether the recogniser leaves a gap or swallows it — both shapes pinned, the second with Groq's exact output. pauseSpans is a timeline of where someone went silent: needed on screen, stripped on WRITE by withTake (it would otherwise have been persisted and only dropped on read), with a test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(speaking): one file for what a pause means, after two thresholds contradicted each other on screen A real take read: 'Längste Pause 1.8 s', then 'Keine langen Pausen', then the new panel pointing at that 1.8 s. Each right by its own number. The three lengths are different things — counts as a pause (250), searching for a word (750), stuck (3000) — so they now live side by side in speech/pause.ts, and the panel says 'Wo Sie nach einem Wort gesucht haben' rather than 'gezögert', which sits honestly under 'you did not get stuck'. PauseSpan moved there too. Verified by recording real Commons audio through the real UI via Chrome's fake microphone at 390px and 1280px. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
2eabeb5f00 |
chore: remove 16 scratch scripts that rode into main, and ignore the pattern (#122)
Sixteen one-off Playwright probes under `scripts/audit/_*.mjs` reached main across eight PRs today (#113–#121), because `git add -A` swept them up with the real change each time. They were throwaway checks — "is the launcher tappable", "does the dashboard have duplicate ids" — with localhost URLs and a personal job directory (`/home/g/.claude/jobs/...`) hard-coded in them. No secrets; still litter, and a home path does not belong in a public repo. The checks that were worth keeping were already kept properly: the navigation-contract pass lives in `responsive.mjs`, and the rest became unit tests (`dashboard-ids`, `dialect-lang`, `glued-text`, `explanation`, `store-contract`). What is removed here is only the scaffolding. `scripts/audit/_*` is now gitignored, so a leading underscore reliably means "scratch" and cannot be committed by accident again. Checked: a new `_probe-test.mjs` is invisible to `git status`. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
3183e476c6 |
feat(vocabulary): 70 more words, slang with its register, and no more stitched words (#121)
Reported: "this page is not great … full of frankenstein words. also, there are just not enough words … there should be more words for different situations, etc, including slang." Asked twice, after I had raised the native-review concern both times — so it is decided, and done. Both packs remain `nativeReviewed: false`, and the page says so. THE FRANKENSTEIN WORDS WERE MINE. The pasted page read, to anything that reads text rather than pixels, "DachbodenNicht: Fussbodenbelag", "HausschuheNicht: Finken, die Vögel", "umziehenNicht: zügeln". Those are the false-friend trap lines from #112: a meaning and a note as sibling inline spans separated by a CSS margin and no space — pixels fine, words stitched. #113 moved the trap to its own line. This change nearly did it again with the register tag ("FrankenUMGANGSSPRACHLICH") and was caught looking at the page text; `glued-text.test.ts` now requires a real space before any inline tag after the meaning. Mutation-tested. Two glosses were also genuinely invented words: "Vormittagssnack" and "Nachmittagssnack", English glued into German compounds that do not exist. Now "zweites Frühstück" and "Zwischenmahlzeit am Nachmittag". "Paprika (das Gemüse)" is "Paprika" — the trap line already rules out the chilli. 95 -> 164 WORDS: function +20 mängisch, öppedie, gliich, zerscht, susch, dänk, gnueg, vill, nüt, niemer, dört, ufe, abe, ine, use, zrugg, ewäg, öb, wil, wänn verbs +15 gseh, ghöre, gä, neh, tänke, sölle, dörfe, chaufe, zale, trinke, schlafe, hocke, verzelle, choche, gumpe false friends +2 lose (zuhören, not "das Los ziehen"), springe (rennen, not "hüpfen") everyday +15 Gipfeli, Weggli, Härdöpfel, Anke, Nidle, Chäs, Schoggi, Zibele, Kafi, Beiz, Stange, Waschchuchi, Stäge, Chopfweh, Buuchweh greetings +3 en Guete, Proscht, Tschau slang +14 Stutz, Chlotz, Büez, chrampfe, Seich, mega, gheie, schiffe, Hopp (casual) · Grind, Schnure, Löli, huere, Gof (rude) Every spelling passed the pack's own Zurich-forms gate first time. The one collision was `ässe` (to eat) against the noun `Ässe` already present — one string once case-folded, which the page's rule treats as one word; the verb went. SLANG CARRIES ITS REGISTER, by rule. `register: "casual" | "rude"` is a closed key rendered in seven languages. The meaning of `huere` is the easy half; that it is warmth among friends and an insult to a landlord is the half a learner cannot audit, and nothing in the word tells them. A test refuses a slang entry without a register — and a register on a neutral word, because a label on everything is a label on nothing. Mutation-tested. THE PAGE'S THESIS HOLDS WITHOUT A NEW EXCEPTION. The vocabulary test requires function words and verbs to outnumber the rest, so the page never becomes a phrasebook. 35 of the 70 are function words and verbs: the rule is satisfied by adding more of what the page is FOR, not by carving a second exception into it. Slang sits after everyday nouns and before greetings in the page order. Verified: verify exit 0, 897 tests; the slang section screenshotted. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
922b6610d2 |
feat(chat): "Daraus lernen" — one tap on what a learner asks next (#120)
Asked for: "ai chat should be better in terms of predicting what next request would be and hence allowing for one tap next action … if it's a word, synonyms, antonyms, word in context, short text". `moves.ts` already offers what to DO with a message — reply to it, say it warmer, firmer, in the written standard — and the model picks those. Nothing offered what to LEARN from it. Now every answer that contains something to learn ends with a second row beside "Und jetzt?": a Zurich line in the answer → Wort für Wort a word that is genuinely → Ähnlich und Gegenteil, Kurzer Text damit, not the German one In anderen Sätzen (three at most) DECIDED WITHOUT THE MODEL. `learnMoves` reads the answer's STRUCTURE — a `dialect` line, a gloss whose form is not merely the German word respelled — for the reason `withReply` already states in `moves.ts`: "the harness has to be better than the model at this". A model on a free chain having a bad minute forgets an instruction; an answer that holds a Zurich line always holds one. A plain explanation with neither gets no row at all, because generic chips under every answer are a toolbar — what `moves.ts` removed the mode switch to avoid. THE SAME SENTENCES AS THE PRACTICE SCREEN — ONE COPY. #117's explanation already had "ask Heidi" sentences in `practice.explain`. Building this naively would have put the same five sentences in two namespaces, seven languages each. These ARE chat messages, so the chat owns them: `chat.learn`. They were MOVED out of `practice.explain`, not copied, and the practice explanation now reads them through a `learnT` prop — a tap after a drill and a tap in the chat send the identical sentence. Each chip sends through the conversation's own `send`, as every move does, so it lands in the transcript as the learner's visible message — no hidden prompt channel. Checked in a browser against a mocked answer: the row reads «Daraus lernen · Wort für Wort · Ähnlich und Gegenteil · Kurzer Text damit», and the tap sends a second request whose `input` is «Welche Wörter sagt man in Zürich ähnlich wie «gaht's» — und was ist das Gegenteil?» with the whole conversation as history, so Heidi answers it in context. Verified: verify exit 0 — 900 tests. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
b5550e9694 |
feat(chat): Stop and markdown — the two gaps the fleet chat standard lists for Heidi (#119)
`fleet/SHARED.md` → "Chat — the standard every chat meets" records Heidi's chat as missing exactly two things: "stop, markdown — best voice and font size". The standing rule is to meet the checklist before adding anything to a chat, and the next PR adds to this one. So these first. STOP (item 4). Every transport accepted an abort `signal` and nothing ever passed one: a slow answer could only be waited out. `use-conversation` now holds an `AbortController` per turn and exposes `stop()`; the composer's send slot becomes Stop while a turn is in flight, as in the reference (loki `Composer.tsx`), so the control is where the eye already is. THE PARTIAL TEXT IS DISCARDED, and that is specific to Heidi. The streamed preview is the model's text BEFORE the variety gate has read it. Keeping it as an answer would make Stop a way to publish Zurich German nobody checked — the one thing every answer here is built to prevent. What stays is the learner's question and a bubble saying why, with Retry (item 5). Checked in a real browser with `/api/chat` held open: Stop appears in the send slot, pressing it aborts the request (Playwright sees it fail), the bubble reads «Angehalten. Die halbe Antwort ist verworfen …», the question is kept and Send comes back. MARKDOWN (item 7). Free-text answers — what a learner gets for "explain this word by word" — were printed as one raw paragraph: a model's `**äbe**` arrived as asterisks and its list as one run-on line. Now parsed by bip-kit's `parseContentBlocks`, which Heidi already depends on — the fleet wants ONE parser, not a 13th tokenizer — and drawn with Heidi's own tokens, since markup stays per app. Headings become bold lines, not `<h2>`s, so a model cannot insert sections into the page outline; images, embeds and charts a model writes are never rendered, because that would let model output load an arbitrary URL; links go through `safeHref` and open with no referrer. Checked in a browser against a mocked answer: strong, em and list items render, the link carries `noopener noreferrer nofollow`, no literal asterisks. AND FOCUS IN INK. The composer, focused, showed two nested red rectangles — a red `focus-within` border around a red focus ring — for the whole time somebody types. #113 kept the red ring on purpose; the screenshot is the evidence that was wrong for text fields, where focus is the normal state, not a moment. The global `:focus-visible` ring is now ink (21:1 on either surface), and five `focus:border-accent` fields follow it. The repo's type-scale guard caught an arbitrary `text-[0.95em]` I had written into the code style — a correct catch; it is gone. Verified: verify exit 0 — 895 tests. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
994872e069 |
feat(practice): every answer explains itself — rule, context, word, and what next (#117)
Reported after a translate item: "when i answer questions, i need to see
explanations and be able to practice it. this is not an explanation for that
exercise … explanation of words, grammar, or how it is said and how else it
could be said. if it's a word, synonyms, anonyms, word in context, short text".
It was not an explanation. The only one in the practice UI was a single line
— a topic's title and rule — inside the multiple-choice verdict. Translate,
reveal and card never rendered it; they did not even receive the grammar
dictionary. So the reporter, having typed a sentence about modal particles,
was told only that Zurich German has no fixed spelling. The test review, which
promises "alle Antworten mit Erklärung", showed a link.
WHAT EXPLAINS AN ITEM is now decided once, by `explanationFor` — a pure
function over the item and the published packs — and every one of the six
places a question can be answered renders whatever it returns. Measured
against all 587 published items: before, most showed nothing; after, none do,
and `explanation.test.ts` pins that. Each part appears only when it has
something true to say:
Die Regel the topic's rule AND its "Wo es hakt" line — the grammar
page's own words, so the two cannot drift — plus "drill
exactly this".
Im Gespräch the line with the lines before and after it, from the actual
situation. A sentence from a handover means something
different alone.
Das Wort meaning, article, forms, example, the false-friend trap, and
the other situations it is said in.
Heidi one tap for other ways to say it, similar words and the
opposite, a short text using it, or word by word.
THE LAST PART IS THE MODEL, AND SAYS SO. Synonyms, opposites and short texts
are not in the packs and were not invented into them: both packs are
`nativeReviewed: false`, and forty synonyms per word written without a Zurich
speaker would be unreviewed content wearing the costume of reference. They go
to the chat as an ordinary message the learner sent, and the note under the
buttons says whose answer it will be. Checked in a browser: the tap opens the
dock with «Erklär mir «Äbe, gnau das han ich gmeint.» Wort für Wort.» and
Heidi answers.
WHAT WAS LEFT OUT, NEVER HOW IT WAS SPELLED. The reporter wrote «Ebe, das han
ich gmeint» against «Äbe, gnau das han ich gmeint» and was never shown that
«gnau» was missing. `missingWords` folds case and diacritics and treats words
within a small edit distance as one word, so «Ebe»/«Äbe» and «Si»/«Sie» are
the same and only a genuinely absent word is named — §6 intact. It reuses the
existing `distance` rather than adding a second one.
MY OWN INCONSISTENCY, FIXED. The modal-particles topic I added in #112 spelled
the particle «eba»; the vocabulary spells it «äbe». Two spellings of one word
is what the pack promises never to do — and the spelling note then reassured
the reporter about THEIR spelling while mine was the inconsistent one.
AND TWO THINGS FOUND ON THE WAY:
- `PROMPT_TEXT` carried the dialect colour, so a translate item's GERMAN
prompt was painted as Zurich German. Two colour utilities on one element
do not override by class order, so the constant is now colourless and
each call site states its colour beside its `lang`. The dialect-lang
guard's exemption for it was stale and is removed.
- `explainingTopic` and the new `topicOf` would have been two copies of one
precedence. There is one; the old name re-exports it.
Verified: verify exit 0 — 892 tests; the reported flow reproduced in a
browser; a situation item checked at iPhone 13 width, no sideways scroll.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
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>
|
||
|
|
0b4f5bb8b4 |
fix(mobile): the chat button says what it is (#115)
Reported from a phone: "chat with heidi should be available from any screen
from mobile as it was before in bottom right".
It was there — mounted on every page, measured visible and tappable at
375px — but as an UNLABELLED black square. The label collapsed to
screen-reader-only below `sm`, on the reasoning that a phone's width "is
already spoken for". That is true of the header and false of the bottom
corner, which is empty. Next to it sat the Loki feedback pencil, a second
unlabelled float a thumb away. Nothing about the square said "Heidi".
Now named at every width: "Heidi fragen", 136px, in a corner nothing else
uses. And the Loki pencil is placed above it on purpose (`data-fc-bottom`,
which the widget supports) instead of stacking wherever its default lands.
TRIED AND DROPPED, because it measured nothing. I added bottom padding to
`main` to stop the button covering the last control on a page. Measured at
rest — on arrival, and scrolled to the very end — across eight pages, before
and after: identical. Pages end in the footer, which was already clear, and
the one control under the button on arrival ("Test" on /practice) sits at the
bottom of the FIRST screen, which padding cannot reach. A fix the evidence
does not support is not shipped. My first metric was also wrong and is worth
naming: it counted controls under the button at ANY scroll position, which is
true of every floating button ever made.
Verified: verify exit 0, 880 tests; screenshotted at iPhone 13 width.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
6826743401 |
fix(portal): Mein Bereich answers "what do I do now" — and stops promising (#114)
Asked: "how much here is dysfunctional and does not have anything behind it. why some things are promises but not actionable". Audited section by section, by reading what each one reads and measuring whether it can ever fill: Daran hängen Sie gerade works — as of #111. Before it, EMPTY FOREVER: the learner model was discarded on every load. Zum Wiederholen works, and already offers three doors when nothing is due. Unchanged. Weitermachen works. Was Sie jetzt können same decoder bug — could never show anything until #111 — and its empty state was a paragraph with no button. Now it has one. Was Ihnen … begegnet a promise with almost nothing behind it. It knows FOUR sound rules, which explain 11 of the pack's own 95 words (12%), and needs two of yours to share one. The reporter has five saved words; its empty state told them to come back "once you have kept a few words". Measured, not guessed. Jump strip broken anchors: see below. WHY THE PROMISES. Each panel was built to describe a state, and its empty state was written as an explanation rather than a next step. Honest, and inert. The patterns panel is the clearest case: it once rendered nothing when empty, and was changed to explain itself BECAUSE the jump strip advertised "Muster" and the link landed on nothing. The advertisement was the defect. The strip no longer lists it; the panel renders nothing when empty and appears in place the day it has something to show. WHAT WAS ADDED: the per-situation strength map (#111) now leads the page. It is the one panel that answers "what should I do now" by construction — every row is a link and it names the weakest situation you have started — and it renders nothing until something has been practised, so it adds no promise. DUPLICATE IDS, SIX OF THEM. `focus`, `recent`, `words`, `groups`, `mastered` and `patterns` were each the id of a section AND of the heading inside it, and `review` was the target of its own `aria-labelledby`. The jump strip links by id, so its anchors landed wherever the browser chose, and a screen reader was told each section was labelled by itself. Invisible to every existing check: the page only renders signed in, the panels mount after hydration, and server HTML for a signed-out request contains none of them. `dashboard-ids.test.ts` scans the page and every panel it places — its first run found `focus`, which I had missed. Mutation-tested. NOT VERIFIED IN A BROWSER, and saying so: this page only renders for a signed-in reader, there is no local session, and I did not add an auth bypass to get one. Checked by type-check, the id guard, and the fact that the map is the same component already screenshotted on /situations. Verified: verify exit 0 — 882 tests. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
7f274cd0ec |
fix(ui): red goes back to meaning one thing (#113)
Reported: "ui/ux could be better. why so much aggressive red".
The design had already answered this, in `globals.css`: "Swiss red, and the
only colour in the product … reserving red for the isogloss is what keeps it
meaningful." It was right, and usage drifted away from it until flag red meant
button, selected, error, label AND dialect at once. One practice screen showed
three solid red blocks — the selected mode, the selected style, the question
itself — before the learner had answered anything. A colour that means five
things means none of them, and shouts all five.
So the hue stays, still the only colour, and each MEANING gets a role:
--color-dialect flag red -> a deep red INK (#9b1c22 / dark #ec8a8f).
Still the isogloss, read like a dictionary's second ink
rather than an alarm — and more legible: 8.1:1 on white
against flag red's 5.0:1, 7.9:1 in dark.
--color-action NEW, black. 40 filled red buttons and selected states.
--color-danger NEW, flag red — errors, and "this form is not Zurich".
Red where alarm is the right message, said by name.
eyebrows 20 mono-caps labels at the top of pages: red -> grey.
Measured, elements rendering in flag red: /practice 4 -> 0, /vocabulary
113 -> 0, home 17 -> 6.
A CORRECT ANSWER WAS PAINTED IN THE COLOUR OF WRONG. `exercises/chrome.tsx`
rendered the verdict `right ? "text-accent" : …` — the right-answer message in
red. Now `text-ok`.
KEPT RED, deliberately: the record button (red is what recording looks like),
status dots, the active-nav underline, the focus ring, the "live" marker, and
thin 2px rules beside callouts and quotes — a restrained editorial accent,
which is the job red should be doing.
AND THE ISOGLOSS KEEPS FLAG RED, which my own guard taught me. I had moved
`correspondence-figure.tsx`'s highlight to the dialect ink; `dialect-lang.test`
(from #105) failed on it, and reading why showed the change was wrong in a way
the test did not even name: the figure marks the sound that CHANGES on both
words — Kind -> Chind — German side included. That is the isogloss itself, the
one thing the token comment reserved red for. Reverted, with the reason
written beside it.
The vocabulary trap line ("Nicht: Fussbodenbelag") also moves to its own grey
line: inline, it read as "DachbodenNicht: Fussbodenbelag" to anything that
reads text rather than pixels.
Verified: verify exit 0, 880 tests; audit:responsive 58 renders light+dark,
0 overflow; /practice and /vocabulary screenshotted before and after.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
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>
|
||
|
|
38bd697d45 |
fix(i18n): one notice for "this is not in your language", and no skip list (#102)
/rm/paper was Romansh chrome — «Controllai Vus svess», «Funtaunas» — wrapped around an English argument, with nothing saying why and no `lang` on the English, so a screen reader read it with Romansh phonology. Reported as evidence of no SSOT, correctly. THE SITE HAD ALREADY SOLVED THIS. `/essays/[slug]` has done it properly since it shipped: name the language the reader is actually getting, and put `lang` on the text. Then `/paper`, `/roadmap`, `/changelog` and `/organisations` were built without it, and `/contribute` invented a THIRD variant — a fixed sentence that did not even name the language. One concept, three implementations, four omissions. `OtherLanguage` is the one component now, and the essays page — which was right first and stayed alone — uses it too. That half matters: leaving the original in place is how the two drift apart again. Two reasons, because they are honestly different and a reader can act on the difference. `untranslated` for an essay, which may be translated later and where "yet" is a promise we can keep. `byDesign` for the argument pages, which are German and English because the reader they address lives here — and implying that might change would be the friendlier lie. AND THE SKIP LIST IS GONE. `audit:language` held six exempt pages, which meant it could not see the pages most likely to show a reader the wrong language — it had no chance of finding this bug. Those pages now MARK their content, so the existing rule handles them with no exception: text that declares its language is not a leak, text that does not is one, whatever page it is on. Marking them turned up two more surfaces the notice alone would have left wrong — the sector cards and the three steps on /organisations, both de/en, neither declared. The audit found both after the exemption was removed. 20 pages × 6 locales, 0 English. The `lang` attributes are not bookkeeping: they are what a screen reader needs to pronounce an English paper title on a Romansh page. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
6c9e68ed21 |
One section rail, no English leaking into six languages, and a menu that scans (#99)
* fix: one section rail, no English leaking into six languages, a menu that scans
Six reports. The language one is a correctness bug and goes first.
«CANTON OF ZURICH» ON THE GERMAN SITE. `region` was "Canton of Zürich,
Switzerland" and `name` was "Zurich German" — English sentences in the variety
pack, surviving the display projection, rendered in the footer of every page
in every language and on /about. `family.name` ("Swiss German") the same.
`display.ts` exists to stop exactly this and its own header lists three prior
escapes. These got through because a name and a region read as DATA until you
try to say them in another language. An endonym really is data — «Züritüütsch»
is what it is called in Russian too, because it is what the speakers call it.
An exonym is a translation that happens to be English.
All three are out of the projection. The reader-facing versions live in the
dictionaries with every other sentence, and `display.test.ts` now asserts the
projection's keys EXHAUSTIVELY — an allow-list fails when somebody adds a
field, a deny-list passes until somebody adds the wrong one, which is how
these survived three previous rounds of this lesson. Proven by mutation.
ONE SECTION RAIL, NOT TWO. `dashboard-nav` already did this job — sticky rail,
current section marked, counts, wraps instead of scrolling sideways — and
`page-toc` was written for the white paper days later without checking. Two
vertical rails behaving differently on the same viewport. Reported, correctly
and not for the first time: we shouldn't be reinventing the wheel.
The older one won on merits: it marks the current section and carries counts.
The newer one contributed only the two-column frame. Everything now uses
`section-nav` — the personal space, the paper, the listening catalogue — at
the same width, which the dashboard did not share before either.
No fleet package owns this shape; checked, not assumed. bip-kit has a
`TocEntry` but it is a markdown heading carrying a `level` of 2–4, and these
are arbitrary page regions, some counted. Forcing `level: 2` onto "Groups · 1"
would be bending a contract to look compliant. Noted in the file as the
extraction candidate if a third product wants it.
NINE UNSTRUCTURED ENTRIES UNDER ABOUT. Routes now carry an optional `section`,
and the panel renders three headings of three — how it works, what we say, who
is behind it. A fifth top-level group was the obvious fix and the wrong one:
the header note records the bar overflowing by 10px at 1024 in three
languages.
THE AVATAR MENU HAD NO DASHBOARD IN IT. It said who you were signed in as and
offered Settings. It now leads with your own space — labelled `portal`,
pointing at the locale root, because /portal only redirects and a test forbids
navigating through it.
AND «HEUTE NICHTS FÄLLIG. KOMMEN SIE MORGEN WIEDER.» A dashboard whose main
panel tells you to leave is a dashboard with no reason to exist. The schedule
is untouched — a word due Thursday is not dragged forward, because asking
later beats asking more often. What was wrong was treating an empty QUEUE as
an empty PRODUCT: there are 553 practice questions needing no schedule and no
account. Three doors now: a short sitting, cards, or paste a message.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* feat(audit): a check for English on the German page, and the leaks it found
"There may be a mess with languages, and I want you to really ensure that
there is no mess anywhere." `pnpm run audit:language` is how that gets
answered repeatedly rather than once.
HOW IT DECIDES. Closed-class English function words — the, and, which, from,
between — matched against the rendered text of every indexed page. Function
words are the right detector because they cannot be a loanword or a brand: a
German page carries "Chat", "Podcast" and "Whitepaper" quite legitimately, and
none of them is "which".
IT READS THE WHOLE PAGE, header and footer included, and that is the point. It
scanned `<main>` at first to avoid flagging the language switcher — which
would have meant it could not find the bug it was written for, since `region`
printed in the FOOTER. The switcher is handled properly instead: its links
carry `lang`, correct HTML for a link whose text is a language's own name.
Anything that declares its own language is skipped. A bibliography is the case
this exists for — a German page citing "Mutual intelligibility between closely
related languages in Europe" is right, translating a paper title makes the
reference unfindable — so citations now carry `lang="en"`, which is also what
a screen reader needs to pronounce them.
WHAT IT FOUND, beyond the reported one:
privacy `Flow.where` carried English qualifications appended to technical
identifiers — "downscaled in the browser; only a count is stored",
"the confirmed sentence only". Real privacy statements, printed in
English to every non-English reader. They are translated now and
`where` is identifiers only. The first attempt blanked a row and
`privacy.test.ts` caught it: a flow a reader cannot verify is
worse than no row, because the table reads as exhaustive.
contribute German and English roles under a French heading, with nothing
saying why. The reasoning is the sector page's — these recruit
people who live here — but a reader should be told, which the
essays page settled long ago. It says so now, in their language.
Five pages render English by decision and are skipped by name with the reason
written down, not because they were inconvenient.
AND THE GATE CAUGHT ME. The Swiss German note I wrote said «Tütsch»; Zurich
says «Dütsch», and `gsw.test.ts` refused it. The product's own dialect gate,
run against the product's own copy.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
||
|
|
78a9495723 |
feat(speaking): a harness that drives the microphone, and the bug it found (#96)
"I don't think that the speaking part works, at least with regards to the dialect" was answered with a question — what did you see? — when everything needed to find out was already here. This is the answer instead. THE HARNESS. `pnpm run audit:speaking` drives /speaking in a real Chrome with a fake microphone, for every variety, at two lengths, and reports whether audio is FLOWING (the level meter moves — the one DOM signal that separates recording from a button that changed colour), whether /api/speaking/transcribe was called, what it answered, and what the page then says in words. It makes its own audio. Chrome's synthetic tone peaks near −50 dB and this product's `AUDIBLE_PEAK_DB` floor is −45, so every synthetic take is `too-quiet` — measure with it and a variety that transcribes reports as one that does not, which is the harness blaming the page for its own microphone. Pink noise under a 4 Hz tremolo is loud, has a syllable-ish envelope, and is not pretending to be speech. `AUDIO=real.wav` for transcript QUALITY, which nothing generated can tell you. BOTH LENGTHS, ALWAYS, because either alone proves nothing: "not called" is also what a completely broken upload looks like. The pair is a truth table with one bad row. WHAT IT FOUND, on the first run, against production: Züritüütsch never transcribes — by design, and the page says why Schweizer Hochdeutsch BROKEN A 1.5-second take — under MIN_USEFUL_MS, which this product itself calls too short to say anything about — was uploaded and came back as «Bis zum nächsten Mal.» Four words nobody said, printed under "this is what we heard", counted into the word total, and stored on the take. That is not a broken service; it is what a Whisper-family model does with audio containing no speech. On a phone held in a corridor it is an ordinary case. THE FIX needs no new judgement, because the page already makes it. `usable()` asks "is there enough here to say anything at all", and `deliveryNotes` and `spokenNotes` both go silent when the answer is no. The transcript was the one thing ignoring it — so the product would withhold its own honest measurements of a false start and then print an invented sentence about the same audio. It is derived, not stored, and the take is never uploaded: no audio leaves the device for a recording we have already decided we cannot read. `transcribable-take.test.ts` holds the invariant in milliseconds on every commit. It failed first for the right reason — `recordingNotes` SHOULD speak for an unusable take, because it is the note that says why there is nothing to measure — and the corrected version states that distinction. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
6923761bbb |
fix(smoke): /portal redirects now, and the check still asserted 200 (#93)
The deploy of #92 went out and the post-deploy smoke failed — correctly. The dashboard moved back to the locale root, `/portal` became a redirect so that `/` and `/portal` stop rendering the identical page, and this file still expected 200 there. Worth being precise about what failed: `deploy / heidi → bitbaum` succeeded and the site has been serving `c61cb12` throughout. Only the assertion was stale. It now asserts 307 rather than dropping the path, because "it redirects" is the behaviour worth pinning: a future change that quietly restores a second copy of the dashboard at this address should turn this red. 307 and not 308 — the page could come back, and a permanent redirect is the one browsers refuse to forget. Verified against production: smoke: all good. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
c61cb1229a |
Navigation that says what things are, a fourth exercise kind, typing, and a dashboard that answers what to work on (#92)
* fix(practice): the page promised eight questions and a scoped sitting can be one Reported from the live site. `/practice` said "Acht Fragen" — in seven languages, with "Nochmals acht" on the button under it — while a session is `min(SESSION_SIZE, whatever the scope holds)`. So `?topic=question-words` is four questions and `?group=greetings` is ONE, under a page that had just promised eight. Not stale copy waiting for content to catch up: false on arrival, from the day scoped sessions shipped. `i18n.test.ts` already had the guard — it was written when the grammar lead said "Vier Dinge" and a fifth topic made it false in seven languages at once — and it only ever looked at `grammar.lead`. It now covers the practice lead and the restart button too. The guard then caught the replacement copy: `set` was in the counting words because it is seven in Romansh, and "a short set of questions" tripped it. Same call as `sei` before it — a guard whose failures are usually wrong is the one that gets switched off — so `set` is out, with the reason written down. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(nav): start and chat were the same screen, and "look up" was the wrong word for the material Five defects, all reported from the live site. START AND CHAT SHOWED THE SAME THING. Signed in, `/` rendered the identical `ChatWorkspace` as `/chat`, and the bar named both. Two doors onto one room is worse than one door: a reader reasonably concludes one of them must do something else and goes looking for the difference. The dashboard component's own comment still recorded the original framing — "once we build dashboard, start could be dashboard" — which a later change overrode without updating it. Signed-in `/` is the dashboard again. The argument for chat-at-root was that a conversation beats a summary of conversations; it is a good argument that answered the wrong question, because the chat is not hard to reach. It is the second item on the bar, always visible, never in a panel. `/portal` now redirects to `/` rather than rendering a second copy of the same dashboard, because that was the same duplication one pair along. The route stays for the bookmarks and for the sign-in return; only the menu entry went. "NACHSCHLAGEN" WAS LABELLING THE WHOLE TEACHING MATERIAL as a dictionary — eleven grammar topics, eighty-three words, fourteen scenes. The groups are now `learn` (situations first, then grammar, dialects, words), `practise` (exercises, speaking, listening) and `about`. `practice` had been sitting under `use`, one panel away from the material it practises, so the loop this product is built on was split across two menus. `essays` is called Blog, because that is what it is. It was "Lesen" / "Reading" under About, which reads as a skill filed in the wrong place. TWO BUTTONS ON A GRAMMAR TOPIC read "Practise this topic" and "Practise this" and did completely different things. The second asks Heidi for example sentences, so it says "More examples" — which also makes that affordance findable, since the complaint was that there are not many examples. PRACTISING A TOPIC TOOK TWO CLICKS from the index. Each card now carries its own practise link, which meant turning the card from one `<Link>` into a card with two destinations: an anchor inside an anchor is invalid, unreachable by keyboard, and read as one control by a screen reader. verify green (800 tests); responsive audit 522 renders, 0 overflow. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat(practice): a kind for the words nothing could ask about, and typing that is not marked PICK — a real pack sentence with one word cut out and four real words offered. It exists because of a measurement rather than a hunch. The twenty-six function words produced SIX questions between them: they carry no article and no paradigm, so the only generator that could see them was the matching grid, and a grid asks four at a time. They are the words `/vocabulary` argues buy the most comprehension, and they were the least practised thing in the product. Function-word questions are now 32, and the pool is 221. What makes it objective is the German printed underneath. Several options will produce a perfectly good Zurich sentence — that is what function words are like — and exactly one makes the sentence mean THAT, so the learner can check the verdict against the evidence rather than take it. The distractors are filtered by a rule worth naming: a candidate's own gloss must not appear in the bridge. Without it the generator eventually offers `nüme` ("nicht mehr") against a German line containing "nicht mehr" and marks a defensible answer wrong, which is the one thing an objective item may never do. A test asserts both halves. TYPING, AND IT IS NOT GRADED. The reveal button used to be the only control on the self-marked kinds, so the retrieval this page exists for could be skipped in a keystroke. There is now an optional field to write the answer in first. Nothing compares what was written to what the pack says. §6: a machine that judges typed dialect eventually tells somebody their spelling is wrong when it is not, in a variety where they cannot argue back. The two are shown one above the other with no verdict between them — same information, none of the false authority. THE ADOPT PROMPT, reported as odd, and it was odd for two reasons. It said "you wrote something before you signed in" and then named nothing — no line from it, no date — while a draft survives in the browser indefinitely. And it fired on a draft containing no turn of the learner's at all, because the condition was `messages.length`: an assistant message alone was enough, so Heidi could offer to keep a conversation nobody had written. It now requires a real message of theirs and shows its first line with the date. A bug the new tests found rather than review: `pick` located its word case-insensitively and then asked `blank()` to remove it, which matched case-sensitively — so `mir` was found in «Mir händ …», reported present, and left standing in an item claiming to have a gap. Blanking now folds case, which is also right on its own terms. verify green (805 tests); narrow responsive audit clean at 390px. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat(dashboard): the front door says what to work on The page answered "what is owed" — a review schedule is a deadline, and deadlines are easy to render. It never answered "what am I actually bad at", which is the question somebody opens their own page to ask and which the product only learned to answer when the learner model shipped. The focus panel now leads the dashboard, above the words that are due. It renders nothing until it has something to say — `weakest` refuses to name an area on fewer than two answers — so a first visit shows no panel rather than a placeholder promising one later. No number appears in it, per §8: the diagnosis names the material and offers a session on it, and never scores the person. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
5f525eff9e |
feat(speech): evaluation that measures what it can and refuses what it cannot (#78)
* feat(speech): the rule that decides what a transcript may be evidence of
`lib/voice/correction.ts` arrived at the Swiss German case first and stated it
exactly: dialect recognition transcribes INTO Standard German, so a learner who
says a flawless Zurich sentence gets back `ist` and `nicht` and possibly a `ß`,
none of which they said. Judging their grammar from that bills the recogniser's
output to the learner.
What this adds is that the rule is not about Swiss German. It is about a
property that differs per variety:
A transcript is evidence about the speaker's WORDS only when the recogniser
returns the variety that was SPOKEN.
Stating it that way is what makes the surface safe to switch ON where the
property holds. Standard German recognition returns Standard German; the
transcript is then the learner's own words and grammar, vocabulary and speech
rate become measurable rather than invented. `evidenceFrom` answers `none`,
`meaning-only` or `words`, and a test asserts that a dialect recogniser at 0%
WER still answers `meaning-only` — accuracy was never the objection.
Three measures that need a transcript, and could not exist before it:
syllables.ts counts vowel groups. It was written with a digraph table —
au, ei, ie, äu — and the tests showed every entry was a no-op,
because German writes its diphthongs as adjacent vowels and the
group scan had already merged them. The list was machinery that
looked like knowledge, and it is gone. Its two real errors,
`Familie` and `Bayern`, are pinned AS TESTS so nobody reads the
measure as exact.
fluency.ts speech rate, articulation rate, mean length of run, silent and
filled pauses. The two rates together say what neither says
alone: equal articulation with unequal speech rate is somebody
who has the words and is hunting for them.
pause.ts one definition of a pause, imported by both halves. Two
thresholds would have the signal half and the transcript half
report different pause counts for one recording, with nothing
failing.
NO NORMS, and there will not be any. No table of what a B1 speaker's syllables
per second should be: applying one to an adult talking about a topic they chose,
on a phone, in a language nobody normed for this, is the false precision §8
forbids wearing scholarship. Every number is reported as itself and compared
only against the same learner's own earlier takes — which is also what makes the
syllable rule's consistent bias harmless.
Nothing here names a language and nothing here calls a vendor.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): grammar findings, and the filter that keeps them the speaker's
LanguageTool rather than a model, for three reasons and the third decides it:
it runs on our own box (LGPL-2.1, a Java REST server, no vendor, no per-call
cost, nothing leaving the machine); it costs nothing per call, so grammar is
not rationed the way a model answer is; and it is the same KIND of thing as the
variety gate — a rule with an id, the same input giving the same output, and a
finding somebody can argue with. §6 exists because a model must not be the sole
judge of language the learner cannot audit, and that argument does not stop
being true for grammar.
THE FILTER IS THE FEATURE, not tidying.
The text came from a recogniser, so parts of it were never the speaker's.
Punctuation, capitalisation and spelling are the MACHINE's decisions — nobody
pronounces a comma and there is no way to hear a capital letter. A checker run
over the transcript flags all three happily, and every one of those findings
bills the recogniser's choices to the learner: the exact failure
`voice/correction.ts` names for dialect forms, arriving by a different road.
So TYPOS, CASING, PUNCTUATION and TYPOGRAPHY are dropped, and a test asserts
none of them can ever appear. STYLE and REDUNDANCY are dropped too — they are
opinions rather than errors, and redundancy is doubly wrong for speech, where
repetition is how people buy thinking time. What remains is what a listener
would actually notice: agreement, case, verb placement, confused words.
A second list excludes by rule id the rules that are right about writing and
wrong about speech, starting with the one that wants a capital at the start of
a sentence nobody capitalised. It is deliberately three entries long and is
meant to grow from watching real transcripts — a long list written up front is
guesses wearing the authority of a constant, and the fleet's own rule is that a
capability is observed, not declared.
Three findings maximum, in reading order. Somebody who has just recorded
themselves speaking a language they are bad at needs the few that matter and
the willingness to press record again tomorrow, not a marked-up essay.
Pure: the HTTP call belongs in a route; this file maps and filters. Proved by
mutation — admitting TYPOS to the allowlist fails the two tests that exist to
stop exactly that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(pitch): task repetition, and a unit-economics model that admits what it is
TWO THINGS, and they are the same argument in different currencies: say what
is measured, label what is assumed, and never let the second wear the clothes
of the first.
TASK REPETITION (lib/speech/repetition.ts)
Nation's 4/3/2: tell the same thing three times, to a fresh listener each
time, in four minutes, then three, then two. Speaking rate rises across the
deliveries and hesitations fall — consistently, and replicated.
It is the right exercise for THIS product rather than merely a good one,
because the outcome the research measures IS `fluency.ts`. Speech rate and
hesitation count are not a proxy we invented for something we cannot see; they
are the published dependent variables, and we compute them from the learner's
own recording. There are very few closed loops like that in language learning.
What the evidence supports is kept apart from what it does not, per §3: the
rise WITHIN a session is the FACT and is what a learner will see here; that it
transfers to a task they have never told is the HYPOTHESIS, and it is the one
that would matter most. So the copy can say "you got faster at saying this"
and must never say "you got more fluent" — the first is measured, the second
is a claim about a person.
The clock is a parameter, with Nation's original and a phone-sized ladder both
named, because "we used 4/3/2" and "we used a scaled version of it" are
different sentences and only one is true here. And the ingredient a phone
cannot reproduce is stated rather than quietly dropped: the third is a NEW
LISTENER, which a speaking round has and a solo take does not.
UNIT ECONOMICS (lib/config/economics.ts)
`investors.ts` holds things true today that a reader can check. This is the
opposite kind of number — nothing here has happened — so it is a separate file
that says so, and every input carries where it came from.
CAC is not estimated. We have never spent a franc, so any figure would be
invented; what is computable is the CEILING it must come in under, which is a
testable target rather than a hopeful one. At the modelled inputs: CHF 10.20
contribution a month, CHF 127.50 LTV, CHF 42.50 CAC ceiling, payback just over
four months.
The headline is published beside its range rather than alone, because the
business turns on churn — LTV moves from 85 to 204 across plausible values —
and one figure invites belief where three invite the question worth having.
The sensitivity table and the headline call the same function; two
implementations of one formula is how a deck contradicts its own appendix.
`NOT_MODELLED` names the holes, which is where a model's credibility actually
lives.
The market is anchored on a published count and its sharpest fact is
composition, not size: the largest single foreign nationality in Zurich is
German — people who arrive with the bridge variety fluent, cannot follow the
lunch table, and are precisely who a German-teaching app cannot help.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): the chat void, 125 off-scale type sizes, and a voice that was never German
THE VOICE, reported by a listener: "it sounds like an English person speaks.
definitely not Swiss German."
`variety.ts` was right and the code ignored it. `pickVoice` returns null when
the device has no German voice, and `use-speech` then assigned that null and
spoke anyway — which makes every engine substitute the SYSTEM DEFAULT. On a
device configured in English that is an English voice reading Zurich German.
The comment two lines above the bug described the bug exactly.
It refuses now, with `no-voice` as a real state the control can show. Refusing
outright would have overridden a judgement that is the learner's to make —
"better than nothing" is a reasonable thing to decide about getting the WORDS —
so `speakWithoutGermanVoice` is an informed opt-in, off by default. The product
may not make that trade silently; that is what it was doing.
MOBILE, audited rather than eyeballed: every page, at 390px and 1280px, asked
for sideways overflow, elements past the viewport, tap targets under 44px and
text under 12px. Good news first — nothing scrolls sideways anywhere.
THE CHAT VOID. /chat was a desktop layout stretched: roughly six hundred
pixels of white between the greeting and the text box, which reads as a page
that has not finished loading and asks the least confident visitor to do the
hardest thing in the product first. The home page already had tappable
example prompts and the full-screen chat did not, so `Examples` moved into
its own module and both surfaces render the same one. Copying it would have
let the first thing a new visitor sees drift into two versions.
125 OFF-SCALE TYPE SIZES in 43 files — `text-[11px]`, `text-[10px]`, and a
`text-[9px]` nobody could read. Every one was a reasonable local decision and
together they were a type scale nobody owned. Swept onto `--text-caption` at
12px, the floor that survives a phone at arm's length on a tram.
A RATCHET, because the sweep alone buys a clean tree and the same problem in
six weeks: `tokens.design.test.ts` fails the build on any arbitrary font size
or hex colour in a className. It found the 9px and two 13px the sweep missed
on its first run.
The composer clears the home indicator via `env(safe-area-inset-bottom)`.
SECTORS, as data with its own honesty test. Care homes, hospitals, schools,
language schools, relocation and employers — the places where this is somebody
else's operating risk rather than their own problem, and where the person who
suffers it cannot buy the fix.
Every row is a MOMENT rather than a benefit, because a reader who has stood in
the room recognises the room and nobody recognises "improved communication".
Every row also carries `unknown`: the thing we would have to learn from them.
That is not modesty, it is what turns a page into a meeting — and a product
with no customers writing as though it has them is the most expensive mistake
available to it. A test asserts the copy never says customers, case study,
trusted by or proven, in either language.
The schools case rests on a fact worth having: Zurich voters made dialect the
kindergarten language of instruction in 2011, so expat parents are locked out
of their child's first school years by law. Cited to the canton.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): the pack owns the language, and a vendor claim stays a claim
CONFIG-DRIVEN, which it was not.
`lib/speech/` measures syllables, counts hesitations and asks a grammar service
for findings, and §4's house rule is that nothing outside `lib/variety/packs/`
may name a language fact. Three were doing exactly that:
- the German syllable rule existed only inside a test
- the filler words existed only inside a test
- `SPEECH_LANG = "de-CH"` was a constant in the voice module, so a Lesya
build would have gone on asking the synthesiser for Swiss German
They are a `SpeechProfile` on the pack now — synthesiser tag, vowels, fillers,
grammar code — and the engine reads it. Swapping the pack swaps the behaviour,
which is the property the whole variety layer exists for.
`capabilities.asr: boolean` became `recognition: Recognition`, because the
boolean could not express the fact the entire speaking surface turns on: a
recogniser may exist, work well, and still answer in a DIFFERENT variety from
the one spoken. With one flag, "no ASR" and "ASR that translates the dialect
away" were indistinguishable, and the safe reading was to call it unavailable —
wrong in the other direction, since Heidi can understand dialect speech
perfectly well. She simply cannot write it down faithfully.
The bridge is declared separately and is why a speaking surface can exist at
all today: Standard German recognition returns Standard German, so a learner
practising the German they need at a doctor's desk CAN be told about their own
words. Zurich is diglossic and §9 already makes producing that half a product
output.
THE SECOND PACK EARNED ITS KEEP AGAIN. `дякую` is дя-ку-ю, and the syllable
rule said two: German writes diphthongs as adjacent vowels so merging them is
right, and Ukrainian has no diphthongs so merging is wrong by a third. That is
now `adjacentVowelsMerge`, declared per pack — a property of a writing system,
not a thing to infer per word. Nothing would have failed; the rate would just
have been wrong in a language nobody here reads.
A contract test runs the profile over EVERY pack, and asserts the two disagree:
same engine, different answers.
THE VENDOR CLAIM, recorded as a claim.
Swiss specialist vendors now sell dialect STT and TTS together, hosted here,
and at least one advertises transcription that keeps DIALECT TEXT rather than
translating into Standard German. If that holds it is not an improvement in
degree — it is precisely what `evidence.ts` says would make a transcript
evidence about a speaker's own forms.
It has not changed the pack, and a test stops it changing the pack. The figure
advertised is "97.4% dialect accuracy" with no test set named and no
independent evaluation, against a published honest baseline of 25.6% WER for
the entire field: a tenfold claim, unaudited, on a sales page. §7 already
records that most "Swiss German" speech technology is Standard German in a
Swiss accent, and §2 explains why a vendor's own label is the one thing that
cannot settle it — the learner is buying the variety because they cannot tell.
So `SpeechSystem` gained `verified`, claimed nowhere, enforced by a test. The
experiment that would settle it is cheap and nobody has run it: take the free
trial credits, feed it real Zurich speech, compare against a transcript a
Zurich speaker wrote. Then flip the vendor row, then the pack, then the test.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speech): the experiment that settles the dialect claim, minus the key
"Do it for me" — so here is the instrument, and an honest account of the half
of it I cannot run.
THE CLAIM SPLITS IN TWO, and only one half is decidable by machine:
"returns dialect text" DECIDABLE. Feed it dialect speech and read which
variety came back. No ground truth needed, because
the question is about the VARIETY of the output and
not its correctness.
"97.4% accuracy" NOT DECIDABLE HERE, and nothing pretends otherwise.
A word error rate needs a transcript a Zurich
speaker wrote. Nobody here has one, and a WER
measured against a guess is a number with nothing
underneath it.
The first is the one that decides the product anyway: `evidence.ts` turns
exactly one boolean into the whole speaking surface. Accuracy decides how far
to trust the findings; variety decides whether there may be findings at all.
`dialect-marker.ts` settles it from the text. Not the §6 gate, which hunts
forms from the wrong DIALECT and would wave a Standard German transcript
through clean — but the commonest function words, isch/ist, nöd/nicht,
gaat/geht, which appear in almost any sentence either variety produces and
therefore make ten seconds of audio enough. They live in the pack, so the
instrument knows no language of its own; a test inverts them and watches the
same sentence read the other way round.
`unclear` is a real verdict. A clip with no markers gets `null` rather than
`false`, because "we could not tell" and "it translated" are different answers
and only one of them is about the vendor.
Checked against sentences written for the PRODUCT rather than for the test —
the pack's showcase line and the real chat prompts — since an instrument that
could not see those as dialect would not have seen a transcript either.
WHAT I COULD NOT DO, plainly:
- I cannot listen. §7's test is "listen before believing a label" and I have
no audio perception at all. Judging whether the VOICE is really dialect is
thirty seconds for a person and impossible for me.
- I could not complete a signup needing email verification, and did not put
payment details anywhere.
- The vendor's sandbox is synthetic, so it cannot answer a question about
real dialect. The runner refuses an `sv_test_` key rather than producing a
confident worthless result.
So `scripts/verify-dialect-asr.mjs` takes a live key and a real Zurich clip and
prints the verdict, naming the three files an affirmative answer would
authorise editing — pack, register row, and the test that currently forbids
both. The claim stays a claim until somebody runs it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(organisations): the page for people whose problem this is on somebody else's behalf
Care homes, hospitals, schools, language schools, relocation firms and
employers with international teams — the settings where dialect is an
operating risk, a training budget or a legal duty rather than one person's
difficulty, and where the person who suffers it cannot buy the fix. A care
assistant does not procure software; a Heimleitung does.
The page does the one honest thing available to a product with no customers,
which is also what actually opens a conversation with an institution: describe
the MOMENT the problem happens, in enough detail that a reader who has stood in
the room recognises the room, and then ask whether we have it right. `unknown`
on every row is the question that turns a page into a meeting, and the "no
customers" paragraph is FIRST rather than buried — a reader who discovers that
on the way down has been managed; one told at the top is being levelled with,
and everything below reads differently.
The schools case rests on a fact worth having: Zurich voters made dialect the
kindergarten language of instruction in 2011, so expat parents are locked out
of their child's first school years by law. Cited to the canton.
TWO RESPONSIVE BUGS, one mine and one not.
MINE: added under `project`, it made an eleventh nav item and the French header
overflowed at 1024px — every page scrolled sideways. That is the exact
headroom `routes.ts` predicted would go. It has no `group` now, so it stays out
of the learner nav and sits in the footer row beside privacy and the Impressum,
which is where an institution already looks. My own comment had made that
argument and I put it in the nav anyway.
NOT MINE: with my item removed the French header STILL overflowed, on pages I
never touched — the `use` group grew to five items across #71–#73 and spent the
rest of the margin. `min-w-0` on the row and `flex-wrap` on the nav: without
`min-w-0` a flex child refuses to shrink below its content and pushes the row
wider instead. It wraps to two lines at 1024 and stays one line at 1280.
And the reason neither was caught: my audit ran 390 and 1280, and this breaks
between them. It now runs 1024 in French — the longest labels, at the width
where the flat nav has appeared and has least room — and it has moved out of a
scratch directory into `scripts/responsive-audit.mjs`, having found real bugs
twice.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): footer links a thumb can hit, and an audit that stops crying wolf
TAP TARGETS. The footer's page list and language list were 16px-tall text
links in a column — a finger is 44px, and this is the one part of the site
somebody reaches for one-handed on a tram. The same file already had the right
pattern two blocks further down, on the privacy and Impressum row; the lists
just never used it.
THE AUDIT'S OWN FALSE POSITIVE, which matters more than the finding.
It reported GUTTER on every page in the site, because it read `main`'s own
padding while the padding lives on a wrapper inside it. A check that fires
everywhere is a check nobody reads — and this one nearly sent me looking for a
layout bug that did not exist, on a site whose gutters were fine all along.
It measures the first piece of real TEXT now: what a reader actually sees
touching the edge, rather than a box that happens to be full-bleed by design.
And the tool no longer lies about its own dependency. It said "Playwright is
deliberately not a dependency" in a comment and then imported `playwright` as
though it were installed, so it died on its first run for anybody but the
author. It imports at run time and prints how to point it at a browser.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): the language switcher, and the fourth thing the audit was wrong about
The footer's language links were still 16px tall. The previous commit fixed the
page list beside them and missed this one, which is the ordinary way a
"sweep" leaves half a job: the two lists look identical on screen and are two
separate blocks in the file.
STRUCTURALLY THE SITE IS NOW CLEAN: across seventeen routes at 390, 1024 and
1280, zero overflow, zero elements past the viewport, zero gutter failures.
That is the real result of the nav fix, and it is worth stating because the
report that produced it was until recently mostly noise.
Which is the other half of this commit. The audit reported the SKIP LINK as a
failed tap target on every page — it is a 1×1 until focused, which is the
entire point of it. Reporting an accessibility feature as an accessibility
failure is the fourth false-positive class removed from this tool:
gutter on `main` fired on every page in the site
tap targets at 1280 a mouse pointer is not a finger
links inside prose cannot be 44px without wrecking the line
the skip link invisible by design
Each removal made the report smaller and more trustworthy, and the third and
fourth would each have had me change working code. A check that cries wolf is
worse than no check, because it trains the person reading it to skip the line
where it is finally right.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(settings): what this device is holding, and the button that ends it
The data section said, in a paragraph, that saved words and the signed-out
conversation live in this browser — and then linked away. It is the one claim
in the privacy section that the architecture lets us simply SHOW: every device
store is four localStorage reads, so "what do you have on me, and delete it" is
a list with buttons rather than a subject-access request.
The list is DERIVED, not written twice. `lib/browser/stores.ts` takes its keys
from the same `FLOWS` the privacy page renders, and reuses that page's own
translated labels — so both pages name the same four things the same way in all
seven languages, and a fifth store cannot be added to one and forgotten by the
other. A settings page with its own list is a settings page that will one day
leave data behind while promising it is gone; a test asserts the join.
Sizes, not contents. "337 B" needs no knowledge of any store's shape and cannot
go stale; "11 saved words" needs four decoders that rot one at a time. And
export sits to the left of delete: somebody who wants to leave should meet the
way to keep their things before the way to destroy them.
Storage is subscribed to, not mirrored into state. `store.ts` next door already
models a single key as an external store, and this follows it: a delete here
announces itself, a delete in a second tab arrives on the `storage` event, and
the component needs no effect — which is the hydration mismatch this codebase
has been bitten by twice. The snapshot cache that `useSyncExternalStore`
requires is the one piece that can fail silently, so all three of its failures
are pinned by tests proven by mutation: never invalidating, never announcing,
and never caching each fail the test that names them.
Verified at 390px and 1280px on /de/settings with four stores seeded: rows wrap,
the delete targets are thumb-sized, and deleting one removes the row and
recomputes the total without a reload.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(technology): what the speaking evaluation measures, computed rather than claimed
The technology page described what the FIELD can do — corpora, error rates,
which vendors actually produce dialect — and then stopped short of the thing a
reader is there to judge: what this product does with any of it. That was the
explicit gap. It is now a panel, and the interesting part is that nobody wrote
its claims.
`lib/speech/capability.ts` declares five measures and the least evidence each
needs; the pack declares what recognition exists; the verdict falls out. So the
page renders "on the dialect" for delivery and "on Swiss Standard German" for
grammar because `evidence.ts` says dialect recognition translates rather than
transcribes — not because a copywriter decided that was a fair way to put it.
When Zurich German recognition improves past FORM_JUDGEMENT_MAX_WER, one number
in one pack changes and the page starts saying grammar is checkable on the
dialect, in seven languages, with no copy edit. Until then it cannot overclaim
even if somebody wants it to.
The refusal is a row, not a silence. Pronunciation is listed and marked refused,
because the measure every competitor advertises being deliberately absent is
the most informative thing on the page — and a flag beats a comment at stopping
a future contributor from reading the other verdicts as a roadmap. The word
error rates sit underneath, so a reader can disagree with our threshold instead
of being asked to trust a verdict.
Two things that were true and are no longer:
"Heidi does not speak" — she does, since the de-CH voice. The line now says
what actually happens: Heidi reads aloud, never claims to be speaking
dialect, and stays silent rather than hand you an English voice reading
Züritüütsch. Corrected in all seven languages.
The overclaim register lived only in comments. §8 names the claims this
product does not make, every engine file obeys it, and nothing stopped the
sentence appearing in a dictionary — the one place a reader would see it.
`lib/i18n/overclaim.test.ts` scans all seven for claim SHAPES rather than
vocabulary, so "adults rarely reach native pronunciation" still passes while
"93% native pronunciation" fails the build. Proven both ways: honest lines
that must keep passing, forbidden lines that must fail, and an injected
overclaim in real copy that the scan located by file and key.
Verified at 390px and 1280px on /de/technology: rows wrap, no overflow, the
refusal row reads as a decision.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(speaking): days spoken, counted — a number that cannot be lost
Stickiness, without becoming the thing this codebase already refused three
times. `saved/review.ts`, `practice/types.ts` and the practice session each
decline streaks, points and days-active, and they give the test they applied:
the product's success is how much of an unfamiliar Zurich speaker you
understand, and a streak measures how much Heidi you CONSUMED while looking
like it measures learning. That reasoning is not weakened here. It is applied
to the one surface it was not written about.
Speaking is production, not consumption. Everything else in the product is
something shown to the learner — a card, a clip, an answer — and a counter over
any of it is vanity. A take is the learner making speech in a second language,
which is the skill itself being exercised rather than evidence of having opened
an app. Counting the days somebody did that is measurement.
WHAT MAKES IT HONEST IS THAT IT CANNOT BE LOST. A streak is a count plus a
punishment, and all of its pressure comes from the reset — which is why streak
products send the notifications they send. Nothing here resets. `daysSpoken` is
the number of distinct local days with a take; it rises or holds, and a
fortnight away costs exactly nothing. Somebody returning after a month is told
they have spoken on eleven days, not that they have lost eleven. The test that
pins this is named for it, so anyone turning the count into a streak has to
delete a test that says what they are doing.
The design test for anything added here, written into the module header: would
a learner who stops for three weeks see a WORSE number than before they
stopped? If yes, it is a streak wearing a different name.
Details that keep the numbers true: several takes in one sitting are one day of
speaking, so re-recording is not rewarded over returning; time is phonation
rather than wall clock, so sitting with the recorder open deciding what to say
is not counted as practice; minutes round down, so a first thirty-second take
is thirty seconds and not "1 min"; days are LOCAL days in the browser's own
zone, which is a parameter rather than the runtime's, because a take at half
past midnight belongs to the day the speaker was living in.
Visually deliberate: the same figure grid as the per-take measurements directly
above, because these are the same kind of thing, and a louder treatment would
be the visual version of the claim the module refuses to make.
Verified at 390px with five takes across four days: 4 days, 5 recordings,
3 min — three columns, no dead cell, no overflow.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(mobile): every tap target on every page, and the fifth thing the audit was wrong about
Thirty-three findings to zero, across sixteen pages at three widths.
Half of them were one bug. The header's link back to the start page was the
height of the mark inside it — thirty pixels — so the most-repeated control on
the site was also the most-missed, once per page. `min-h-11` on the anchor
fixes all sixteen and changes no layout, because the header's own padding
already exceeds it; only the hit area grows.
THE AUDIT WAS WRONG ABOUT THE CHECKBOXES, and that mattered more than the
checkboxes. A checkbox or radio wrapped in a label is tapped by the label — the
radio rows here are padded bordered blocks the width of the column, which is a
comfortable target reported as the worst one on the page. Acting on that
finding would have meant inflating a control nobody aims at while leaving the
actual target untouched. So the detector now measures the wrapping label for
those two input types, and only a WRAPPING label: a `for=`-linked label
elsewhere in the DOM is clickable too but need not be adjacent, and crediting a
control with the area of something across the page would hide a real problem.
This is the fifth false-positive class this report has lost, and the reason to
keep spending on it is that a finding a reader learns to skip past is worse
than no finding — it teaches them to skip the real one beside it. The change
proved itself immediately: the settings checkbox came BACK as 350x24, because
its label genuinely was one line tall, and only went away when the label was
fixed.
The rest were real, and each is a control somebody actually has to hit on a
phone: the conversation-list button in chat, the table of contents on /method,
the way back into reading from /practice, the source titles on /listen, the two
links on /impressum, and the two 28px icon buttons on every saved word — those
get 44px on phones only, which is not a compromise between devices: on a phone
they are always visible and are the only way to act on a word, while on a
desktop they appear on hover beside a pointer that can hit 28px.
One genuine ergonomic fix rather than a measurement one: the speech-rate slider
was a sixteen-pixel-tall track, every pixel of which was somewhere a thumb had
to land precisely to start a drag. It now has a 44px grab area with the track
still drawn at its natural height.
Audit: 33 findings → 0. Verified by watching it fall as each fix landed, which
is also the evidence the detector still fires.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
faf5370225 |
feat(voice): Heidi can be heard, and can hear you — with the gate that has to come with it (#70)
* feat(listening): where you can actually hear Zurich German, as a register The recordings §9 waits on do not exist yet, and the largest source of dialect exposure in the world does: the media the Swiss already make for themselves. Pointing at it needs no corpus and no licence. What makes this more than a list of Swiss channels is the variety label on every row. Switzerland is diglossic and Swiss media splits along that seam in a way nobody tells a learner — the evening bulletin is read in Standard German and the magazine after it is in dialect. Someone sent to Tagesschau to "practise Swiss German" gets an hour of the German they already have, concludes this is easy, and is no closer to the lunch table. That is the same lemons problem §6 built the variety gate for, one level up: the learner cannot audit the label, because not being able to tell the two apart by ear is why they are here. So `basis` is required on every row and `listened` is claimed nowhere, because nobody here has sat down with these forty-odd programmes and written down what they heard. A test fails the moment a row claims it, so the day somebody does that afternoon's work, the page copy has to change with it rather than quietly keeping the old sentence. No difficulty number anywhere: "3 out of 5 chillis" is the false precision §8 forbids. What is written down is observable — how many voices at once, read or spontaneous, whether publisher subtitles exist — and demand() in flow.ts derives an ordering from it, so an argument about the ordering is an argument about four weights in one place. Films and series link to a page ABOUT them rather than a play button: streaming rights to Swiss films move every few months, and a register that rots is worse than one that admits what it can promise. Noticeable as a group, and worth a learner knowing: the famous Swiss films are mostly BERNESE, so working through them gives a Zurich learner an ear for the wrong dialect. Every url was fetched and its page title checked against the name. The sweep has three verdicts, not two — a Cloudflare challenge is not a dead link, and only GONE fails the run. It caught two things worth keeping: youtube.com/@srf3 answers 200 and is called SRF Unterhaltung, and its own normaliser called TeleZüri a mismatch because it decomposed the umlaut to a bare `u` where the publisher writes `ue`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(voice): the spoken channel, and the variety gate that has to come with it Speaking and listening are the half of this language nobody can practise alone, and the half the product has never had. This is the layer under it. THE GATE APPLIES TO SOUND, and that is the whole design. §6 built a deterministic check over generated TEXT because a model asked for Zurich German returns Bernese fluently and the learner cannot tell. Every word of that survives being read aloud and gets worse, because speech is gone the moment it is said. And the failure is already on our own record: §7 says most synthesis sold as "Swiss German" is Swiss STANDARD German, the written language read aloud in a Swiss accent. `de-CH` on a voice is the accent, not the dialect. So `lib/voice/variety.ts` has no code path that returns "dialect" — not an omission to be filled in by widening a condition later, but the claim it exists to refuse. A test feeds it voices named "Züritüütsch" and "Schweizerdeutsch Mundart" and asserts it is not fooled. The consequence is the point: every control that speaks can say what it is speaking, and does. CORRECTION IS A SETTING WITH THREE RULES ABOVE IT. Spelling is never corrected, because Zurich German has no standard orthography and enforcing one would be inventing an authority. Pronunciation is never scored, and that is structural rather than principled — this module takes no audio, no confidence and no alignment, so a number would have to be invented. And the one that is easy to get wrong and silently ruins the feature: a transcript's forms belong to the machine, not the speaker. Swiss German recognition writes Standard German whatever was said, so running the gate over a transcript flags the recogniser and bills it to the learner — they would be corrected, in detail, for saying something correctly. So speech is never corrected for its variety at any level, and the three silences (you turned this off / this cannot be judged / you made no mistakes) are distinguishable rather than collapsed into a blank space. That leaves a real gap and the copy names it in seven languages: Heidi cannot tell you whether your accent is right. Nothing can, reliably. What she can do is understand you and answer. Also /listen, which renders the register — the diglossia warning above the list, because a reader who scrolls to the links and picks the name they recognise picks the Tagesschau. The gsw copy passes Heidi's own dialect gate, and the German copy had to learn to name the sharp S without typing it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(voice): Heidi speaks, and says what she is speaking with A speak button beside every copy button — on the dialect line and on each suggestion, which are the lines a learner has to produce and the ones "what does this sound like" was unanswerable for. The claim rides along in the flow rather than in a tooltip: phones have no hover, screen readers announce it last, and the whole point is that the learner cannot hear the difference between a Swiss Standard German voice and the dialect they came for. On a dialect line the caveat is stronger, and `dialect` is a prop rather than an inference — a Swiss Standard German suggestion read by a Standard German voice needs no warning, and attaching one anyway would train people to ignore it on the line that does need it. Auto-speak is seeded on mount. The obvious version speaks whenever the last message is Heidi's, and then opening a saved conversation reads the last thing she said three days ago at somebody who came back to look one word up. Only a message that ARRIVES is spoken, and only the prose — never the dialect line, which is something to ask for deliberately. Settings carries both the voice and the correction level, because both are decisions about how you want to be treated rather than about this message. What the device can actually speak is shown from the same function the audio will come from, so the page cannot promise a voice the speaker does not have. And the limit is stated beside the setting rather than discovered: somebody turning corrections up is exactly the person about to assume the highest setting also judges their accent. The React Compiler rejected the ref-assignment-during-render idiom, which was right: a render that gets thrown away would still have changed it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs: the spoken channel, in the definition, the register and the record HEIDI.md §1 said what Heidi is without mentioning that the language is one people HEAR. It has no standard orthography, the lunch table that prompted this product is audio, and a learner who can only read Zurich German has solved a version of the problem that does not occur. So the spoken channel is named as the subject, arrived at late, rather than as a feature tier — with the one-sentence honest summary attached: Heidi can speak to you and understand you speaking; she cannot tell you whether you sound right, and neither can anything else. §6 gains the sound gate, which is stricter than the text one because written text can be stared at and looked up while speech is gone the moment it is said. §8 gains five new refusals, each of which was a plausible sentence somebody could have shipped this week: that Heidi speaks Zurich German, that she corrects pronunciation, that a transcript's forms are the speaker's, that a machine reading dialect spelling is a model to imitate, and that a Swiss channel is a dialect channel. §9 records both builds and gives "next" three concrete steps in cost order. The cheapest is the best: listening to the register and flipping `basis` from `format` to `listened` needs no corpus, no licence and no model, and turns forty careful inferences into forty facts. The site's own roadmap said the product handles text, in seven languages, which stopped being true today. The vision's closing line now carries the spoken half too — every language this method could travel to is heard far more often than it is written, and for every one of them there is media nobody has sorted into dialect and standard. And a CHANGELOG, which did not exist. HEIDI.md is the present tense and must never contradict itself; a changelog is the past tense, which is the only place that can say a thing used to be otherwise. Derived from the merge history rather than written from memory, so the entries about dictation failing five separate times in September are the record rather than a confession. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * docs(voice): name the seam between the two correction surfaces #69 landed a speaking take while this branch was open, and it decides what may be corrected too. The two are not a duplication and collapsing them would break one of them, so both files now say why. `feedback.ts` judges a spoken take the learner WROTE DOWN and keeps only `foreign` findings, because an `unattested` finding is orthographic and there is no way to say a `ß`. `correction.ts` judges typed text, where orthography is exactly what the learner produced and `unattested` is the most certain judgement available. Same gate, two surfaces, two defensible mappings. The third input is named in a comment rather than added as a value: speech the learner transcribes themselves is neither of this module's cases, and routing it to `spoken` would silence the one surface where a spoken take can honestly be commented on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
92b023af19 |
feat: speaking rounds, and a take that is measured rather than scored (#69)
* feat(speaking): rounds people propose, and a take that is measured rather than scored Study groups were a thread with more than one human in it. This is the same social object with the medium changed, which is the half a diglossic variety otherwise gives away for free. WHAT IS HERE Webinars (one voice, an audience) and circles (everyone in turn, eight max), on topics proposed by the people who would come. "Regularly" is a field, which made this a time-zone problem rather than a scheduling one: a round is an absolute instant and a repeat is a wall-clock promise, and those disagree twice a year. Adding seven days of milliseconds to a Tuesday in March produces a Tuesday at 20:00 and an empty room, so the recurrence is computed in the zone's calendar and the tests cross both Swiss changeovers in both directions. Sittings are computed, never stored. Heidi does not carry the meeting: `meetingUrl` is an https room the host already has, and https only, because that string is rendered as a link for every attendee and accepting the scheme as given would accept `javascript:`. WHAT THE EVALUATION REFUSES TO DO The obvious build for "AI evaluates your speaking" is a pronunciation score. The overclaim register bans it by name, and no system transcribes Zurich German reliably — the state of the art translates the dialect into Standard German on the way, which is the exact information a learner needs. A score on top of that is a number with nothing underneath it, handed to the one person who cannot check it. So: the signal is measured in the browser (durations, counts, mic clipping — arithmetic over samples, no model, no ASR, and no speech rate because syllables need a transcript); the learner writes down what they said, with the reason on screen; and their own words go through the deterministic gate, then one model suggestion over text they confirmed. Only `foreign` findings survive — a `ß` is not something anybody pronounced, and flagging it would be correcting spelling in a variety that has no standard spelling. Two tests pin the ban: no field of the measurement reads as a rating, and no speaking copy in any of the seven languages offers a score. PRIVACY The audio never leaves the page that recorded it and the takes are device-local under `heidi.takes.v1` — no audio table, no upload endpoint for takes, no transcript of anybody's speech. A table of how somebody sounds when they are bad at a language is worse than a table of the words they looked up, and the cheapest way to honour that is to never hold one. Mobile first: one big record target, a live level so a dead microphone is visible in the first second, single-column forms that pair up from `sm`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(speaking): the page now reads in the order its own lead promises Four things found by looking at the running page rather than at the tests. THE ORDER. The lead says "webinars and circles on topics you propose, and IN BETWEEN practise out loud", and the page rendered practice first. The original reasoning was real — practice is the half that works signed out, alone, with an empty calendar above it — but it loses to a simpler test: read the lead, then look at the page. A reader resolves that disagreement by deciding the page is about something other than what it says it is about. A HYDRATION MISMATCH. `recordingSupported()` reads `window`, so calling it in the render body made the server draw the button disabled with "this browser cannot record" underneath and the client draw it enabled. React threw the server HTML away and said so in the console. It goes through `useClientValue` now, the same primitive `useStorageReady` uses, with an optimistic server value. A ROUND IN PROGRESS FELL OFF THE LIST. "The next sitting at now" excludes one that started five minutes ago, which is exactly when somebody running late opens this page looking for the link — and for a weekly round it was worse than vanishing, because the list would advertise next week while the thing was happening. The question is asked from one duration ago now, and the answer carries `live` so the row can say so. Computed server-side: a client-side comparison is a hydration mismatch whose answer depends on the visitor's device clock. Two regression tests. AN UNCLICKABLE CALL TO ACTION. "Make a round of it" rendered as flat grey caption text beside the interest count, reading as a button that was not one. Also: `/de/speaking` joins the post-deploy smoke check, whose own rule is every page a visitor can reach by name; and the third loop is written into the canonical doc, ending in a room with other people rather than in a mark out of ten. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(privacy): the voice recording is named on the page that enumerates flows The privacy page landed in #68 while this branch was open, and it works by listing every place data goes with the storage key beside it, so a reader can open their own dev tools and check. Speaking rounds landed at the same time and were not on it. That omission is the worst one available. The page's whole value is being exhaustive, and the flow it was missing is the voice recording — which §10 itself names among the most private things a person owns. A privacy page that enumerates nine flows and silently skips the microphone is worse than one that never claimed to be complete. Two flows now: speakingTakes device, `heidi.takes.v1`, leavesDevice: false. The audio is decoded and measured in the page that recorded it and then dropped. No audio table, no upload endpoint for takes, no transcript of anybody's speech. speakingSuggestion vendor, `/api/speaking/take`, the confirmed sentence only. Never the audio, never stored — one request, answered and forgotten, exactly like a signed-out chat. The existing test that every named `heidi.*` key still appears in the code now covers `heidi.takes.v1` too, so renaming it would fail the build rather than turn the page's invitation into a dead end. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
2d2357ebe0 |
fix(middleware): a rewrite behind Caddy dialled TLS at an http socket (#55)
* fix(middleware): a rewrite behind Caddy dialled TLS at an http socket
Production 500'd for every signed-in visitor on the locale root. Signed-out
visitors were fine, which is why it shipped.
Failed to proxy https://localhost:4025/de/portal
EPROTO ... tls_validate_record_header: wrong version number
`request.nextUrl.clone()` inherits the EXTERNAL protocol behind the reverse
proxy, so the cloned URL reads `https://localhost:4025/...` while the app
itself listens on plain http at that port. Next does not recognise that origin
as its own, treats the rewrite as an external proxy target, and opens a TLS
connection to an http socket.
Nothing in the test suite could have caught it, and that is the part worth
recording rather than the one-line cause. The DECISION was extracted into a
pure, tested function precisely so it could be covered — and it was, including
the self-rewrite loop — but the decision was never wrong. The MECHANISM was,
and the mechanism only misbehaves with a real reverse proxy in front of it.
Neither CI nor `pnpm start` has one, and the branch only ran when a session
cookie was present, so a production build exercised in a browser was green too.
The rewrite goes. "Show a different page at the same address" is still the
right idea — it is a decision for the PAGE to make, where no URL is
reconstructed and no protocol is guessed. `lib/i18n/landing.ts` goes with it
rather than sitting unwired, which is the same defect as a health check nobody
calls.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT
* test(deploy): smoke the live site, signed in and signed out
A green deploy is not a working site, and this outage proved it in the most
expensive way available: 339 tests, lint, typecheck and a production build
exercised in a browser, all green, while the locale root returned 500 to every
signed-in visitor.
The thing that would have caught it takes one second:
curl -H "Cookie: __Secure-authjs.session-token=x" /de → 500
A cookie being PRESENT is enough. That is the whole trick, because the code
paths this class of bug lives in — routing, rewrites, redirects — branch on
the cookie long before anyone validates it.
So `scripts/smoke.sh` requests every page a visitor can reach by name, twice,
once each way round, and runs as a job after the deploy. A release that cannot
serve its own home page now turns the Deploy run red instead of waiting to be
noticed.
What the cookie does NOT prove, stated in the script so nobody mistakes it for
more than it is: it is not a real session. `auth()` rejects it and the page
renders signed-out. It exercises "is a session cookie present", not "is this
person authenticated". A genuinely authenticated end-to-end test needs a test
account and a real login flow, and is worth doing separately.
Also checks that `/` stays a 307 and not a 308 — caching the locale
negotiation as permanent would pin every later visitor to whoever asked first —
and reads `/api/health`'s schema verdict rather than its status code, since a
deploy that cannot use its own tables still answers 200 by design.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
372558570e |
feat(design): a real map, a fluid type scale, and a composer you can reach (#22)
* feat(design): an actual map, a fluid type scale, and a phone that fits Four things a user hits in the first ten seconds, three of them broken. THE PICTURE. The site had one figure and it was a black blob crossed by a red squiggle. Its own comment explained why: a real map of Switzerland would be "a cartographic claim" and the patches were not where those dialects are. The worry was right and the conclusion was backwards — the answer to "an inaccurate map misleads" is an accurate map, not an abstract one nobody can read. So: a real border (Natural Earth, generated by scripts/build-region.mjs, not drawn until it looked Swiss), dialects as POINTS rather than territories because isoglosses do not follow cantonal borders, Zurich filled and the rest open rings — the same distinction the gate enforces, in the same figure. Still generated from the pack, which was the point of the old one. Nobody opens a component to ship a Bern pack, and Lesya draws Ukraine by adding one region file. The seam: a pack says WHERE a dialect is spoken (a fact about the dialect); lib/geo says how to draw the world (a fact about maps). THE PHONE. At 390px the headline ran off the right edge, because `text-[2.75rem] sm:text-7xl lg:text-8xl` is three hand-picked sizes and two guesses about what happens between them. clamp() removes the guess; one token per role in globals.css, so the scale is decided once. THE HEADER. brand · gear · Anmelden · DE · MENÜ — five controls in 390px, none of them what anyone came for. The account controls move into the menu sheet, leaving what must be one tap: what language this is, where else to go. THE COMPOSER. Its placeholder was a full sentence, which also appeared as the hero subtitle and again in the intro paragraph directly above it — three times on one screen, and on a phone it wrapped the input into an unreadable stub. Short visible placeholder, full sentence kept as the accessible label. The send button's disabled state was the accent at 30%, a pale pink that read as broken rather than inactive. Tests: cities must land inside the outline and north must be up (a projection that drifts from the generator puts Zurich in Lake Constance and still renders); every planned dialect must have a place and vice versa (a name in one list and not the other silently vanishes from the map). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT * fix(chat): the composer was below the fold, and sticky over the intro Three bugs found by opening the site on a 390px phone and reading it. THE INPUT WAS LAST. The empty panel rendered a heading, a paragraph and three examples, and only then the box you type in — about 700px down a phone screen. Someone arrives with a message they cannot read; they had to scroll past three examples of the problem to reach the thing that solves it. Examples are a prompt for a visitor with nothing to paste. Someone who has something should meet the box first, so the box comes first and the examples sit under it. THE COMPOSER COVERED THE INTRO. `sticky bottom-0` with nothing to scroll pinned the input over the panel above it and cut the last line of the intro in half. It is sticky only once a transcript exists — which is the only time sticking means anything. IDS COULD COLLIDE. Messages were keyed `local-${Date.now()}`, which is not unique: a reply landing in the same millisecond as a send produces two React keys that are equal, and React then reuses the wrong DOM node. A counter cannot collide. The last two surfaced because the React Compiler lint had been bailing out of this component entirely — it reports the first problem it can see, and each fix let it see one step further. The stale `attached.length` captured in `accept`'s closure is the same story: downscaling is async, so a count read before the await is already wrong by the time the write happens. Only the count inside the updater is true. Also moves the correspondences (Kind → Chind) directly under the chat. It is the one thing on the page that teaches something in a single glance, and it was six screens down, below the argument for why you should believe us. The payoff should come before the argument. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FzYBD3sZroCAYeRgTYrpfT --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |