fix(app): Look up tags a word as the dictionary screen does

A vocabulary card filled through Look up in the composer got the word but
none of its tags, while the dictionary screen tags every word with its
JLPT level and word class. Both now take the tags from the word itself
(DictionaryWord.tagNames). Looking another word up on the same card swaps
the tags the word before brought; tags the person gave the card stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-09 11:40:03 +02:00
commit d67dc8aa70
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
2 changed files with 166 additions and 35 deletions

View file

@ -162,12 +162,12 @@ void main() {
});
test('names the tags by level and word class', () {
expect(tagNamesOf(taberu), ['JLPT-N5', 'Verb']);
expect(taberu.tagNames, ['JLPT-N5', 'Verb']);
expect(
tagNamesOf(word('1', 'x', pos: ['adj-na', 'n'])),
word('1', 'x', pos: ['adj-na', 'n']).tagNames,
['na-Adjective', 'Noun'],
);
expect(tagNamesOf(word('2', 'y', pos: ['vt'])), isEmpty);
expect(word('2', 'y', pos: ['vt']).tagNames, isEmpty);
});
});
}

View file

@ -172,6 +172,9 @@ void main() {
expect(find.text('食べる', findRichText: true), findsWidgets);
expect(find.widgetWithText(TextField, 'たべる'), findsOneWidget);
expect(find.text('to eat'), findsWidgets);
// Tagged as words from the dictionary screen are.
expect(find.text('JLPT-N5'), findsOneWidget);
expect(find.text('Verb'), findsOneWidget);
});
testWidgets("About names whose work the instance's dictionaries are", (