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

+62 -99
View File
@@ -29,9 +29,10 @@ import '../services/network_map/network_map_api_client.dart';
import '../services/ui_view_state_service.dart';
import '../storage/prefs_manager.dart';
import '../utils/contact_search.dart';
import '../utils/disconnect_navigation_mixin.dart';
import '../utils/radio_guard.dart';
import '../utils/battery_utils.dart';
import '../utils/route_transitions.dart';
import '../widgets/connect_sheet.dart';
import '../widgets/map_poi_cluster.dart';
import '../widgets/marker_label_dialog.dart';
import '../widgets/network_map_online_layer.dart';
@@ -74,7 +75,7 @@ class MapScreen extends StatefulWidget {
State<MapScreen> createState() => _MapScreenState();
}
class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
class _MapScreenState extends State<MapScreen> {
// Zoom level at which node labels start to appear
static const double _labelZoomThreshold = 14.0;
// Below this zoom, nearby nodes collapse into clusters.
@@ -513,9 +514,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
_MapConnectorSnapshot.fromConnector,
);
final connector = connectorSnapshot.connector;
if (!checkConnectionAndNavigate(connector)) {
return const SizedBox.shrink();
}
final readOnly = isRadioReadOnly(connector);
final settings = context.select<AppSettingsService, AppSettings>(
(service) => service.settings,
);
@@ -767,12 +766,9 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
connector.selfLatitude != null &&
connector.selfLongitude != null)
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.radar),
const SizedBox(width: 8),
Text(context.l10n.contacts_pathTrace),
],
child: MeshMenuItemRow(
icon: Icons.radar,
label: context.l10n.contacts_pathTrace,
),
onTap: () => _openPathTrace(
connector,
@@ -784,23 +780,18 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
),
if (!_isBuildingPathTrace)
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.radar),
const SizedBox(width: 8),
Text(context.l10n.manualTrace_menuItem),
],
enabled: !readOnly,
child: MeshMenuItemRow(
icon: Icons.radar,
label: context.l10n.manualTrace_menuItem,
),
onTap: () => ManualPathTraceScreen.open(context),
),
if (!_isBuildingPathTrace)
PopupMenuItem(
child: Row(
children: [
const LosIcon(),
const SizedBox(width: 8),
Text(context.l10n.map_lineOfSight),
],
child: MeshMenuItemRow(
leading: const LosIcon(size: 20),
label: context.l10n.map_lineOfSight,
),
onTap: () {
final candidates = <LineOfSightEndpoint>[];
@@ -839,26 +830,14 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
);
},
),
connectionMenuItem(this.context, context),
PopupMenuItem(
child: Row(
children: [
Icon(
Icons.logout,
color: Theme.of(context).colorScheme.error,
),
const SizedBox(width: 8),
Text(context.l10n.common_disconnect),
],
),
onTap: () => _disconnect(context, connector),
),
PopupMenuItem(
child: Row(
children: [
const ThemedIcon(ThemeIconSlot.settings),
const SizedBox(width: 8),
Text(context.l10n.settings_title),
],
child: MeshMenuItemRow(
leading: const ThemedIcon(
ThemeIconSlot.settings,
size: 20,
),
label: context.l10n.settings_title,
),
onTap: () => Navigator.push(
context,
@@ -1710,33 +1689,37 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
],
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'$count',
style: MeshTheme.mono(
fontSize: count >= 100 ? 13 : 15,
fontWeight: FontWeight.w800,
color: MapPalette.markerOutline,
),
),
if (online > 0)
Container(
width: 7,
height: 7,
margin: const EdgeInsets.only(top: 1),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MapPalette.online,
border: Border.all(
color: MapPalette.markerOutline,
width: 1,
),
// The marker has a fixed size; large text scales shrink to fit it.
child: FittedBox(
fit: BoxFit.scaleDown,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'$count',
style: MeshTheme.mono(
fontSize: count >= 100 ? 13 : 15,
fontWeight: FontWeight.w800,
color: MapPalette.markerOutline,
),
),
],
if (online > 0)
Container(
width: 7,
height: 7,
margin: const EdgeInsets.only(top: 1),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MapPalette.online,
border: Border.all(
color: MapPalette.markerOutline,
width: 1,
),
),
),
],
),
),
),
),
@@ -2204,19 +2187,19 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
ButtonSegment(
value: MapSourceOption.local,
icon: const Icon(Icons.radio, size: 20),
label: Text(l10n.networkMap_sourceLocal),
label: MeshSegmentLabel(l10n.networkMap_sourceLocal),
tooltip: l10n.networkMap_sourceLocalHint,
),
ButtonSegment(
value: MapSourceOption.online,
icon: const Icon(Icons.public, size: 20),
label: Text(l10n.networkMap_sourceOnline),
label: MeshSegmentLabel(l10n.networkMap_sourceOnline),
tooltip: l10n.networkMap_sourceOnlineHint,
),
ButtonSegment(
value: MapSourceOption.both,
icon: const Icon(Icons.layers, size: 20),
label: Text(l10n.networkMap_sourceBoth),
label: MeshSegmentLabel(l10n.networkMap_sourceBoth),
tooltip: l10n.networkMap_sourceBothHint,
),
],
@@ -3200,33 +3183,6 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
}
}
Future<void> _disconnect(
BuildContext context,
MeshCoreConnector connector,
) async {
final confirmed = await showDialog<bool>(
context: context,
builder: (dialogContext) => AlertDialog(
title: Text(context.l10n.common_disconnect),
content: Text(context.l10n.map_disconnectConfirm),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext, false),
child: Text(context.l10n.common_cancel),
),
TextButton(
onPressed: () => Navigator.pop(dialogContext, true),
child: Text(context.l10n.common_disconnect),
),
],
),
);
if (confirmed == true) {
await connector.disconnect();
}
}
void _showMarkerInfo(_SharedMarker marker) {
showDialog(
context: context,
@@ -3348,6 +3304,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
required MeshCoreConnector connector,
required LatLng position,
}) {
final readOnly = isRadioReadOnly(connector);
showModalBottomSheet(
context: context,
builder: (sheetContext) => SafeArea(
@@ -3355,6 +3312,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
enabled: !readOnly,
leading: const Icon(Icons.place),
title: Text(context.l10n.map_shareMarkerHere),
onTap: () {
@@ -3369,6 +3327,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
},
),
ListTile(
enabled: !readOnly,
leading: const Icon(Icons.my_location),
title: Text(context.l10n.map_setAsMyLocation),
onTap: () {
@@ -4175,12 +4134,16 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
ButtonSegment(
value: true,
icon: const Icon(Icons.sync_alt),
label: Text(l10n.map_pathTraceModeRoundTrip),
label: MeshSegmentLabel(
l10n.map_pathTraceModeRoundTrip,
),
),
ButtonSegment(
value: false,
icon: const Icon(Icons.arrow_forward),
label: Text(l10n.map_pathTraceModeAsEntered),
label: MeshSegmentLabel(
l10n.map_pathTraceModeAsEntered,
),
),
],
selected: {returnPath},