feat: Enhance SAR message handling with color indexing and localization

- Added `sarColorIndex` to `Message` and `SarMarker` models to support color indexing for SAR markers.
- Introduced a standard color palette in `SarTemplate` and methods to retrieve colors based on index.
- Updated `SarTemplate` to include localization for template names.
- Modified `SarUpdateSheet` and message sending logic to include color index in SAR messages.
- Enhanced `SarMessageParser` to support both old and new message formats with color index.
- Updated UI components to reflect changes in SAR marker color handling based on the new color index.
- Improved sample data generation to utilize localized strings for better testing and demonstration.
This commit is contained in:
Janez T
2025-10-23 19:17:13 +02:00
parent b70eed1bf2
commit 98cda8c976
28 changed files with 2734 additions and 270 deletions

View File

@@ -9,6 +9,7 @@ import '../../models/message.dart';
import '../../providers/connection_provider.dart';
import '../../providers/messages_provider.dart';
import '../../providers/app_provider.dart';
import '../../services/message_destination_preferences.dart';
import '../../utils/toast_logger.dart';
import '../../l10n/app_localizations.dart';
@@ -159,6 +160,15 @@ class _DirectMessageSheetState extends State<DirectMessageSheet> {
messagesProvider.markMessageFailed(messageId);
}
// Save the recipient to preferences so messages tab filters to this contact
final recipientType = widget.contact.type == ContactType.room
? MessageDestinationPreferences.destinationTypeRoom
: MessageDestinationPreferences.destinationTypeContact;
await MessageDestinationPreferences.setDestination(
recipientType,
recipientPublicKey: widget.contact.publicKeyHex,
);
_textController.clear();
_focusNode.unfocus();