feat(learn): Settings' dictionaries on this device, one row a language

The developer's review of 4 Nov 2026. "Japanese on this device" becomes
"Dictionaries on this device", with one row a language: its name at the
start, what the device holds or that the download failed beneath it, and
its action at the end (Download with its size, the progress, Remove),
built as a list of rows so Korean's and Chinese's line up beneath
later. Japanese's is the only one now. The help speaks of a language's
dictionaries in general, then of what Japanese's hold (MeCab's, JMdict).

Whats-New: Settings lists the dictionaries on this device by language, each with its own Download or Remove.
Whats-New-De: Die Einstellungen listen die Wörterbücher auf diesem Gerät nach Sprache, jede mit eigenem Herunterladen oder Entfernen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-04 21:26:52 +01:00
commit a7638e5e54
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -108,7 +108,7 @@ void main() {
}
});
group('Japanese on this device', () {
group('Dictionaries on this device', () {
/// Opens Settings, tall enough to show every card at once.
Future<void> openSettings(
WidgetTester tester,
@ -133,7 +133,13 @@ void main() {
final gateway = FakeDeviceDictionaryGateway(offered: offeredJapanese());
await openSettings(tester, gateway);
expect(find.text('Japanese on this device'), findsOneWidget);
expect(find.text('Dictionaries on this device'), findsOneWidget);
// One row a language, its name at the start and its action at the
// end, so the languages to come line up beneath (4 Nov 2026).
final language = tester.getRect(find.text('Japanese'));
final action = tester.getRect(find.text('Download (34.0 MB)'));
expect(language.right, lessThan(action.left));
expect(language.center.dy, closeTo(action.center.dy, 2));
gateway.fail = const SocketException('offline');
await tester.tap(find.text('Download (34.0 MB)'));
await tester.pumpAndSettle();
@ -156,6 +162,10 @@ void main() {
);
expect(find.text('On this device: 150.0 MB'), findsOneWidget);
expect(
tester.getRect(find.text('Japanese')).right,
lessThan(tester.getRect(find.text('Remove')).left),
);
await tester.tap(find.text('Remove'));
await tester.pumpAndSettle();
@ -167,7 +177,7 @@ void main() {
'the device holds none', (tester) async {
await openSettings(tester, FakeDeviceDictionaryGateway());
expect(find.text('Japanese on this device'), findsNothing);
expect(find.text('Dictionaries on this device'), findsNothing);
});
});