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: hide the improve writing button (#7443)

Lucasaff720c1f174
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart
index 7d9d2eb790..20bba4f083 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart
@@ -1,5 +1,6 @@
import 'dart:ui' as ui;
+import 'package:appflowy/core/helpers/url_launcher.dart';
import 'package:appflowy/plugins/document/application/document_bloc.dart';
import 'package:appflowy/plugins/document/presentation/editor_configuration.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/background_color/theme_background_color.dart';
@@ -159,6 +160,15 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage>
CalloutBlockKeys.type,
]);
+ editorLaunchUrl = (url) {
+ if (url != null) {
+ afLaunchUrlString(url);
+ }
+
+ return Future.value(true);
+ };
+
+
effectiveScrollController = widget.scrollController ?? ScrollController();
// disable the color parse in the HTML decoder.
DocumentHTMLDecoder.enableColorParse = false;
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart
index 99b13add54..bf9b1bdc7a 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart
@@ -81,17 +81,23 @@ Future<void> dragToMoveNode(
final transaction = editorState.transaction;
final targetNodeParent = targetNode.parentColumnsBlock;
if (targetNodeParent != null) {
+ // find the previous sibling node of the target node
+ final width = (node.rect.width /
+ (targetNode.parentColumnsBlock?.children.length ?? 2)) -
+ 16;
final columnNode = simpleColumnNode(
children: [node.deepCopy()],
+ width: width,
);
transaction.insertNode(targetNode.path.previous, columnNode);
transaction.deleteNode(node);
} else {
+ final width = targetNode.rect.width / 2 - 16;
final columnsNode = simpleColumnsNode(
children: [
- simpleColumnNode(children: [node.deepCopy()]),
- simpleColumnNode(children: [targetNode.deepCopy()]),
+ simpleColumnNode(children: [node.deepCopy()], width: width),
+ simpleColumnNode(children: [targetNode.deepCopy()], width: width),
],
);
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
index 103cfface4..a0966465a1 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/simple_columns_item.dart
@@ -95,7 +95,7 @@ Node _buildColumnsNode(EditorState editorState, int columnCount) {
if (selection != null) {
final parentNode = editorState.getNodeAtPath(selection.start.path);
if (parentNode != null) {
- width = parentNode.rect.width / columnCount;
+ width = parentNode.rect.width / columnCount - 16;
}
}
return simpleColumnsNode(columnCount: columnCount, width: width);
diff --git a/frontend/appflowy_flutter/pubspec.lock b/frontend/appflowy_flutter/pubspec.lock
index 3174f2f1c5..fad0defff3 100644
--- a/frontend/appflowy_flutter/pubspec.lock
+++ b/frontend/appflowy_flutter/pubspec.lock
@@ -90,11 +90,11 @@ packages:
dependency: "direct main"
description:
path: "."
- ref: "400083f"
- resolved-ref: "400083fde6a1a77229416a55c50279f5f5b3f55b"
+ ref: b2672f2
+ resolved-ref: b2672f297b0e9e7a028ea217ae6a57c8dca3da4e
url: "https://github.com/AppFlowy-IO/appflowy-editor.git"
source: git
- version: "5.0.0"
+ version: "5.1.0"
appflowy_editor_plugins:
dependency: "direct main"
description:
diff --git a/frontend/appflowy_flutter/pubspec.yaml b/frontend/appflowy_flutter/pubspec.yaml
index 111eac6e31..a93b261419 100644
--- a/frontend/appflowy_flutter/pubspec.yaml
+++ b/frontend/appflowy_flutter/pubspec.yaml
@@ -179,7 +179,7 @@ dependency_overrides:
appflowy_editor:
git:
url: https://github.com/AppFlowy-IO/appflowy-editor.git
- ref: "400083f"
+ ref: "b2672f2"
appflowy_editor_plugins:
git: