Skip to content

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.

fix: 0.8.5 launch review issues (#7430)

Lucasadcac881a7cc
diff --git a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
index bc25bf970d..83fc24c204 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/document_page.dart
@@ -1,3 +1,4 @@
+import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/mobile/application/page_style/document_page_style_bloc.dart';
import 'package:appflowy/plugins/document/application/document_appearance_cubit.dart';
import 'package:appflowy/plugins/document/application/document_bloc.dart';
@@ -20,6 +21,7 @@ import 'package:appflowy/workspace/application/view/view_lock_status_bloc.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
+import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:provider/provider.dart';
@@ -188,6 +190,9 @@ class _DocumentPageState extends State<DocumentPage>
),
header: buildCoverAndIcon(context, state),
initialSelection: initialSelection,
+ placeholderText: (node) => node.type == ParagraphBlockKeys.type
+ ? LocaleKeys.editor_slashPlaceHolder.tr()
+ : '',
),
);
}
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
index 48e48e812d..5e5376d42b 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
@@ -210,26 +210,30 @@ void _customBlockOptionActions(
return ValueListenableBuilder(
valueListenable: editorState.editableNotifier,
builder: (_, editable, child) {
- return Opacity(
- opacity: editable ? 1.0 : 0.0,
- child: Padding(
- padding: EdgeInsets.only(top: top),
- child: BlockActionList(
- blockComponentContext: context,
- blockComponentState: state,
- editorState: editorState,
- blockComponentBuilder: builders,
- actions: actions,
- showSlashMenu: slashMenuItemsBuilder != null
- ? () => customAppFlowySlashCommand(
- itemsBuilder: slashMenuItemsBuilder,
- shouldInsertSlash: false,
- deleteKeywordsByDefault: true,
- style: styleCustomizer.selectionMenuStyleBuilder(),
- supportSlashMenuNodeTypes:
- supportSlashMenuNodeTypes,
- ).handler.call(editorState)
- : () {},
+ return IgnorePointer(
+ ignoring: !editable,
+ child: Opacity(
+ opacity: editable ? 1.0 : 0.0,
+ child: Padding(
+ padding: EdgeInsets.only(top: top),
+ child: BlockActionList(
+ blockComponentContext: context,
+ blockComponentState: state,
+ editorState: editorState,
+ blockComponentBuilder: builders,
+ actions: actions,
+ showSlashMenu: slashMenuItemsBuilder != null
+ ? () => customAppFlowySlashCommand(
+ itemsBuilder: slashMenuItemsBuilder,
+ shouldInsertSlash: false,
+ deleteKeywordsByDefault: true,
+ style:
+ styleCustomizer.selectionMenuStyleBuilder(),
+ supportSlashMenuNodeTypes:
+ supportSlashMenuNodeTypes,
+ ).handler.call(editorState)
+ : () {},
+ ),
),
),
);
@@ -349,6 +353,11 @@ Map<String, BlockComponentBuilder> _buildBlockComponentBuilderMap(
context,
configuration,
),
+ // Flutter doesn't support the video widget, so we forward the video block to the link preview block
+ VideoBlockKeys.type: _buildLinkPreviewBlockComponentBuilder(
+ context,
+ configuration,
+ ),
FileBlockKeys.type: _buildFileBlockComponentBuilder(
context,
configuration,
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_title.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_title.dart
index 23e117bbf4..097276a394 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_title.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/cover_title.dart
@@ -243,6 +243,8 @@ class _InnerCoverTitleState extends State<_InnerCoverTitle> {
return _moveCursorToNextLine(event.logicalKey);
} else if (event.logicalKey == LogicalKeyboardKey.escape) {
return _exitEditing();
+ } else if (event.logicalKey == LogicalKeyboardKey.tab) {
+ return KeyEventResult.handled;
}
return KeyEventResult.ignored;
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart
index baf9a21b3a..c37a85260e 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart
@@ -76,3 +76,4 @@ export 'table/table_option_action.dart';
export 'todo_list/todo_list_icon.dart';
export 'toggle/toggle_block_component.dart';
export 'toggle/toggle_block_shortcuts.dart';
+export 'video/video_block_component.dart';
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/columns_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
similarity index 84%
rename from frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/columns_item.dart
rename to frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
index 2deabd3e9e..4ffac6965e 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/columns_item.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
@@ -47,6 +47,12 @@ SelectionMenuItem twoColumnsSlashMenuItem = SelectionMenuItem.node(
isSelected: isSelected,
style: style,
),
+ updateSelection: (_, path, __, ___) {
+ return Selection.single(
+ path: path.child(0).child(0),
+ startOffset: 0,
+ );
+ },
);
// 3 columns menu item
@@ -61,6 +67,12 @@ SelectionMenuItem threeColumnsSlashMenuItem = SelectionMenuItem.node(
isSelected: isSelected,
style: style,
),
+ updateSelection: (_, path, __, ___) {
+ return Selection.single(
+ path: path.child(0).child(0),
+ startOffset: 0,
+ );
+ },
);
// 4 columns menu item
@@ -75,6 +87,12 @@ SelectionMenuItem fourColumnsSlashMenuItem = SelectionMenuItem.node(
isSelected: isSelected,
style: style,
),
+ updateSelection: (_, path, __, ___) {
+ return Selection.single(
+ path: path.child(0).child(0),
+ startOffset: 0,
+ );
+ },
);
// 5 columns menu item
@@ -89,4 +107,10 @@ SelectionMenuItem fiveColumnsSlashMenuItem = SelectionMenuItem.node(
isSelected: isSelected,
style: style,
),
+ updateSelection: (_, path, __, ___) {
+ return Selection.single(
+ path: path.child(0).child(0),
+ startOffset: 0,
+ );
+ },
);
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart
index 223d8e742b..27be8e4f03 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart
@@ -2,7 +2,6 @@ export 'ai_writer_item.dart';
export 'bulleted_list_item.dart';
export 'callout_item.dart';
export 'code_block_item.dart';
-export 'columns_item.dart';
export 'database_items.dart';
export 'date_item.dart';
export 'divider_item.dart';
@@ -16,6 +15,7 @@ export 'outline_item.dart';
export 'paragraph_item.dart';
export 'photo_gallery_item.dart';
export 'quote_item.dart';
+export 'simple_columns_item.dart';
export 'simple_table_item.dart';
export 'slash_menu_item_builder.dart';
export 'sub_page_item.dart';
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/video/video_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/video/video_block_component.dart
new file mode 100644
index 0000000000..f41d4526ea
--- /dev/null
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/video/video_block_component.dart
@@ -0,0 +1,6 @@
+class VideoBlockKeys {
+ const VideoBlockKeys._();
+
+ static const String type = 'video';
+ static const String url = 'url';
+}
diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json
index d5be5f22f7..b64fe35436 100644
--- a/frontend/resources/translations/en.json
+++ b/frontend/resources/translations/en.json
@@ -1737,9 +1737,9 @@
"dateOrReminder": "Date or Reminder",
"photoGallery": "Photo Gallery",
"file": "File",
- "twoColumns": "Two Columns",
- "threeColumns": "Three Columns",
- "fourColumns": "Four Columns"
+ "twoColumns": "2 Columns",
+ "threeColumns": "3 Columns",
+ "fourColumns": "4 Columns"
},
"subPage": {
"name": "Document",