diff --git a/web/src/components/Editor/EditorCore.tsx b/web/src/components/Editor/EditorCore.tsx index c3897c8..b596914 100644 --- a/web/src/components/Editor/EditorCore.tsx +++ b/web/src/components/Editor/EditorCore.tsx @@ -1106,7 +1106,17 @@ export function EditorCore({ // actually knows (a real gloss or definition), so accidental lookups of // typos or proper nouns don't clutter the garden. Looking words up IS // the data source; this costs the writer nothing. - const known = !!info.gloss || info.definitions.length > 0 + // + // "Knows" has to include the reverse reading, or a word of her own + // language can never be captured at all: the forward lookup of "carro" + // answers with nothing, and everything the card shows her comes out of + // `reverse`. Before Phase 28 that was academic, because every document + // was English; on a Portuguese document it silently emptied the garden + // of every word she actually met. Caught in a browser 2026-07-29 — + // right-clicking "carro" showed a full card and stored nothing. + const rev = info.reverse + const known = + !!info.gloss || info.definitions.length > 0 || !!rev?.gloss || (rev?.definitions?.length ?? 0) > 0 // Reflect the saved state optimistically so the heart shows 💚 the // moment a known word loads, rather than flashing 🤍 until the capture // round-trips. vocabId is filled in when recordVocab returns. @@ -1116,12 +1126,18 @@ export function EditorCore({ .recordVocab({ word: range.word, gloss: info.gloss, - definition: info.definitions[0]?.definition ?? '', + // `definition` is the English sense the review card falls back to + // when there is no gloss in her language — and for a word that *is* + // her language, the reverse gloss is exactly that: "carro" → + // "car; automobile; machine". The Portuguese monolingual definition + // underneath it explains the word in the language she already knows + // it in, which is not what a flashcard is for. + definition: info.definitions[0]?.definition ?? rev?.gloss ?? '', // The garden's pronunciation field holds whichever this word has: // IPA for an English word, pinyin for a Chinese one. Both answer // the same question on a review card — how do I say this — and a // second column would only be a second thing to keep in sync. - phonetic: pinyin || info.phonetic, + phonetic: pinyin || info.phonetic || rev?.phonetic || '', example, doc_id: docId, })