Tester feedback: offline mode, pt-PT, menus, layout and translations

Offline (read-only) mode
- The last connected radio is remembered; with no radio the app opens on
  its saved contacts, channels, messages and unread counts.
- Main screens stay open on disconnect. A Connect button replaces the
  battery and signal indicators, with a sheet to reconnect, choose a
  radio or stop a pending reconnect.
- While disconnected everything is read-only: the composer becomes a
  "connect to send" bar (drafts kept) and controls that change the radio
  or stored history are disabled or hidden.
- Resending while disconnected no longer deletes the message; a
  different radio no longer shows the previous radio's channels.
- Notification taps open the saved chat while offline.

Chats and menus
- Channel chat menu: notifications, edit channel, delete channel; the
  filter row lines up with the others; bell moved out of the app bar.
- DM and room menus: remove from contacts; rooms get room management.
- Search field uses the full app bar; long-press a result to copy.
- Hashtag channel titles no longer read "# #name"; more room around the
  radio activity dot.
- Repeat filter: short messages from one sender are caught at the same
  count as long ones.

Layout
- Shared menu row (wraps to two lines) and segment label (never splits
  a word) used across the app.
- One Scan button on the scanner; consistent settings tile titles;
  contact "last seen" wraps instead of truncating; unfetched repeater
  settings are dimmed.

Localization
- New European Portuguese locale (pt_PT); regional locales are handled
  by the language picker, notifications and the background service.
- Fill 67 missing strings per locale, including backup and restore.
- Keep "Flood" and "Zero Hop" untranslated, shorten "last seen" and
  routing labels, and fix mistranslated scan, theme and hop strings.
- Received-image strings, badge and caption come from translations.
- Regenerate the Czech localizations, which were missing strings.

Docs
- Add documentation/design.md (UI reference) and offline-mode.md;
  update channel, chat, navigation and scanner docs.
This commit is contained in:
zjs81 committed 2026-11-09 21:18:29 -07:00
1 parent 47f2293a5c
commit 462159e803
108 files changed
+17435 -4536

No files matched your search

+57
View File
@@ -0,0 +1,57 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/widgets/mesh_ui.dart';
Widget _segments(double width, List<String> labels) {
return MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox(
width: width,
child: SegmentedButton<int>(
showSelectedIcon: false,
segments: [
for (var i = 0; i < labels.length; i++)
ButtonSegment(value: i, label: MeshSegmentLabel(labels[i])),
],
selected: const {0},
onSelectionChanged: (_) {},
),
),
),
),
);
}
void main() {
testWidgets('short labels lay out on one line at full size', (tester) async {
await tester.pumpWidget(_segments(360, ['Auto', 'Flood', 'Manual']));
expect(tester.takeException(), isNull);
expect(find.bySemanticsLabel('Flood'), findsOneWidget);
});
testWidgets('long labels in narrow segments do not overflow', (tester) async {
await tester.pumpWidget(
_segments(240, [
'Padrão do sistema',
'Inundação',
'Automatisch',
'Manual',
]),
);
expect(tester.takeException(), isNull);
final labels = find.byType(MeshSegmentLabel);
final multi = tester.getSize(labels.at(0));
final longWord = tester.getSize(labels.at(1));
final single = tester.getSize(labels.at(3));
// The multi-word label wraps at its space instead of shrinking further;
// a single long word stays on one line.
expect(multi.height, greaterThan(single.height));
expect(longWord.height, lessThanOrEqualTo(single.height));
for (var i = 0; i < 4; i++) {
final box = tester.renderObject<RenderBox>(labels.at(i));
final parent = box.parent! as RenderBox;
expect(box.size.width, lessThanOrEqualTo(parent.size.width));
}
});
}
+15 -4
View File
@@ -3,6 +3,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:meshcore_open/l10n/app_localizations.dart';
import 'package:meshcore_open/models/image_codec_support.dart';
import 'package:meshcore_open/services/image_chunk_transport.dart';
import 'package:meshcore_open/widgets/image_send_codec_binding.dart';
@@ -81,6 +82,8 @@ Future<void> _pumpBubble(
}) async {
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: ReceivedImageMessage(
streamId: streamId,
@@ -112,6 +115,8 @@ void main() {
);
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: ReceivedImageMessage(
streamId: entry.streamId,
@@ -146,6 +151,8 @@ void main() {
await store2.load();
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: ReceivedImageMessage(
streamId: 'incoming',
@@ -159,7 +166,7 @@ void main() {
await tester.pump();
await tester.pump();
expect(find.text('AI-reconstructed'), findsOneWidget);
expect(find.textContaining('Fine detail is generated'), findsOneWidget);
expect(find.textContaining('fine detail is generated'), findsOneWidget);
});
testWidgets('receiving state shows the packet count', (tester) async {
@@ -178,6 +185,8 @@ void main() {
expect(entry!.state, ReceivedImageState.receiving);
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: ReceivedImageMessage(
streamId: entry.streamId,
@@ -215,6 +224,8 @@ void main() {
final store = await _awaitingStore(bytes: 209, packets: 3);
await tester.pumpWidget(
MaterialApp(
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: ReceivedImageMessage(
streamId: 'await1',
@@ -412,8 +423,8 @@ void main() {
await tester.pump();
expect(find.text('AI-reconstructed'), findsOneWidget);
expect(find.textContaining('Reconstructed by an AI model'), findsOneWidget);
expect(find.textContaining('Fine detail is generated'), findsOneWidget);
expect(find.textContaining('AI-reconstructed from'), findsOneWidget);
expect(find.textContaining('fine detail is generated'), findsOneWidget);
});
testWidgets('the caption quotes the real bitstream size, not a nominal one', (
@@ -498,7 +509,7 @@ void main() {
await tester.pump();
final caption = tester.widget<Text>(
find.textContaining('Reconstructed by an AI model'),
find.textContaining('AI-reconstructed from'),
);
expect(caption.maxLines, isNull, reason: 'the sentence must wrap in full');
expect(caption.overflow, isNot(TextOverflow.ellipsis));