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: launch review 0.7.3 (#6718)

Mathias Mogensen39eee12f531c
diff --git a/frontend/appflowy_flutter/lib/plugins/database/widgets/media_file_type_ext.dart b/frontend/appflowy_flutter/lib/plugins/database/widgets/media_file_type_ext.dart
index 059fe9bfb7..9ac6bec394 100644
--- a/frontend/appflowy_flutter/lib/plugins/database/widgets/media_file_type_ext.dart
+++ b/frontend/appflowy_flutter/lib/plugins/database/widgets/media_file_type_ext.dart
@@ -7,12 +7,12 @@ extension FileTypeDisplay on MediaFileTypePB {
FlowySvgData get icon => switch (this) {
MediaFileTypePB.Image => FlowySvgs.image_s,
MediaFileTypePB.Link => FlowySvgs.ft_link_s,
- MediaFileTypePB.Document => FlowySvgs.document_s,
+ MediaFileTypePB.Document => FlowySvgs.icon_document_s,
MediaFileTypePB.Archive => FlowySvgs.ft_archive_s,
MediaFileTypePB.Video => FlowySvgs.ft_video_s,
MediaFileTypePB.Audio => FlowySvgs.ft_audio_s,
MediaFileTypePB.Text => FlowySvgs.ft_text_s,
- _ => FlowySvgs.document_s,
+ _ => FlowySvgs.icon_document_s,
};
Color get color => switch (this) {
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 752e04f6f9..8bf7c997e4 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart
@@ -93,9 +93,7 @@ List<OptionAction> _buildOptionActions(BuildContext context, String type) {
standardActions.add(OptionAction.copyLinkToBlock);
}
- if (EditorOptionActionType.turnInto.supportTypes.contains(type)) {
- standardActions.add(OptionAction.turnInto);
- }
+ standardActions.add(OptionAction.turnInto);
if (EditorOptionActionType.color.supportTypes.contains(type)) {
standardActions.addAll([OptionAction.divider, OptionAction.color]);
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart
index 3621707ac6..9de77326b3 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart
@@ -1,11 +1,10 @@
-import 'dart:math';
-
import 'package:appflowy/plugins/document/application/document_bloc.dart';
import 'package:appflowy/plugins/document/application/document_data_pb_extension.dart';
import 'package:appflowy/plugins/document/presentation/editor_notification.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
import 'package:appflowy/plugins/shared/share/constants.dart';
+import 'package:appflowy/plugins/trash/application/prelude.dart';
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/workspace/application/view/prelude.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
@@ -214,11 +213,8 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
}
final insertedNode = <Node>[];
-
for (final node in selectedNodes) {
- Log.info(
- 'Turn into block: from ${node.type} to $type',
- );
+ Log.info('Turn into block: from ${node.type} to $type');
Node afterNode = node.copyWith(
type: type,
@@ -239,9 +235,8 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
// heading block and callout block should not have children
if ([HeadingBlockKeys.type, CalloutBlockKeys.type, QuoteBlockKeys.type]
.contains(toType)) {
- afterNode = afterNode.copyWith(
- children: [],
- );
+ afterNode = afterNode.copyWith(children: []);
+ afterNode = await _handleSubPageNode(afterNode, node);
insertedNode.add(afterNode);
insertedNode.addAll(node.children.map((e) => e.copyWith()));
} else if (!EditorOptionActionType.turnInto.supportTypes
@@ -249,6 +244,7 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
afterNode = node.copyWith();
insertedNode.add(afterNode);
} else {
+ afterNode = await _handleSubPageNode(afterNode, node);
insertedNode.add(afterNode);
}
}
@@ -264,6 +260,43 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
return true;
}
+ /// Takes the new [Node] and the Node which is a SubPageBlock.
+ ///
+ /// Returns the altered [Node] with the delta as the Views' name.
+ ///
+ Future<Node> _handleSubPageNode(Node node, Node subPageNode) async {
+ if (subPageNode.type != SubPageBlockKeys.type) {
+ return node;
+ }
+
+ final delta = await _deltaFromSubPageNode(subPageNode);
+ return node.copyWith(
+ attributes: {
+ ...node.attributes,
+ blockComponentDelta: (delta ?? Delta()).toJson(),
+ },
+ );
+ }
+
+ /// Returns the [Delta] from a SubPage [Node], where the
+ /// [Delta] is the views' name.
+ ///
+ Future<Delta?> _deltaFromSubPageNode(Node node) async {
+ if (node.type != SubPageBlockKeys.type) {
+ return null;
+ }
+
+ final viewId = node.attributes[SubPageBlockKeys.viewId];
+ final viewOrFailure = await ViewBackendService.getView(viewId);
+ final view = viewOrFailure.toNullable();
+ if (view != null) {
+ return Delta(operations: [TextInsert(view.name)]);
+ }
+
+ Log.error("Failed to get view by id($viewId)");
+ return null;
+ }
+
// turn a single node into toggle heading block
// 1. find the sibling nodes after the selected node until
// meet the first node that contains level and its value is greater or equal to the level
@@ -322,6 +355,11 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
'Turn into block: from ${node.type} to $type',
);
+ Delta newDelta = delta ?? (node.delta ?? Delta());
+ if (delta == null && node.type == SubPageBlockKeys.type) {
+ newDelta = await _deltaFromSubPageNode(node) ?? Delta();
+ }
+
final afterNode = node.copyWith(
type: type,
attributes: {
@@ -332,7 +370,7 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
node.attributes[blockComponentBackgroundColor],
blockComponentTextDirection:
node.attributes[blockComponentTextDirection],
- blockComponentDelta: (delta ?? node.delta ?? Delta()).toJson(),
+ blockComponentDelta: newDelta.toJson(),
},
children: [
...node.children,
@@ -376,7 +414,7 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
final insertedNodes = selectedNodes.map((n) => n.copyWith()).toList();
final document = Document.blank()..insert([0], insertedNodes);
- final name = _extractNameFromNodes(selectedNodes);
+ final name = await _extractNameFromNodes(selectedNodes);
final viewResult = await ViewBackendService.createView(
layoutType: ViewLayoutPB.Document,
@@ -388,16 +426,6 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
await viewResult.fold(
(view) async {
- final viewIdsToMove = _extractChildViewIds(selectedNodes);
-
- for (final viewId in viewIdsToMove) {
- await ViewBackendService.moveViewV2(
- viewId: viewId,
- newParentId: view.id,
- prevViewId: null,
- );
- }
-
final node = subPageNode(viewId: view.id);
final transaction = editorState.transaction;
transaction
@@ -407,6 +435,19 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
editorState.selectionType = SelectionType.inline;
await editorState.apply(transaction);
+
+ // We move views after applying transaction to avoid performing side-effects on the views
+ final viewIdsToMove = _extractChildViewIds(selectedNodes);
+ for (final viewId in viewIdsToMove) {
+ // Attempt to put back from trash if neccessary
+ await TrashService.putback(viewId);
+
+ await ViewBackendService.moveViewV2(
+ viewId: viewId,
+ newParentId: view.id,
+ prevViewId: null,
+ );
+ }
},
(err) async => Log.error(err),
);
@@ -414,27 +455,46 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
return true;
}
- String _extractNameFromNodes(List<Node>? nodes) {
+ Future<String> _extractNameFromNodes(List<Node>? nodes) async {
if (nodes == null || nodes.isEmpty) {
return '';
}
String name = '';
for (final node in nodes) {
+ if (name.length > 30) {
+ return name.substring(0, name.length > 30 ? 30 : name.length);
+ }
+
if (node.delta != null) {
- final text = node.delta!.toPlainText();
- if (text == MentionBlockKeys.mentionChar) {
- continue;
+ // "ABC [Hello world]" -> ABC Hello world
+ final textInserts = node.delta!.whereType<TextInsert>();
+ for (final ti in textInserts) {
+ if (ti.attributes?[MentionBlockKeys.mention] != null) {
+ // fetch the view name
+ final pageId = ti.attributes![MentionBlockKeys.mention]
+ [MentionBlockKeys.pageId];
+ final viewOrFailure = await ViewBackendService.getView(pageId);
+
+ final view = viewOrFailure.toNullable();
+ if (view == null) {
+ Log.error('Failed to fetch view with id: $pageId');
+ continue;
+ }
+
+ name += view.name;
+ } else {
+ name += ti.data!.toString();
+ }
}
- name = text.substring(0, min(text.length, 30));
if (name.isNotEmpty) {
break;
}
}
if (node.children.isNotEmpty) {
- final n = _extractNameFromNodes(node.children);
+ final n = await _extractNameFromNodes(node.children);
if (n.isNotEmpty) {
name = n;
break;
@@ -442,7 +502,7 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
}
}
- return name;
+ return name.substring(0, name.length > 30 ? 30 : name.length);
}
List<String> _extractChildViewIds(List<Node> nodes) {
@@ -483,9 +543,7 @@ class BlockActionOptionCubit extends Cubit<BlockActionOptionState> {
Selection? beforeSelection,
) {
final path = selectedNode.path;
- final selection = Selection.collapsed(
- Position(path: path),
- );
+ final selection = Selection.collapsed(Position(path: path));
// if the previous selection is null or the start path is not in the same level as the current block path,
// then update the selection with the current block path
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart
index 8dec2eaf66..cba15950e3 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart
@@ -32,7 +32,7 @@ class TurnIntoOptionAction extends CustomActionCell {
controller: innerController,
mutex: mutex,
popupBuilder: (context) => BlocProvider<BlockActionOptionCubit>(
- create: (context) => BlockActionOptionCubit(
+ create: (_) => BlockActionOptionCubit(
editorState: editorState,
blockComponentBuilder: blockComponentBuilder,
),
@@ -50,9 +50,7 @@ class TurnIntoOptionAction extends CustomActionCell {
// todo(lucas): replace the svg with the correct one
leftIcon: const FlowySvg(FlowySvgs.turninto_s),
name: LocaleKeys.document_plugins_optionAction_turnInto.tr(),
- onTap: () {
- innerController.show();
- },
+ onTap: innerController.show,
),
);
}
@@ -73,7 +71,25 @@ class TurnIntoOptionAction extends CustomActionCell {
return const SizedBox.shrink();
}
- return TurnIntoOptionMenu(node: node);
+ return TurnIntoOptionMenu(
+ node: node,
+ hasNonSupportedTypes: _hasNonSupportedTypes(selection),
+ );
+ }
+
+ bool _hasNonSupportedTypes(Selection selection) {
+ final nodes = editorState.getNodesInSelection(selection);
+ if (nodes.isEmpty) {
+ return false;
+ }
+
+ for (final node in nodes) {
+ if (!EditorOptionActionType.turnInto.supportTypes.contains(node.type)) {
+ return true;
+ }
+ }
+
+ return false;
}
}
@@ -81,10 +97,16 @@ class TurnIntoOptionMenu extends StatelessWidget {
const TurnIntoOptionMenu({
super.key,
required this.node,
+ required this.hasNonSupportedTypes,
});
final Node node;
+ /// Signifies whether the selection contains [Node]s that are not supported,
+ /// these often do not have a [Delta], example could be [FileBlockComponent].
+ ///
+ final bool hasNonSupportedTypes;
+
@override
Widget build(BuildContext context) {
return Column(
@@ -96,6 +118,16 @@ class TurnIntoOptionMenu extends StatelessWidget {
List<Widget> _buildTurnIntoOptions(BuildContext context, Node node) {
final children = <Widget>[];
+ if (hasNonSupportedTypes) {
+ return children
+ ..add(
+ _TurnInfoButton(
+ type: SubPageBlockKeys.type,
+ node: node,
+ ),
+ );
+ }
+
for (final type in EditorOptionActionType.turnInto.supportTypes) {
if (type == ToggleListBlockKeys.type) {
// toggle list block and toggle heading block are the same type,
@@ -156,41 +188,25 @@ class _TurnInfoButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final name = _buildLocalization(
- type,
- level: level,
- );
- final leftIcon = _buildLeftIcon(
- type,
- level: level,
- );
- final rightIcon = _buildRightIcon(
- type,
- node,
- level: level,
- );
+ final name = _buildLocalization(type, level: level);
+ final leftIcon = _buildLeftIcon(type, level: level);
+ final rightIcon = _buildRightIcon(type, node, level: level);
return HoverButton(
name: name,
leftIcon: FlowySvg(leftIcon),
rightIcon: rightIcon,
itemHeight: ActionListSizes.itemHeight,
- onTap: () {
- context.read<BlockActionOptionCubit>().turnIntoBlock(
- type,
- node,
- level: level,
- currentViewId: getIt<MenuSharedState>().latestOpenView?.id,
- );
- },
+ onTap: () => context.read<BlockActionOptionCubit>().turnIntoBlock(
+ type,
+ node,
+ level: level,
+ currentViewId: getIt<MenuSharedState>().latestOpenView?.id,
+ ),
);
}
- Widget? _buildRightIcon(
- String type,
- Node node, {
- int? level,
- }) {
+ Widget? _buildRightIcon(String type, Node node, {int? level}) {
if (type != node.type) {
return null;
}
@@ -215,10 +231,7 @@ class _TurnInfoButton extends StatelessWidget {
);
}
- FlowySvgData _buildLeftIcon(
- String type, {
- int? level,
- }) {
+ FlowySvgData _buildLeftIcon(String type, {int? level}) {
if (type == ParagraphBlockKeys.type) {
return FlowySvgs.slash_menu_icon_text_s;
} else if (type == HeadingBlockKeys.type) {
@@ -243,7 +256,7 @@ class _TurnInfoButton extends StatelessWidget {
} else if (type == CalloutBlockKeys.type) {
return FlowySvgs.slash_menu_icon_callout_s;
} else if (type == SubPageBlockKeys.type) {
- return FlowySvgs.document_s;
+ return FlowySvgs.icon_document_s;
} else if (type == ToggleListBlockKeys.type) {
switch (level) {
case 1:
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/referenced_database_menu_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/referenced_database_menu_item.dart
index 7f662b5363..8f6c117833 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/referenced_database_menu_item.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/database/referenced_database_menu_item.dart
@@ -11,7 +11,7 @@ import 'package:easy_localization/easy_localization.dart';
SelectionMenuItem referencedDocumentMenuItem = SelectionMenuItem(
getName: LocaleKeys.document_plugins_referencedDocument.tr,
icon: (editorState, onSelected, style) => SelectableSvgWidget(
- data: FlowySvgs.document_s,
+ data: FlowySvgs.icon_document_s,
isSelected: onSelected,
style: style,
),
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
index c6a91b2d81..7feae9849b 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
@@ -481,11 +481,7 @@ class _MentionPageBlockContent extends StatelessWidget {
optimizeEmojiAlign: true,
color: AFThemeExtension.of(context).strongText,
)
- : FlowySvg(
- view.layout.icon,
- size: Size.square(iconSize + 2.0),
- color: AFThemeExtension.of(context).strongText,
- ),
+ : view.defaultIcon(size: Size.square(iconSize + 2.0)),
if (!isChildPage) ...[
const Positioned(
right: 0,
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_toolbar_item.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_toolbar_item.dart
index 60d566396f..7e894ca95b 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_toolbar_item.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_toolbar_item.dart
@@ -236,7 +236,7 @@ class _AddBlockMenu extends StatelessWidget {
value: ParagraphBlockKeys.type,
backgroundColor: colorMap[MentionBlockKeys.type]!,
text: LocaleKeys.editor_page.tr(),
- icon: FlowySvgs.document_s,
+ icon: FlowySvgs.icon_document_s,
onTap: (_, __) async {
AppGlobals.rootNavKey.currentContext?.pop(true);
diff --git a/frontend/appflowy_flutter/lib/workspace/application/command_palette/search_result_ext.dart b/frontend/appflowy_flutter/lib/workspace/application/command_palette/search_result_ext.dart
index aedc6fc03e..7b2eece965 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/command_palette/search_result_ext.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/command_palette/search_result_ext.dart
@@ -22,10 +22,10 @@ extension GetIcon on SearchResultPB {
extension _ToViewIcon on ResultIconPB {
FlowySvgData getViewSvg() => switch (value) {
- "0" => FlowySvgs.document_s,
- "1" => FlowySvgs.grid_s,
- "2" => FlowySvgs.board_s,
- "3" => FlowySvgs.date_s,
- _ => FlowySvgs.document_s,
+ "0" => FlowySvgs.icon_document_s,
+ "1" => FlowySvgs.icon_grid_s,
+ "2" => FlowySvgs.icon_board_s,
+ "3" => FlowySvgs.icon_calendar_s,
+ _ => FlowySvgs.icon_document_s,
};
}
diff --git a/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart b/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart
index 3b3b369ccd..94f4288be8 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/view/view_ext.dart
@@ -60,7 +60,7 @@ extension MinimalViewExtension on FolderViewMinimalPB {
ViewLayoutPB.Grid => FlowySvgs.icon_grid_s,
ViewLayoutPB.Document => FlowySvgs.icon_document_s,
ViewLayoutPB.Chat => FlowySvgs.chat_ai_page_s,
- _ => FlowySvgs.document_s,
+ _ => FlowySvgs.icon_document_s,
},
size: size,
);
@@ -77,7 +77,7 @@ extension ViewExtension on ViewPB {
ViewLayoutPB.Grid => FlowySvgs.icon_grid_s,
ViewLayoutPB.Document => FlowySvgs.icon_document_s,
ViewLayoutPB.Chat => FlowySvgs.chat_ai_page_s,
- _ => FlowySvgs.document_s,
+ _ => FlowySvgs.icon_document_s,
},
size: size,
);
@@ -293,12 +293,12 @@ extension ViewExtension on ViewPB {
extension ViewLayoutExtension on ViewLayoutPB {
FlowySvgData get icon => switch (this) {
- ViewLayoutPB.Grid => FlowySvgs.grid_s,
- ViewLayoutPB.Board => FlowySvgs.board_s,
- ViewLayoutPB.Calendar => FlowySvgs.calendar_s,
- ViewLayoutPB.Document => FlowySvgs.document_s,
+ ViewLayoutPB.Board => FlowySvgs.icon_board_s,
+ ViewLayoutPB.Calendar => FlowySvgs.icon_calendar_s,
+ ViewLayoutPB.Grid => FlowySvgs.icon_grid_s,
+ ViewLayoutPB.Document => FlowySvgs.icon_document_s,
ViewLayoutPB.Chat => FlowySvgs.chat_ai_page_s,
- _ => throw Exception('Unknown layout type'),
+ _ => FlowySvgs.icon_document_s,
};
bool get isDocumentView => switch (this) {
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/notification_dialog.dart b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/notification_dialog.dart
index 0c22cd60d2..7a14b6b1c5 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/notification_dialog.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/notification_dialog.dart
@@ -63,7 +63,12 @@ class _NotificationDialogState extends State<NotificationDialog>
builder: (context, filterState) =>
BlocBuilder<ReminderBloc, ReminderState>(
builder: (context, state) {
- final pastReminders = state.pastReminders.sortByScheduledAt();
+ List<ReminderPB> pastReminders =
+ state.pastReminders.sortByScheduledAt();
+ if (filterState.showUnreadsOnly) {
+ pastReminders = pastReminders.where((r) => !r.isRead).toList();
+ }
+
final upcomingReminders =
state.upcomingReminders.sortByScheduledAt();
final hasUnreads = pastReminders.any((r) => !r.isRead);
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_item.dart b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_item.dart
index 849d8cd5c5..3d12a6afb7 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_item.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/notifications/widgets/notification_item.dart
@@ -269,6 +269,7 @@ class NotificationItemActions extends StatelessWidget {
FlowyIconButton(
height: size,
width: size,
+ radius: BorderRadius.circular(4),
tooltipText:
LocaleKeys.reminderNotification_tooltipMarkUnread.tr(),
icon: const FlowySvg(FlowySvgs.restore_s),
@@ -279,6 +280,7 @@ class NotificationItemActions extends StatelessWidget {
FlowyIconButton(
height: size,
width: size,
+ radius: BorderRadius.circular(4),
tooltipText:
LocaleKeys.reminderNotification_tooltipMarkRead.tr(),
iconColorOnHover: Theme.of(context).colorScheme.onSurface,
diff --git a/frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart b/frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart
index 50e0462380..387375c286 100644
--- a/frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart
+++ b/frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart
@@ -32,23 +32,17 @@ void main() {
? EditorOptionActionType.turnInto.supportTypes
: [toType];
for (final type in types) {
- if (type == originalType) {
+ if (type == originalType || type == SubPageBlockKeys.type) {
continue;
}
editorState.selectionType = SelectionType.block;
- editorState.selection = selection ??
- Selection.collapsed(
- Position(path: [0]),
- );
+ editorState.selection =
+ selection ?? Selection.collapsed(Position(path: [0]));
final node = editorState.getNodeAtPath([0])!;
expect(node.type, originalType);
- final result = await cubit.turnIntoBlock(
- type,
- node,
- level: level,
- );
+ final result = await cubit.turnIntoBlock(type, node, level: level);
expect(result, true);
final newNode = editorState.getNodeAtPath([0])!;
expect(newNode.type, type);
@@ -82,26 +76,13 @@ void main() {
test('from heading to another blocks', () async {
const text = 'Heading 1';
- final document = createDocument([
- headingNode(
- level: 1,
- text: text,
- ),
- ]);
- await checkTurnInto(
- document,
- HeadingBlockKeys.type,
- text,
- );
+ final document = createDocument([headingNode(level: 1, text: text)]);
+ await checkTurnInto(document, HeadingBlockKeys.type, text);
});
test('from paragraph to another blocks', () async {
const text = 'Paragraph';
- final document = createDocument([
- paragraphNode(
- text: text,
- ),
- ]);
+ final document = createDocument([paragraphNode(text: text)]);
await checkTurnInto(
document,
ParagraphBlockKeys.type,
@@ -717,9 +698,7 @@ void main() {
document,
HeadingBlockKeys.type,
heading1,
- selection: Selection.collapsed(
- Position(path: [0]),
- ),
+ selection: Selection.collapsed(Position(path: [0])),
toType: ToggleListBlockKeys.type,
level: 1,
afterTurnInto: (editorState, node) {