Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: search workspace sync indexing #5437

Merged
merged 8 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/appflowy_flutter/lib/shared/feature_flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ enum FeatureFlag {
switch (this) {
case FeatureFlag.collaborativeWorkspace:
case FeatureFlag.membersSettings:
case FeatureFlag.search:
case FeatureFlag.unknown:
return false;
case FeatureFlag.search:
case FeatureFlag.syncDocument:
case FeatureFlag.syncDatabase:
return true;
Expand Down
12 changes: 9 additions & 3 deletions frontend/appflowy_flutter/lib/startup/tasks/app_widget.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import 'package:appflowy/mobile/application/mobile_router.dart';
import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart';
import 'package:appflowy/shared/feature_flags.dart';
Expand All @@ -13,6 +16,7 @@ import 'package:appflowy/workspace/application/notification/notification_service
import 'package:appflowy/workspace/application/settings/appearance/appearance_cubit.dart';
import 'package:appflowy/workspace/application/settings/notifications/notification_settings_cubit.dart';
import 'package:appflowy/workspace/application/sidebar/rename_view/rename_view_bloc.dart';
import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
import 'package:appflowy/workspace/application/view/view_ext.dart';
import 'package:appflowy/workspace/presentation/command_palette/command_palette.dart';
import 'package:appflowy_backend/log.dart';
Expand All @@ -21,8 +25,6 @@ import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';

Expand Down Expand Up @@ -175,8 +177,12 @@ class _ApplicationWidgetState extends State<ApplicationWidget> {
if (action?.type == ActionType.openView &&
PlatformExtension.isDesktop) {
final view = action!.arguments?[ActionArgumentKeys.view];
final nodePath = action.arguments?[ActionArgumentKeys.nodePath];
if (view != null) {
AppGlobals.rootNavKey.currentContext?.pushView(view);
getIt<TabsBloc>().openPlugin(
view.plugin(),
arguments: {PluginArgumentKeys.selection: nodePath},
);
}
} else if (action?.type == ActionType.openRow &&
PlatformExtension.isMobile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class ActionNavigationBloc
currentAction = currentAction.copyWith(arguments: {});
}

action.arguments?.addAll({ActionArgumentKeys.view: view});
currentAction.arguments?.addAll({ActionArgumentKeys.view: view});
}
}

emit(state.copyWith(action: action, nextActions: nextActions));
emit(state.copyWith(action: currentAction, nextActions: nextActions));

if (nextActions.isNotEmpty) {
final newActions = [...nextActions];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,15 @@ class CommandPaletteBloc
Future<void> _initTrash() async {
_trashListener.start(
trashUpdated: (trashOrFailed) {
final trash = trashOrFailed.fold(
(trash) => trash,
(error) => null,
);

final trash = trashOrFailed.toNullable();
add(CommandPaletteEvent.trashChanged(trash: trash));
},
);

final trashOrFailure = await _trashService.readTrash();
final trashRes = trashOrFailure.fold(
(trash) => trash,
(error) => null,
);
final trash = trashOrFailure.toNullable();

add(CommandPaletteEvent.trashChanged(trash: trashRes?.items));
add(CommandPaletteEvent.trashChanged(trash: trash?.items));
}

void _debounceOnSearchChanged(String value) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart';

import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/shared/feature_flags.dart';
Expand Down Expand Up @@ -30,7 +32,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

/// Home Sidebar is the left side bar of the home page.
Expand Down Expand Up @@ -95,7 +96,7 @@ class HomeSideBar extends StatelessWidget {
}
return MultiBlocProvider(
providers: [
BlocProvider(create: (_) => getIt<ActionNavigationBloc>()),
BlocProvider.value(value: getIt<ActionNavigationBloc>()),
BlocProvider(
create: (_) => SidebarSectionsBloc()
..add(
Expand Down
2 changes: 2 additions & 0 deletions frontend/appflowy_tauri/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading