From 9274c0701b5656d27add8e67ba1c0aa66ad512fd Mon Sep 17 00:00:00 2001 From: waclaw66 Date: Tue, 19 Mar 2024 16:22:44 +0200 Subject: [PATCH] fix(mobile): do not show hidden people (#8072) * fix(mobile): do not show hidden people * dart format fix --- .../asset_viewer/ui/exif_sheet/exif_people.dart | 16 +++++++++------- .../modules/search/ui/curated_people_row.dart | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mobile/lib/modules/asset_viewer/ui/exif_sheet/exif_people.dart b/mobile/lib/modules/asset_viewer/ui/exif_sheet/exif_people.dart index a94a1239f6..620f4f3cd0 100644 --- a/mobile/lib/modules/asset_viewer/ui/exif_sheet/exif_people.dart +++ b/mobile/lib/modules/asset_viewer/ui/exif_sheet/exif_people.dart @@ -22,8 +22,11 @@ class ExifPeople extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final peopleProvider = ref.watch(assetPeopleNotifierProvider(asset).notifier); - final people = ref.watch(assetPeopleNotifierProvider(asset)); - final double imageSize = math.min(context.width / 3, 150); + final people = ref + .watch(assetPeopleNotifierProvider(asset)) + .value + ?.where((p) => !p.isHidden); + final double imageSize = math.min(context.width / 3, 120); showPersonNameEditModel( String personId, @@ -40,15 +43,14 @@ class ExifPeople extends ConsumerWidget { }); } - if (people.value?.isEmpty ?? true) { + if (people?.isEmpty ?? true) { // Empty list or loading return Container(); } - final curatedPeople = people.value - ?.map((p) => CuratedContent(id: p.id, label: p.name)) - .toList() ?? - []; + final curatedPeople = + people?.map((p) => CuratedContent(id: p.id, label: p.name)).toList() ?? + []; return Column( children: [ diff --git a/mobile/lib/modules/search/ui/curated_people_row.dart b/mobile/lib/modules/search/ui/curated_people_row.dart index 78dc1af4f1..049c1ce465 100644 --- a/mobile/lib/modules/search/ui/curated_people_row.dart +++ b/mobile/lib/modules/search/ui/curated_people_row.dart @@ -23,7 +23,7 @@ class CuratedPeopleRow extends StatelessWidget { @override Widget build(BuildContext context) { - const imageSize = 85.0; + const imageSize = 80.0; // Guard empty [content] if (content.isEmpty) {