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:
1 parent
47f2293a5c
commit
462159e803
108 files changed
+17435
-4536
No files matched your search
@@ -2,6 +2,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_foreground_task/flutter_foreground_task.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../l10n/locale_tag.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
|
||||
class BackgroundService {
|
||||
@@ -65,7 +66,7 @@ class BackgroundService {
|
||||
final supported = AppLocalizations.supportedLocales;
|
||||
final override = _languageOverrideProvider?.call();
|
||||
if (override != null && override.isNotEmpty) {
|
||||
final overrideLocale = Locale(override);
|
||||
final overrideLocale = localeFromTag(override);
|
||||
final isSupported = supported.any(
|
||||
(l) => l.languageCode == overrideLocale.languageCode,
|
||||
);
|
||||
|
||||
@@ -48,10 +48,9 @@ class _SeenMessage {
|
||||
/// first re-send). Higher values tolerate people re-sending when they see
|
||||
/// no repeat or reply.
|
||||
///
|
||||
/// The same-sender rule only applies to texts of at least
|
||||
/// [sameSenderMinWords] words and [sameSenderMinLength] characters: people
|
||||
/// naturally repeat short replies ("ok", "yes", "test" when checking reach),
|
||||
/// while spam that gets re-posted is a whole sentence.
|
||||
/// The same-sender rule applies to texts of any length, so one word sent
|
||||
/// over and over ("hello", "test") is caught at the same count as a
|
||||
/// sentence.
|
||||
///
|
||||
/// The cross-sender rule only applies to sentence-length texts (at least
|
||||
/// [crossSenderMinWords] words): short greetings like "Happy New Year!" or
|
||||
@@ -60,8 +59,6 @@ class _SeenMessage {
|
||||
class DuplicateTracker {
|
||||
DuplicateTracker({
|
||||
this.sameSenderWindow = const Duration(minutes: 10),
|
||||
this.sameSenderMinLength = 10,
|
||||
this.sameSenderMinWords = 3,
|
||||
this.sameSenderSends = 2,
|
||||
this.crossSenderWindow = const Duration(minutes: 30),
|
||||
this.crossSenderMinSenders = 3,
|
||||
@@ -72,10 +69,6 @@ class DuplicateTracker {
|
||||
|
||||
final Duration sameSenderWindow;
|
||||
|
||||
/// Minimum length / word count for the same-sender rule (see class docs).
|
||||
final int sameSenderMinLength;
|
||||
final int sameSenderMinWords;
|
||||
|
||||
/// Which send in a row of the same text is flagged; can be overridden per
|
||||
/// call so a settings change applies immediately.
|
||||
final int sameSenderSends;
|
||||
@@ -163,9 +156,7 @@ class DuplicateTracker {
|
||||
senders.add(entry.sender);
|
||||
}
|
||||
}
|
||||
if (sends >= flagAt &&
|
||||
key.length >= sameSenderMinLength &&
|
||||
_wordCount(key) >= sameSenderMinWords) {
|
||||
if (sends >= flagAt) {
|
||||
result = FilterReason.duplicate;
|
||||
} else if (key.length >= crossSenderMinLength &&
|
||||
_wordCount(key) >= crossSenderMinWords &&
|
||||
|
||||
@@ -36,7 +36,8 @@ class NotificationNavigator {
|
||||
if (payload == null) return;
|
||||
notifications.pendingTap.value = null;
|
||||
final navigator = navigatorKey.currentState;
|
||||
if (navigator == null || !connector.isConnected) return;
|
||||
// Offline the last radio's saved chats still open (read-only).
|
||||
if (navigator == null || !connector.hasRadioData) return;
|
||||
|
||||
final sep = payload.indexOf(':');
|
||||
if (sep <= 0) return;
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../l10n/locale_tag.dart';
|
||||
|
||||
/// Name under which the main isolate registers the port that receives
|
||||
/// notification actions from the plugin's background isolate.
|
||||
@@ -188,7 +189,7 @@ Future<AppLocalizations> _backgroundLocalizations() async {
|
||||
);
|
||||
} catch (_) {}
|
||||
for (final locale in [
|
||||
if (code != null) Locale(code),
|
||||
if (code != null) localeFromTag(code),
|
||||
PlatformDispatcher.instance.locale,
|
||||
]) {
|
||||
try {
|
||||
|
||||
@@ -14,6 +14,7 @@ import '../helpers/marker_message.dart';
|
||||
import '../helpers/message_url_image_helper.dart';
|
||||
import '../helpers/reaction_helper.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../l10n/locale_tag.dart';
|
||||
import '../models/app_settings.dart';
|
||||
import '../storage/prefs_manager.dart';
|
||||
import '../utils/platform_info.dart';
|
||||
@@ -44,7 +45,7 @@ class NotificationService {
|
||||
try {
|
||||
PrefsManager.instance.setString(
|
||||
notificationLanguagePrefsKey,
|
||||
locale.languageCode,
|
||||
localeTag(locale),
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user