Skip to content

Commit d9296c3

Browse files
committed
feat: add mention a person to add a new block on mobile
1 parent 731f625 commit d9296c3

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_menu_item_builder.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/me
99
import 'package:appflowy/plugins/document/presentation/editor_plugins/mention/mobile_page_selector_sheet.dart';
1010
import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_item/mobile_add_block_toolbar_item.dart';
1111
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
12+
import 'package:appflowy/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/mention_item.dart';
1213
import 'package:appflowy/startup/startup.dart';
1314
import 'package:appflowy/startup/tasks/app_widget.dart';
1415
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
@@ -329,6 +330,16 @@ class AddBlockMenuItemBuilder {
329330
}
330331
},
331332
),
333+
TypeOptionMenuItemValue(
334+
value: ParagraphBlockKeys.type,
335+
backgroundColor: colorMap[MentionBlockKeys.type]!,
336+
text: LocaleKeys.document_mentionMenu_person.tr(),
337+
icon: FlowySvgs.mention_invite_user_m,
338+
onTap: (_, __) async {
339+
AppGlobals.rootNavKey.currentContext?.pop(true);
340+
await editorState.insertAtCharacter();
341+
},
342+
),
332343
];
333344
}
334345

frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/mention_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ SelectionMenuItem mentionSlashMenuItem = SelectionMenuItem(
2424
),
2525
);
2626

27-
extension on EditorState {
27+
extension MentionMenuEditorStateExtension on EditorState {
2828
Future<void> insertAtCharacter() async {
2929
final selection = this.selection;
3030
if (selection == null || !selection.isCollapsed) {

frontend/resources/translations/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,6 +2209,7 @@
22092209
"mentionMenu": {
22102210
"mentionAPerson": "Mention a person",
22112211
"people": "People",
2212+
"person": "Person",
22122213
"sendNotification": "Send notification",
22132214
"pages": "Pages",
22142215
"moreResults": "{} more results...",

0 commit comments

Comments
 (0)