From 7486837ad05d809d274310adab04e3b177ac1a3f Mon Sep 17 00:00:00 2001 From: Janez T Date: Sun, 22 Mar 2026 09:37:53 +0100 Subject: [PATCH] fix: Compact recipient selector #0 --- ios/Runner.xcodeproj/project.pbxproj | 12 ++--- ios/Runner/Info.plist | 2 +- .../messages/recipient_selector_sheet.dart | 54 ++++++++++--------- pubspec.yaml | 2 +- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 212456f..9125090 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -489,7 +489,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -511,7 +511,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -530,7 +530,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -547,7 +547,7 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; @@ -679,7 +679,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; @@ -702,7 +702,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 123; + CURRENT_PROJECT_VERSION = 124; DEVELOPMENT_TEAM = JND55328G8; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index f2bbe19..bcbd7b6 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -43,7 +43,7 @@ CFBundleSignature ???? CFBundleVersion - 123 + 124 LSRequiresIPhoneOS ITSAppUsesNonExemptEncryption diff --git a/lib/widgets/messages/recipient_selector_sheet.dart b/lib/widgets/messages/recipient_selector_sheet.dart index 4f9e02b..7aa90c1 100644 --- a/lib/widgets/messages/recipient_selector_sheet.dart +++ b/lib/widgets/messages/recipient_selector_sheet.dart @@ -174,6 +174,8 @@ class _RecipientSelectorSheetState extends State { return '${l10n.channel} $channelIdx • $shortKey'; } + bool _isDenseSection(String type) => type == 'channel' || type == 'contact'; + @override Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; @@ -332,6 +334,7 @@ class _RecipientSelectorSheetState extends State { subtitle: _channelSubtitle(context, channel), unreadCount: _unreadFor(channel), isSelected: _isSelected('channel', channel), + compact: true, onTap: () { widget.onSelect('channel', channel); Navigator.pop(context); @@ -357,6 +360,7 @@ class _RecipientSelectorSheetState extends State { subtitle: contact.publicKeyShort, unreadCount: _unreadFor(contact), isSelected: _isSelected('contact', contact), + compact: true, onTap: () { widget.onSelect('contact', contact); Navigator.pop(context); @@ -504,10 +508,11 @@ class _RecipientSelectorSheetState extends State { }) { final colorScheme = Theme.of(context).colorScheme; final accentColor = _sectionColor(context, type); + final compact = _isDenseSection(type); return Container( margin: const EdgeInsets.only(bottom: 12), - padding: const EdgeInsets.all(14), + padding: EdgeInsets.all(compact ? 12 : 14), decoration: BoxDecoration( color: colorScheme.surfaceContainerLow, borderRadius: BorderRadius.circular(24), @@ -519,16 +524,16 @@ class _RecipientSelectorSheetState extends State { Row( children: [ Container( - width: 38, - height: 38, + width: compact ? 34 : 38, + height: compact ? 34 : 38, decoration: BoxDecoration( color: accentColor.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(12), ), alignment: Alignment.center, - child: Icon(icon, size: 18, color: accentColor), + child: Icon(icon, size: compact ? 16 : 18, color: accentColor), ), - const SizedBox(width: 10), + SizedBox(width: compact ? 8 : 10), Expanded( child: Text( title, @@ -539,9 +544,9 @@ class _RecipientSelectorSheetState extends State { ), ), Container( - padding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 5, + padding: EdgeInsets.symmetric( + horizontal: compact ? 9 : 10, + vertical: compact ? 4 : 5, ), decoration: BoxDecoration( color: colorScheme.surface, @@ -567,7 +572,7 @@ class _RecipientSelectorSheetState extends State { color: colorScheme.onSurfaceVariant, ), ), - const SizedBox(height: 12), + SizedBox(height: compact ? 10 : 12), if (children.isEmpty) Padding( padding: const EdgeInsets.symmetric(vertical: 8), @@ -582,7 +587,7 @@ class _RecipientSelectorSheetState extends State { else ...[ for (var i = 0; i < children.length; i++) ...[ children[i], - if (i != children.length - 1) const SizedBox(height: 8), + if (i != children.length - 1) SizedBox(height: compact ? 6 : 8), ], ], ], @@ -679,6 +684,7 @@ class _RecipientSelectorSheetState extends State { required String subtitle, required int unreadCount, required bool isSelected, + bool compact = false, required VoidCallback onTap, }) { final colorScheme = Theme.of(context).colorScheme; @@ -687,14 +693,14 @@ class _RecipientSelectorSheetState extends State { return Material( color: Colors.transparent, child: InkWell( - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(compact ? 18 : 20), onTap: onTap, child: Ink( decoration: BoxDecoration( color: isSelected ? accentColor.withValues(alpha: 0.12) : colorScheme.surface.withValues(alpha: 0.82), - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(compact ? 18 : 20), border: Border.all( color: isSelected ? accentColor.withValues(alpha: 0.24) @@ -702,7 +708,7 @@ class _RecipientSelectorSheetState extends State { ), ), child: Padding( - padding: const EdgeInsets.all(12), + padding: EdgeInsets.all(compact ? 10 : 12), child: Row( children: [ Stack( @@ -710,15 +716,15 @@ class _RecipientSelectorSheetState extends State { children: [ ContactAvatar( contact: contact, - radius: 22, + radius: compact ? 20 : 22, displayName: title, ), Positioned( right: -3, bottom: -3, child: Container( - width: 18, - height: 18, + width: compact ? 16 : 18, + height: compact ? 16 : 18, decoration: BoxDecoration( color: colorScheme.surface, shape: BoxShape.circle, @@ -729,14 +735,14 @@ class _RecipientSelectorSheetState extends State { alignment: Alignment.center, child: Icon( _typeIcon(contact), - size: 10, + size: compact ? 9 : 10, color: accentColor, ), ), ), ], ), - const SizedBox(width: 12), + SizedBox(width: compact ? 10 : 12), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -756,11 +762,11 @@ class _RecipientSelectorSheetState extends State { ), ), if (contact.isPublicChannel) ...[ - const SizedBox(width: 8), + SizedBox(width: compact ? 6 : 8), Container( - padding: const EdgeInsets.symmetric( - horizontal: 8, - vertical: 3, + padding: EdgeInsets.symmetric( + horizontal: compact ? 7 : 8, + vertical: compact ? 2 : 3, ), decoration: BoxDecoration( color: accentColor.withValues(alpha: 0.10), @@ -778,7 +784,7 @@ class _RecipientSelectorSheetState extends State { ], ], ), - const SizedBox(height: 4), + SizedBox(height: compact ? 2 : 4), Text( subtitle, maxLines: 1, @@ -791,7 +797,7 @@ class _RecipientSelectorSheetState extends State { ], ), ), - const SizedBox(width: 10), + SizedBox(width: compact ? 8 : 10), _buildTrailing( context, unreadCount: unreadCount, diff --git a/pubspec.yaml b/pubspec.yaml index 04da66d..ee23870 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 2026.0321.1+37 +version: 2026.0322.1+38 environment: sdk: ^3.9.2