From ef1d9abc14693daae8cb32f2e804c9db9ec31617 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Sat, 15 Aug 2026 20:41:51 +0200 Subject: [PATCH] fix: the thesaurus kept throwing its own results away MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pass that reads the caret's word on open also writes it, so it was a dependency of itself: it re-ran on every flush and cleared term and groups just as a lookup landed. It runs untracked now, on `open` alone. The dialog also shows the language it is asking and lets it be switched, as both products do — a German word in an English document found nothing, with nothing on screen saying why. --- src/lib/components/CLAUDE.md | 5 ++ src/lib/components/ThesaurusDialog.svelte | 56 +++++++++++++++++------ src/lib/i18n/locales/de.ts | 1 - src/lib/i18n/locales/en.ts | 1 - 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/lib/components/CLAUDE.md b/src/lib/components/CLAUDE.md index 6720b28..3f82c6c 100644 --- a/src/lib/components/CLAUDE.md +++ b/src/lib/components/CLAUDE.md @@ -169,6 +169,11 @@ which is how both dialogs follow a chain. worker from then on — like a dictionary, and missing data disables the feature, not the app. - The groups come back ordered by where the word sits in each: a group leads with its main form, which is the sense LibreOffice lists first as well. +- **The language is shown and switchable** (both dialogs have that box): a lookup asks one + language, and a German word in an English document otherwise just finds nothing with no + hint why. It opens on the document's language, or the app's where that has no data. +- The open pass runs `untrack`ed, on `open` alone: it writes the state it reads (the term, + the language), so tracked it re-runs on its own result and wipes each lookup as it lands. ## Navigator (`NavigatorPane.svelte`, `editor/extensions/outline.ts`) diff --git a/src/lib/components/ThesaurusDialog.svelte b/src/lib/components/ThesaurusDialog.svelte index e3cbbbf..6d3b1ce 100644 --- a/src/lib/components/ThesaurusDialog.svelte +++ b/src/lib/components/ThesaurusDialog.svelte @@ -1,10 +1,11 @@