فهرست منبع

fix: #1975 Set a height limit for the AI prompt window where it displays the results

Lucas.Xu 2 سال پیش
والد
کامیت
0570615414

+ 2 - 2
frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/auto_completion_node_widget.dart

@@ -142,7 +142,7 @@ class _AutoCompletionInputState extends State<_AutoCompletionInput> {
           TextSpan(
             children: [
               TextSpan(
-                text: '${LocaleKeys.button_generate.tr()}  ',
+                text: LocaleKeys.button_generate.tr(),
                 style: Theme.of(context).textTheme.bodyMedium,
               ),
             ],
@@ -154,7 +154,7 @@ class _AutoCompletionInputState extends State<_AutoCompletionInput> {
           TextSpan(
             children: [
               TextSpan(
-                text: '${LocaleKeys.button_Cancel.tr()}  ',
+                text: LocaleKeys.button_Cancel.tr(),
                 style: Theme.of(context).textTheme.bodyMedium,
               ),
             ],

+ 2 - 2
frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_node_widget.dart

@@ -162,7 +162,7 @@ class _SmartEditInputState extends State<_SmartEditInput> {
           TextSpan(
             children: [
               TextSpan(
-                text: '${LocaleKeys.button_replace.tr()}  ',
+                text: LocaleKeys.button_replace.tr(),
                 style: Theme.of(context).textTheme.bodyMedium,
               ),
             ],
@@ -177,7 +177,7 @@ class _SmartEditInputState extends State<_SmartEditInput> {
           TextSpan(
             children: [
               TextSpan(
-                text: '${LocaleKeys.button_Cancel.tr()}  ',
+                text: LocaleKeys.button_Cancel.tr(),
                 style: Theme.of(context).textTheme.bodyMedium,
               ),
             ],

+ 2 - 1
frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/openai/widgets/smart_edit_toolbar_item.dart

@@ -16,7 +16,8 @@ ToolbarItem smartEditItem = ToolbarItem(
   validator: (editorState) {
     // All selected nodes must be text.
     final nodes = editorState.service.selectionService.currentSelectedNodes;
-    return nodes.whereType<TextNode>().length == nodes.length;
+    return nodes.whereType<TextNode>().length == nodes.length &&
+        nodes.length == 1;
   },
   itemBuilder: (context, editorState) {
     return _SmartEditWidget(