Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob][photos] Remove 'Descriptions' section from search tab

ashilknceeac4222e86
diff --git a/mobile/lib/generated/intl/messages_de.dart b/mobile/lib/generated/intl/messages_de.dart
index a639ab52b5..d04dac53cc 100644
--- a/mobile/lib/generated/intl/messages_de.dart
+++ b/mobile/lib/generated/intl/messages_de.dart
@@ -688,7 +688,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Geteiltes Album löschen?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"Dieses Album wird für alle gelöscht\n\nDu wirst den Zugriff auf geteilte Fotos in diesem Album, die anderen gehören, verlieren"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Beschreibungen"),
"deselectAll": MessageLookupByLibrary.simpleMessage("Alle abwählen"),
"designedToOutlive":
MessageLookupByLibrary.simpleMessage("Entwickelt um zu bewahren"),
diff --git a/mobile/lib/generated/intl/messages_en.dart b/mobile/lib/generated/intl/messages_en.dart
index f4be963dda..6c85cba8b3 100644
--- a/mobile/lib/generated/intl/messages_en.dart
+++ b/mobile/lib/generated/intl/messages_en.dart
@@ -671,7 +671,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Delete shared album?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Descriptions"),
"deselectAll": MessageLookupByLibrary.simpleMessage("Deselect all"),
"designedToOutlive":
MessageLookupByLibrary.simpleMessage("Designed to outlive"),
diff --git a/mobile/lib/generated/intl/messages_es.dart b/mobile/lib/generated/intl/messages_es.dart
index 0ebc9f1bbc..7d3ba12e84 100644
--- a/mobile/lib/generated/intl/messages_es.dart
+++ b/mobile/lib/generated/intl/messages_es.dart
@@ -635,7 +635,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("¿Borrar álbum compartido?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"El álbum se eliminará para todos\n\nPerderás el acceso a las fotos compartidas en este álbum que son propiedad de otros"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Descripciones"),
"deselectAll":
MessageLookupByLibrary.simpleMessage("Deseleccionar todo"),
"designedToOutlive":
diff --git a/mobile/lib/generated/intl/messages_fr.dart b/mobile/lib/generated/intl/messages_fr.dart
index baeefe36fe..0641a00830 100644
--- a/mobile/lib/generated/intl/messages_fr.dart
+++ b/mobile/lib/generated/intl/messages_fr.dart
@@ -707,7 +707,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Supprimer l\'album partagé ?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"L\'album sera supprimé pour tout le monde\n\nVous perdrez l\'accès aux photos partagées dans cet album qui sont détenues par d\'autres personnes"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Descriptions"),
"deselectAll":
MessageLookupByLibrary.simpleMessage("Tout déselectionner"),
"designedToOutlive":
diff --git a/mobile/lib/generated/intl/messages_id.dart b/mobile/lib/generated/intl/messages_id.dart
index 0cff5d16c1..1f469c1df0 100644
--- a/mobile/lib/generated/intl/messages_id.dart
+++ b/mobile/lib/generated/intl/messages_id.dart
@@ -540,7 +540,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Hapus album bersama?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"Album ini akan di hapus untuk semua\n\nKamu akan kehilangan akses ke foto yang di bagikan dalam album ini yang di miliki oleh pengguna lain"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Keterangan"),
"designedToOutlive":
MessageLookupByLibrary.simpleMessage("Dibuat untuk melestarikan"),
"details": MessageLookupByLibrary.simpleMessage("Rincian"),
diff --git a/mobile/lib/generated/intl/messages_it.dart b/mobile/lib/generated/intl/messages_it.dart
index 7322937358..6e884f15af 100644
--- a/mobile/lib/generated/intl/messages_it.dart
+++ b/mobile/lib/generated/intl/messages_it.dart
@@ -654,7 +654,6 @@ class MessageLookup extends MessageLookupByLibrary {
"Eliminare l\'album condiviso?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"L\'album verrà eliminato per tutti\n\nPerderai l\'accesso alle foto condivise in questo album che sono di proprietà di altri"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Descrizioni"),
"deselectAll":
MessageLookupByLibrary.simpleMessage("Deseleziona tutti"),
"designedToOutlive":
diff --git a/mobile/lib/generated/intl/messages_ja.dart b/mobile/lib/generated/intl/messages_ja.dart
index 297c8aa754..2f2b429688 100644
--- a/mobile/lib/generated/intl/messages_ja.dart
+++ b/mobile/lib/generated/intl/messages_ja.dart
@@ -557,7 +557,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("共有アルバムを削除しますか?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"このアルバムは他の人からも削除されます\n\n他の人が共有してくれた写真も、あなたからは見れなくなります"),
- "descriptions": MessageLookupByLibrary.simpleMessage("説明文"),
"deselectAll": MessageLookupByLibrary.simpleMessage("選択解除"),
"designedToOutlive":
MessageLookupByLibrary.simpleMessage("生き延びるためのデザイン"),
diff --git a/mobile/lib/generated/intl/messages_lt.dart b/mobile/lib/generated/intl/messages_lt.dart
index b09f8c731d..0c00731aaf 100644
--- a/mobile/lib/generated/intl/messages_lt.dart
+++ b/mobile/lib/generated/intl/messages_lt.dart
@@ -387,7 +387,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Mano priežastis nenurodyta"),
"deleteRequestSLAText": MessageLookupByLibrary.simpleMessage(
"Jūsų prašymas bus apdorotas per 72 valandas."),
- "descriptions": MessageLookupByLibrary.simpleMessage("Aprašymai"),
"designedToOutlive":
MessageLookupByLibrary.simpleMessage("Sukurta išgyventi"),
"developerSettings":
diff --git a/mobile/lib/generated/intl/messages_nl.dart b/mobile/lib/generated/intl/messages_nl.dart
index dc8a8c5e90..60521812b3 100644
--- a/mobile/lib/generated/intl/messages_nl.dart
+++ b/mobile/lib/generated/intl/messages_nl.dart
@@ -692,7 +692,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Gedeeld album verwijderen?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"Het album wordt verwijderd voor iedereen\n\nJe verliest de toegang tot gedeelde foto\'s in dit album die eigendom zijn van anderen"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Beschrijvingen"),
"deselectAll":
MessageLookupByLibrary.simpleMessage("Alles deselecteren"),
"designedToOutlive": MessageLookupByLibrary.simpleMessage(
diff --git a/mobile/lib/generated/intl/messages_pl.dart b/mobile/lib/generated/intl/messages_pl.dart
index fc3e013763..aae60b6e76 100644
--- a/mobile/lib/generated/intl/messages_pl.dart
+++ b/mobile/lib/generated/intl/messages_pl.dart
@@ -651,7 +651,6 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Usunąć udostępniony album?"),
"deleteSharedAlbumDialogBody": MessageLookupByLibrary.simpleMessage(
"Album zostanie usunięty dla wszystkich\n\nUtracisz dostęp do udostępnionych zdjęć w tym albumie, które są własnością innych osób"),
- "descriptions": MessageLookupByLibrary.simpleMessage("Opisy"),
"deselectAll": MessageLookupByLibrary.simpleMessage("Odznacz wszystko"),
"designedToOutlive": MessageLookupByLibrary.simpleMessage(
"Zaprojektowane do przetrwania"),
diff --git a/mobile/lib/generated/l10n.dart b/mobile/lib/generated/l10n.dart
index 8015dcac1a..438a1f90fe 100644
--- a/mobile/lib/generated/l10n.dart
+++ b/mobile/lib/generated/l10n.dart
@@ -8849,16 +8849,6 @@ class S {
);
}
- /// `Descriptions`
- String get descriptions {
- return Intl.message(
- 'Descriptions',
- name: 'descriptions',
- desc: '',
- args: [],
- );
- }
-
/// `Add a name`
String get addAName {
return Intl.message(
diff --git a/mobile/lib/l10n/intl_en.arb b/mobile/lib/l10n/intl_en.arb
index 9a5203f085..fe015edcb4 100644
--- a/mobile/lib/l10n/intl_en.arb
+++ b/mobile/lib/l10n/intl_en.arb
@@ -1246,7 +1246,6 @@
"deviceCodeHint": "Enter the code",
"joinDiscord": "Join Discord",
"locations": "Locations",
- "descriptions": "Descriptions",
"addAName": "Add a name",
"findThemQuickly": "Find them quickly",
"@findThemQuickly": {
diff --git a/mobile/lib/models/search/search_types.dart b/mobile/lib/models/search/search_types.dart
index 749d5e5dbc..c266d3221f 100644
--- a/mobile/lib/models/search/search_types.dart
+++ b/mobile/lib/models/search/search_types.dart
@@ -46,7 +46,6 @@ enum SectionType {
moment,
album,
// People section shows the files shared by other persons
- fileCaption,
contacts,
fileTypesAndExtension,
}
@@ -69,8 +68,6 @@ extension SectionTypeExtensions on SectionType {
return S.of(context).albums;
case SectionType.fileTypesAndExtension:
return S.of(context).fileTypes;
- case SectionType.fileCaption:
- return S.of(context).descriptions;
}
}
@@ -90,8 +87,6 @@ extension SectionTypeExtensions on SectionType {
return S.of(context).searchAlbumsEmptySection;
case SectionType.fileTypesAndExtension:
return S.of(context).searchFileTypesAndNamesEmptySection;
- case SectionType.fileCaption:
- return S.of(context).searchCaptionEmptySection;
}
}
@@ -113,8 +108,6 @@ extension SectionTypeExtensions on SectionType {
return true;
case SectionType.fileTypesAndExtension:
return false;
- case SectionType.fileCaption:
- return false;
}
}
@@ -136,8 +129,6 @@ extension SectionTypeExtensions on SectionType {
return true;
case SectionType.fileTypesAndExtension:
return false;
- case SectionType.fileCaption:
- return false;
}
}
@@ -159,8 +150,6 @@ extension SectionTypeExtensions on SectionType {
return S.of(context).addNew;
case SectionType.fileTypesAndExtension:
return "";
- case SectionType.fileCaption:
- return S.of(context).addNew;
}
}
@@ -180,8 +169,6 @@ extension SectionTypeExtensions on SectionType {
return Icons.add;
case SectionType.fileTypesAndExtension:
return null;
- case SectionType.fileCaption:
- return null;
}
}
@@ -267,9 +254,6 @@ extension SectionTypeExtensions on SectionType {
case SectionType.fileTypesAndExtension:
return SearchService.instance
.getAllFileTypesAndExtensionsResults(context, limit);
-
- case SectionType.fileCaption:
- return SearchService.instance.getAllDescriptionSearchResults(limit);
}
}
diff --git a/mobile/lib/services/search_service.dart b/mobile/lib/services/search_service.dart
index 79351f6637..e15bb33109 100644
--- a/mobile/lib/services/search_service.dart
+++ b/mobile/lib/services/search_service.dart
@@ -12,7 +12,6 @@ import 'package:photos/data/years.dart';
import 'package:photos/db/files_db.dart';
import "package:photos/db/ml/db.dart";
import 'package:photos/events/local_photos_updated_event.dart';
-import "package:photos/extensions/string_ext.dart";
import "package:photos/models/api/collection/user.dart";
import 'package:photos/models/collection/collection.dart';
import 'package:photos/models/collection/collection_items.dart';
@@ -536,165 +535,6 @@ class SearchService {
}
}
- ///Todo: Optimise + make this function more readable
- //This can be furthur optimized by not just limiting keys to 0 and 1. Use key
- //0 for single word, 1 for 2 word, 2 for 3 ..... and only check the substrings
- //in higher key if there are matches in the lower key.
- Future<List<GenericSearchResult>> getAllDescriptionSearchResults(
- //todo: use limit
- int? limit,
- ) async {
- try {
- final List<GenericSearchResult> searchResults = [];
- final List<EnteFile> allFiles = await getAllFilesForSearch();
-
- //each list element will be substrings from a description mapped by
- //word count = 1 and word count > 1
- //New items will be added to [orderedSubDescriptions] list for every
- //distinct description.
- //[orderedSubDescriptions[x]] has two keys, 0 & 1. Value of key 0 will be single
- //word substrings. Value of key 1 will be multi word subStrings. When
- //iterating through [allFiles], we check for matching substrings from
- //[orderedSubDescriptions[x]] with the file's description. Starts from value
- //of key 0 (x=0). If there are no substring matches from key 0, there will
- //be none from key 1 as well. So these two keys are for avoiding unnecessary
- //checking of all subDescriptions with file description.
- final orderedSubDescs = <Map<int, List<String>>>[];
- final descAndMatchingFiles = <String, Set<EnteFile>>{};
- int distinctFullDescCount = 0;
- final allDistinctFullDescs = <String>[];
-
- for (EnteFile file in allFiles) {
- if (file.caption != null && file.caption!.isNotEmpty) {
- //This limit doesn't necessarily have to be the limit parameter of the
- //method. Using the same variable to avoid unwanted iterations when
- //iterating over [orderedSubDescriptions] in case there is a limit
- //passed. Using the limit passed here so that there will be almost
- //always be more than 7 descriptionAndMatchingFiles and can shuffle
- //and choose only limited elements from it. Without shuffling,
- //result will be ["hello", "world", "hello world"] for the string
- //"hello world"
-
- if (limit == null || distinctFullDescCount < limit) {
- final descAlreadyRecorded = allDistinctFullDescs
- .any((element) => element.contains(file.caption!.trim()));
-
- if (!descAlreadyRecorded) {
- distinctFullDescCount++;
- allDistinctFullDescs.add(file.caption!.trim());
- final words = file.caption!.trim().split(" ");
- orderedSubDescs.add({0: <String>[], 1: <String>[]});
-
- for (int i = 1; i <= words.length; i++) {
- for (int j = 0; j <= words.length - i; j++) {
- final subList = words.sublist(j, j + i);
- final substring = subList.join(" ").toLowerCase();
- if (i == 1) {
- orderedSubDescs.last[0]!.add(substring);
- } else {
- orderedSubDescs.last[1]!.add(substring);
- }
- }
- }
- }
- }
-
- for (Map<int, List<String>> orderedSubDescription
- in orderedSubDescs) {
- bool matchesSingleWordSubString = false;
- for (String subDescription in orderedSubDescription[0]!) {
- if (file.caption!.toLowerCase().contains(subDescription)) {
- matchesSingleWordSubString = true;
-
- //continue only after setting [matchesSingleWordSubString] to true
- if (subDescription.isAllConnectWords ||
- subDescription.isLastWordConnectWord) continue;
-
- if (descAndMatchingFiles.containsKey(subDescription)) {
- descAndMatchingFiles[subDescription]!.add(file);
- } else {
- descAndMatchingFiles[subDescription] = {file};
- }
- }
- }
- if (matchesSingleWordSubString) {
- for (String subDescription in orderedSubDescription[1]!) {
- if (subDescription.isAllConnectWords ||
- subDescription.isLastWordConnectWord) continue;
-
- if (file.caption!.toLowerCase().contains(subDescription)) {
- if (descAndMatchingFiles.containsKey(subDescription)) {
- descAndMatchingFiles[subDescription]!.add(file);
- } else {
- descAndMatchingFiles[subDescription] = {file};
- }
- }
- }
- }
- }
- }
- }
-
- ///[relevantDescAndFiles] will be a filterd version of [descriptionAndMatchingFiles]
- ///In [descriptionAndMatchingFiles], there will be descriptions with the same
- ///set of matching files. These descriptions will be substrings of a full
- ///description. [relevantDescAndFiles] will keep only the entry which has the
- ///longest description among enties with matching set of files.
- final relevantDescAndFiles = <String, Set<EnteFile>>{};
- while (descAndMatchingFiles.isNotEmpty) {
- final baseEntry = descAndMatchingFiles.entries.first;
- final descsWithSameFiles = <String, Set<EnteFile>>{};
- final baseUploadedFileIDs =
- baseEntry.value.map((e) => e.uploadedFileID).toSet();
-
- descAndMatchingFiles.forEach((desc, files) {
- final uploadedFileIDs = files.map((e) => e.uploadedFileID).toSet();
-
- final hasSameFiles =
- uploadedFileIDs.containsAll(baseUploadedFileIDs) &&
- baseUploadedFileIDs.containsAll(uploadedFileIDs);
- if (hasSameFiles) {
- descsWithSameFiles.addAll({desc: files});
- }
- });
- descAndMatchingFiles
- .removeWhere((desc, files) => descsWithSameFiles.containsKey(desc));
- final longestDescription = descsWithSameFiles.keys.reduce(
- (desc1, desc2) => desc1.length > desc2.length ? desc1 : desc2,
- );
- relevantDescAndFiles.addAll(
- {longestDescription: descsWithSameFiles[longestDescription]!},
- );
- }
-
- relevantDescAndFiles.forEach((key, value) {
- final listOfFiles = value.toList();
- searchResults.add(
- GenericSearchResult(
- ResultType.fileCaption,
- key,
- listOfFiles,
- hierarchicalSearchFilter: TopLevelGenericFilter(
- filterName: key,
- occurrence: kMostRelevantFilter,
- filterResultType: ResultType.fileCaption,
- matchedUploadedIDs: filesToUploadedFileIDs(listOfFiles),
- filterIcon: Icons.description_outlined,
- ),
- ),
- );
- });
- if (limit != null) {
- return searchResults.sublist(0, min(limit, searchResults.length));
- } else {
- return searchResults;
- }
- } catch (e) {
- _logger.severe("Error in getAllDescriptionSearchResults", e);
- return [];
- }
- }
-
Future<List<GenericSearchResult>> getCaptionAndNameResults(
String query,
) async {
diff --git a/mobile/lib/ui/viewer/search_tab/descriptions_section.dart b/mobile/lib/ui/viewer/search_tab/descriptions_section.dart
deleted file mode 100644
index 61f8a5df39..0000000000
--- a/mobile/lib/ui/viewer/search_tab/descriptions_section.dart
+++ /dev/null
@@ -1,239 +0,0 @@
-import "dart:async";
-
-import "package:figma_squircle/figma_squircle.dart";
-import "package:flutter/material.dart";
-import "package:photos/core/constants.dart";
-import "package:photos/events/event.dart";
-import "package:photos/models/search/generic_search_result.dart";
-import "package:photos/models/search/recent_searches.dart";
-import "package:photos/models/search/search_types.dart";
-import "package:photos/theme/ente_theme.dart";
-import "package:photos/ui/viewer/file/no_thumbnail_widget.dart";
-import "package:photos/ui/viewer/file/thumbnail_widget.dart";
-import "package:photos/ui/viewer/search/result/search_result_page.dart";
-import "package:photos/ui/viewer/search/search_section_cta.dart";
-import "package:photos/ui/viewer/search_tab/section_header.dart";
-import "package:photos/utils/navigation_util.dart";
-
-class DescriptionsSection extends StatefulWidget {
- final List<GenericSearchResult> descriptionsSearchResults;
- const DescriptionsSection(this.descriptionsSearchResults, {super.key});
-
- @override
- State<DescriptionsSection> createState() => _DescriptionsSectionState();
-}
-
-class _DescriptionsSectionState extends State<DescriptionsSection> {
- late List<GenericSearchResult> _descriptionsSearchResults;
- final streamSubscriptions = <StreamSubscription>[];
-
- @override
- void initState() {
- super.initState();
- _descriptionsSearchResults = widget.descriptionsSearchResults;
-
- final streamsToListenTo = SectionType.fileCaption.sectionUpdateEvents();
- for (Stream<Event> stream in streamsToListenTo) {
- streamSubscriptions.add(
- stream.listen((event) async {
- _descriptionsSearchResults = (await SectionType.fileCaption.getData(
- context,
- limit: kSearchSectionLimit,
- )) as List<GenericSearchResult>;
- setState(() {});
- }),
- );
- }
- }
-
- @override
- void dispose() {
- for (var subscriptions in streamSubscriptions) {
- subscriptions.cancel();
- }
- super.dispose();
- }
-
- @override
- void didUpdateWidget(covariant DescriptionsSection oldWidget) {
- super.didUpdateWidget(oldWidget);
- _descriptionsSearchResults = widget.descriptionsSearchResults;
- }
-
- @override
- Widget build(BuildContext context) {
- if (_descriptionsSearchResults.isEmpty) {
- final textTheme = getEnteTextTheme(context);
- return Padding(
- padding: const EdgeInsets.only(left: 12, right: 8),
- child: Row(
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- SectionType.fileCaption.sectionTitle(context),
- style: textTheme.largeBold,
- ),
- const SizedBox(height: 24),
- Padding(
- padding: const EdgeInsets.only(left: 4),
- child: Text(
- SectionType.fileCaption.getEmptyStateText(context),
- style: textTheme.smallMuted,
- ),
- ),
- ],
- ),
- ),
- const SizedBox(width: 8),
- const SearchSectionEmptyCTAIcon(SectionType.fileCaption),
- ],
- ),
- );
- } else {
- return Padding(
- padding: const EdgeInsets.symmetric(vertical: 8),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SectionHeader(
- SectionType.fileCaption,
- hasMore: (_descriptionsSearchResults.length >=
- kSearchSectionLimit - 1),
- ),
- const SizedBox(height: 2),
- SizedBox(
- child: SingleChildScrollView(
- clipBehavior: Clip.none,
- padding: const EdgeInsets.symmetric(horizontal: 4.5),
- physics: const BouncingScrollPhysics(),
- scrollDirection: Axis.horizontal,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: _descriptionsSearchResults
- .map(
- (descriptionSearchResult) =>
- DescriptionRecommendation(descriptionSearchResult),
- )
- .toList(),
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
-}
-
-class DescriptionRecommendation extends StatelessWidget {
- final GenericSearchResult descriptionSearchResult;
- const DescriptionRecommendation(this.descriptionSearchResult, {super.key});
-
- @override
- Widget build(BuildContext context) {
- final heroTag = descriptionSearchResult.heroTag() +
- (descriptionSearchResult.previewThumbnail()?.tag ?? "");
- final enteTextTheme = getEnteTextTheme(context);
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 2.5),
- child: GestureDetector(
- onTap: () {
- RecentSearches().add(descriptionSearchResult.name());
- if (descriptionSearchResult.onResultTap != null) {
- descriptionSearchResult.onResultTap!(context);
- } else {
- routeToPage(
- context,
- SearchResultPage(descriptionSearchResult),
- );
- }
- },
- child: SizedBox(
- width: 100,
- height: 150,
- child: Stack(
- clipBehavior: Clip.none,
- alignment: Alignment.center,
- children: [
- Container(
- decoration: const BoxDecoration(
- boxShadow: [
- BoxShadow(
- blurRadius: 15,
- offset: Offset(0, 7.5),
- color: Color.fromRGBO(68, 68, 68, 0.1),
- ),
- ],
- ),
- child: ClipSmoothRect(
- radius: SmoothBorderRadius(
- cornerRadius: 7.5,
- cornerSmoothing: 1,
- ),
- child: Container(
- color: Theme.of(context).colorScheme.brightness ==
- Brightness.light
- ? const Color(0xFFFFFFFF)
- : const Color(0xFF181818),
- child: Column(
- children: [
- Padding(
- padding: const EdgeInsets.fromLTRB(9, 9, 9, 0),
- child: SizedBox(
- width: 82,
- height: 82,
- child: descriptionSearchResult.previewThumbnail() !=
- null
- ? Hero(
- tag: heroTag,
- child: ClipSmoothRect(
- radius: SmoothBorderRadius(
- cornerRadius: 7.5,
- cornerSmoothing: 1,
- ),
- child: ThumbnailWidget(
- descriptionSearchResult
- .previewThumbnail()!,
- shouldShowArchiveStatus: false,
- shouldShowSyncStatus: false,
- ),
- ),
- )
- : const NoThumbnailWidget(),
- ),
- ),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.symmetric(
- horizontal: 5,
- vertical: 10,
- ),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text(
- descriptionSearchResult.name(),
- style: enteTextTheme.smallMuted,
- maxLines: 2,
- overflow: TextOverflow.ellipsis,
- textAlign: TextAlign.center,
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
-}
diff --git a/mobile/lib/ui/viewer/search_tab/search_tab.dart b/mobile/lib/ui/viewer/search_tab/search_tab.dart
index d4595e2306..bf78bb930c 100644
--- a/mobile/lib/ui/viewer/search_tab/search_tab.dart
+++ b/mobile/lib/ui/viewer/search_tab/search_tab.dart
@@ -18,7 +18,6 @@ import "package:photos/ui/viewer/search/search_suggestions.dart";
import "package:photos/ui/viewer/search/tab_empty_state.dart";
import 'package:photos/ui/viewer/search_tab/albums_section.dart';
import "package:photos/ui/viewer/search_tab/contacts_section.dart";
-import "package:photos/ui/viewer/search_tab/descriptions_section.dart";
import "package:photos/ui/viewer/search_tab/file_type_section.dart";
import "package:photos/ui/viewer/search_tab/locations_section.dart";
import "package:photos/ui/viewer/search_tab/magic_section.dart";
@@ -140,11 +139,6 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
snapshot.data!.elementAt(index)
as List<GenericSearchResult>,
);
- case SectionType.fileCaption:
- return DescriptionsSection(
- snapshot.data!.elementAt(index)
- as List<GenericSearchResult>,
- );
case SectionType.location:
return LocationsSection(
snapshot.data!.elementAt(index)