feat: sort smart search

Smart search currently returns a list of assets by their score. It would
be nice if we could instead filter assets, and then list them by date.
This is the default behaviour of other platforms.
This commit is contained in:
Thomas Way
2026-02-24 10:28:56 +00:00
parent 1d25267f22
commit d416e225e6
17 changed files with 705 additions and 21 deletions
@@ -8,6 +8,8 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'paginated_search.provider.g.dart';
final searchGroupByProvider = StateProvider<GroupAssetsBy>((ref) => GroupAssetsBy.none);
final paginatedSearchProvider = StateNotifierProvider<PaginatedSearchNotifier, SearchResult>(
(ref) => PaginatedSearchNotifier(ref.watch(searchServiceProvider)),
);
@@ -41,6 +43,7 @@ class PaginatedSearchNotifier extends StateNotifier<SearchResult> {
@riverpod
Future<RenderList> paginatedSearchRenderList(Ref ref) {
final result = ref.watch(paginatedSearchProvider);
final groupBy = ref.watch(searchGroupByProvider);
final timelineService = ref.watch(timelineServiceProvider);
return timelineService.getTimelineFromAssets(result.assets, GroupAssetsBy.none);
return timelineService.getTimelineFromAssets(result.assets, groupBy);
}
@@ -7,7 +7,7 @@ part of 'paginated_search.provider.dart';
// **************************************************************************
String _$paginatedSearchRenderListHash() =>
r'22d715ff7864e5a946be38322ce7813616f899c2';
r'bb1ea9153b2a186778420426f1fb1add6d6a9140';
/// See also [paginatedSearchRenderList].
@ProviderFor(paginatedSearchRenderList)