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:
parent
72c15300ed
commit
d67dc8aa70
2 changed files with 166 additions and 35 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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", (
|
||||
|
|
|
|||
Loading…
Reference in a new issue