fix(card): a search for blue no longer finds blunt

The card browser looked for a query also with every ae, oe and ue made
a, o and u, so that maedchen found Mädchen: in any language, so blue
found blunt, Spanish que found aquí, and ue nearly everything. A card's
umlauts are written out on its side instead, beside its folded text,
and a query is matched as typed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-14 17:36:55 +02:00
commit 31eed85aff
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -5,7 +5,7 @@ void main() {
test('a search finds words of any language as typed on any keyboard: '
'without accents, tone marks or umlauts, ß as ss, kana by romaji', () {
bool finds(String text, String query) =>
matchesQuery(searchFolded(text), query);
matchesQuery(searchableText(text), query);
expect(finds('Straße', 'strasse'), isTrue);
expect(finds('Mädchen', 'madchen'), isTrue);
@ -18,6 +18,11 @@ void main() {
expect(finds('たべる', 'taberu'), isTrue);
expect(finds('テレビ', 'てれび'), isTrue);
expect(finds('Haus', 'maus'), isFalse);
// Only a card's umlauts are written out, never a query's ue, oe or ae.
expect(finds('Müller', 'mueller'), isTrue);
expect(finds('blunt', 'blue'), isFalse);
expect(finds('aquí', 'que'), isFalse);
expect(finds('god', 'goed'), isFalse);
});
test('A–Z compares letters as their bare ones: Ärger among the a, xué '