From 53cb48b87ca465cb3c975a68e2b40002b14d5b6c Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Thu, 17 Oct 2024 22:02:40 +0530 Subject: [PATCH] [mob][photos] Make merge clearer --- .../people/add_person_action_sheet.dart | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart index 0e134ca70c..187cfa8c76 100644 --- a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart +++ b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart @@ -222,8 +222,7 @@ class _PersonActionSheetState extends State { child: Padding( padding: const EdgeInsets.only(right: 12), child: ListView.separated( - itemCount: - searchResults.length + (shouldShowAddPerson ? 1 : 0), + itemCount: searchResults.length + 1, itemBuilder: (context, index) { if (index == 0 && shouldShowAddPerson) { return GestureDetector( @@ -238,8 +237,21 @@ class _PersonActionSheetState extends State { }, ); } - final person = - searchResults[index - (shouldShowAddPerson ? 1 : 0)]; + if (index == 0 && !shouldShowAddPerson) { + return Padding( + padding: const EdgeInsets.fromLTRB(0, 8, 0, 16), + child: Center( + child: Text( + "Merge with existing", + style: getEnteTextTheme(context).body.copyWith( + color: + getEnteColorScheme(context).textMuted, + ), + ), + ), + ); + } + final person = searchResults[index - 1]; return PersonRowItem( person: person.$1, personFile: person.$2,