Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: LR issues of desktop search (#7914)
Morn50297766850a
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dart b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dartindex 1d627ef173..5665dc251f 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/command_palette.dart@@ -10,6 +10,7 @@ import 'package:appflowy/workspace/presentation/command_palette/widgets/recent_vimport 'package:appflowy/workspace/presentation/command_palette/widgets/search_field.dart';import 'package:appflowy/workspace/presentation/command_palette/widgets/search_results_list.dart';import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';+import 'package:appflowy_backend/log.dart';import 'package:appflowy_backend/protobuf/flowy-folder/view.pbenum.dart';import 'package:appflowy_backend/protobuf/flowy-user/workspace.pbenum.dart';import 'package:appflowy_ui/appflowy_ui.dart';@@ -109,6 +110,9 @@ class _CommandPaletteControllerState extends State<_CommandPaletteController> {_isOpen = true;final workspaceBloc = _toggleNotifier.value.userWorkspaceBloc;final spaceBloc = _toggleNotifier.value.spaceBloc;+ Log.info(+ 'CommandPalette onToggle: workspaceType ${workspaceBloc?.state.userProfile.workspaceType}',+ );FlowyOverlay.show(context: context,builder: (_) => MultiBlocProvider(diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/page_preview.dart b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/page_preview.dartindex e85482385b..4d4bd9cef4 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/page_preview.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/page_preview.dart@@ -158,3 +158,40 @@ class PagePreview extends StatelessWidget {];}}++class SomethingWentWrong extends StatelessWidget {+ const SomethingWentWrong({super.key});++ @override+ Widget build(BuildContext context) {+ final theme = AppFlowyTheme.of(context);+ return Center(+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ FlowySvg(+ FlowySvgs.something_wrong_warning_m,+ color: theme.iconColorScheme.secondary,+ size: Size.square(24),+ ),+ const VSpace(8),+ Text(+ LocaleKeys.search_somethingWentWrong.tr(),+ style: theme.textStyle.body+ .enhanced(color: theme.textColorScheme.secondary),+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ const VSpace(4),+ Text(+ LocaleKeys.search_tryAgainOrLater.tr(),+ style: theme.textStyle.caption+ .standard(color: theme.textColorScheme.secondary),+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ ),+ ],+ ),+ );+ }+}diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dart b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dartindex ba5184a6b1..13bd51b580 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/recent_views_list.dart@@ -47,74 +47,78 @@ class RecentViewsList extends StatelessWidget {children: [Flexible(flex: 2,- child: ScrollControllerBuilder(- builder: (context, controller) {- return FlowyScrollbar(- controller: controller,- child: SingleChildScrollView(+ child: Align(+ alignment: Alignment.topLeft,+ child: ScrollControllerBuilder(+ builder: (context, controller) {+ return FlowyScrollbar(controller: controller,- physics: const ClampingScrollPhysics(),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- if (showAskingAI) SearchAskAiEntrance(),- Container(- height: 20,- padding: const EdgeInsets.symmetric(- horizontal: 8,- ),- margin: const EdgeInsets.symmetric(- horizontal: 12,- vertical: 8,- ),- child: Text(- LocaleKeys.sideBar_recent.tr(),- style: theme.textStyle.body.enhanced(- color: theme.textColorScheme.secondary,+ child: SingleChildScrollView(+ controller: controller,+ physics: const ClampingScrollPhysics(),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ if (showAskingAI) SearchAskAiEntrance(),+ Container(+ height: 20,+ padding: const EdgeInsets.symmetric(+ horizontal: 8,+ ),+ margin: const EdgeInsets.symmetric(+ horizontal: 12,+ vertical: 8,+ ),+ child: Text(+ LocaleKeys.sideBar_recent.tr(),+ style: theme.textStyle.body.enhanced(+ color:+ theme.textColorScheme.secondary,+ ),),),- ),- ListView.separated(- shrinkWrap: true,- physics:- const NeverScrollableScrollPhysics(),- itemCount: recentViews.length,- padding:- EdgeInsets.symmetric(horizontal: 12),- itemBuilder: (_, index) {- final view = recentViews[index];+ ListView.separated(+ shrinkWrap: true,+ physics:+ const NeverScrollableScrollPhysics(),+ itemCount: recentViews.length,+ padding:+ EdgeInsets.symmetric(horizontal: 12),+ itemBuilder: (_, index) {+ final view = recentViews[index];- final icon = view.icon.value.isNotEmpty- ? RawEmojiIconWidget(- emoji:- view.icon.toEmojiIconData(),- emojiSize: 16.0,- lineHeight: 20 / 16,- )- : FlowySvg(- view.iconData,- size: const Size.square(20),- color: theme- .iconColorScheme.secondary,- );+ final icon = view.icon.value.isNotEmpty+ ? RawEmojiIconWidget(+ emoji:+ view.icon.toEmojiIconData(),+ emojiSize: 16.0,+ lineHeight: 20 / 16,+ )+ : FlowySvg(+ view.iconData,+ size: const Size.square(20),+ color: theme+ .iconColorScheme.secondary,+ );- return SearchRecentViewCell(- icon: SizedBox.square(- dimension: 24,- child: Center(child: icon),- ),- view: view,- onSelected: onSelected,- );- },- separatorBuilder: (_, __) => AFDivider(),- ),- VSpace(8),- ],+ return SearchRecentViewCell(+ icon: SizedBox.square(+ dimension: 24,+ child: Center(child: icon),+ ),+ view: view,+ onSelected: onSelected,+ );+ },+ separatorBuilder: (_, __) => AFDivider(),+ ),+ VSpace(8),+ ],+ ),),- ),- );- },+ );+ },+ ),),),if (hoveredView != null) ...[diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dart b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dartindex 56c9b2269a..dad23581ff 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/command_palette/widgets/search_result_cell.dart@@ -6,7 +6,6 @@ import 'package:appflowy/workspace/application/command_palette/command_palette_bimport 'package:appflowy/workspace/application/command_palette/search_result_ext.dart';import 'package:appflowy/workspace/application/command_palette/search_result_list_bloc.dart';import 'package:appflowy/workspace/application/view/prelude.dart';-import 'package:appflowy/workspace/presentation/command_palette/command_palette.dart';import 'package:appflowy_backend/protobuf/flowy-search/result.pbenum.dart';import 'package:appflowy_ui/appflowy_ui.dart';import 'package:easy_localization/easy_localization.dart';@@ -225,7 +224,7 @@ class SearchResultPreview extends StatelessWidget {return const Center(child: CircularProgressIndicator());}final view = snapshot.data?.toNullable();- if (view == null) return NoSearchResultsHint();+ if (view == null) return SomethingWentWrong();return PagePreview(view: view);},diff --git a/frontend/resources/flowy_icons/24x/something_wrong_warning.svg b/frontend/resources/flowy_icons/24x/something_wrong_warning.svgnew file mode 100644index 0000000000..a9eac1fc7d--- /dev/null+++ b/frontend/resources/flowy_icons/24x/something_wrong_warning.svg@@ -0,0 +1,5 @@+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M12 7V13" stroke="#6F748C" stroke-width="1.5" stroke-linecap="round"/>+<path d="M11 16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16C13 15.7348 12.8946 15.4804 12.7071 15.2929C12.5196 15.1054 12.2652 15 12 15C11.7348 15 11.4804 15.1054 11.2929 15.2929C11.1054 15.4804 11 15.7348 11 16Z" fill="#6F748C"/>+<path d="M2 12C2 7.28595 2 4.92893 3.46447 3.46447C4.92893 2 7.28595 2 12 2C16.714 2 19.0711 2 20.5355 3.46447C22 4.92893 22 7.28595 22 12C22 16.714 22 19.0711 20.5355 20.5355C19.0711 22 16.714 22 12 22C7.28595 22 4.92893 22 3.46447 20.5355C2 19.0711 2 16.714 2 12Z" stroke="#6F748C" stroke-width="1.5"/>+</svg>diff --git a/frontend/resources/translations/en-US.json b/frontend/resources/translations/en-US.jsonindex d98c0682e1..6b512ddfe0 100644--- a/frontend/resources/translations/en-US.json+++ b/frontend/resources/translations/en-US.json@@ -2364,6 +2364,8 @@"noResultForSearchingHintWithoutTrash": "Try different questions or keywords\n Some pages may be in the ","bestMatch": "Best match","seeMore": "See more",+ "somethingWentWrong": "Something went wrong",+ "tryAgainOrLater": "Please try again later","placeholder": {"actions": "Search actions..."}@@ -3403,4 +3405,4 @@"rewrite": "Rewrite","insertBelow": "Insert below"}-}+}\ No newline at end of file