Skip to content

Commit 03ecc3d

Browse files
authored
Merge pull request #7727 from AppFlowy-IO/search_summary
chore: search summary
2 parents 1630e11 + 99fb6ab commit 03ecc3d

File tree

50 files changed

+1883
-1396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1883
-1396
lines changed

frontend/appflowy_flutter/integration_test/desktop/command_palette/folder_search_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
66
import 'package:appflowy/shared/icon_emoji_picker/icon_picker.dart';
77
import 'package:appflowy/workspace/presentation/command_palette/command_palette.dart';
88
import 'package:appflowy/workspace/presentation/command_palette/widgets/search_field.dart';
9-
import 'package:appflowy/workspace/presentation/command_palette/widgets/search_result_tile.dart';
9+
import 'package:appflowy/workspace/presentation/command_palette/widgets/search_result_cell.dart';
1010
import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.dart';
1111
import 'package:appflowy_editor/appflowy_editor.dart';
1212
import 'package:easy_localization/easy_localization.dart';
@@ -44,22 +44,22 @@ void main() {
4444
await tester.pumpAndSettle(const Duration(milliseconds: 200));
4545

4646
// Expect two search results "ViewOna" and "ViewOne" (Distance 1 to ViewOna)
47-
expect(find.byType(SearchResultTile), findsNWidgets(2));
47+
expect(find.byType(SearchResultCell), findsNWidgets(2));
4848

4949
// The score should be higher for "ViewOna" thus it should be shown first
5050
final secondDocumentWidget = tester
51-
.widget(find.byType(SearchResultTile).first) as SearchResultTile;
52-
expect(secondDocumentWidget.result.data, secondDocument);
51+
.widget(find.byType(SearchResultCell).first) as SearchResultCell;
52+
expect(secondDocumentWidget.item.displayName, secondDocument);
5353

5454
// Change search to "ViewOne"
5555
await tester.enterText(searchFieldFinder, firstDocument);
5656
await tester.pumpAndSettle(const Duration(seconds: 1));
5757

5858
// The score should be higher for "ViewOne" thus it should be shown first
5959
final firstDocumentWidget = tester.widget(
60-
find.byType(SearchResultTile).first,
61-
) as SearchResultTile;
62-
expect(firstDocumentWidget.result.data, firstDocument);
60+
find.byType(SearchResultCell).first,
61+
) as SearchResultCell;
62+
expect(firstDocumentWidget.item.displayName, firstDocument);
6363
});
6464

6565
testWidgets('Displaying icons in search results', (tester) async {
@@ -89,11 +89,11 @@ void main() {
8989
);
9090
await tester.enterText(searchFieldFinder, 'Page-$randomValue');
9191
await tester.pumpAndSettle(const Duration(milliseconds: 200));
92-
expect(find.byType(SearchResultTile), findsNWidgets(2));
92+
expect(find.byType(SearchResultCell), findsNWidgets(2));
9393

9494
/// check results
9595
final svgs = find.descendant(
96-
of: find.byType(SearchResultTile),
96+
of: find.byType(SearchResultCell),
9797
matching: find.byType(FlowySvg),
9898
);
9999
expect(svgs, findsNWidgets(2));

frontend/appflowy_flutter/integration_test/desktop/command_palette/recent_history_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:appflowy/workspace/presentation/command_palette/command_palette.dart';
2-
import 'package:appflowy/workspace/presentation/command_palette/widgets/recent_view_tile.dart';
2+
import 'package:appflowy/workspace/presentation/command_palette/widgets/search_recent_view_cell.dart';
33
import 'package:appflowy/workspace/presentation/command_palette/widgets/recent_views_list.dart';
44
import 'package:flutter_test/flutter_test.dart';
55
import 'package:integration_test/integration_test.dart';
@@ -27,11 +27,12 @@ void main() {
2727
expect(find.byType(RecentViewsList), findsOneWidget);
2828

2929
// Expect three recent history items
30-
expect(find.byType(RecentViewTile), findsNWidgets(3));
30+
expect(find.byType(SearchRecentViewCell), findsNWidgets(3));
3131

3232
// Expect the first item to be the last viewed document
3333
final firstDocumentWidget =
34-
tester.widget(find.byType(RecentViewTile).first) as RecentViewTile;
34+
tester.widget(find.byType(SearchRecentViewCell).first)
35+
as SearchRecentViewCell;
3536
expect(firstDocumentWidget.view.name, secondDocument);
3637
});
3738
});

0 commit comments

Comments
 (0)