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.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
feat: reordering table columns and rows on mobile (#7036)
Lucas6e0534400b78
diff --git a/frontend/appflowy_flutter/integration_test/mobile/document/document_test_runner.dart b/frontend/appflowy_flutter/integration_test/mobile/document/document_test_runner.dartindex 015e11676c..67fdaaa204 100644--- a/frontend/appflowy_flutter/integration_test/mobile/document/document_test_runner.dart+++ b/frontend/appflowy_flutter/integration_test/mobile/document/document_test_runner.dart@@ -2,6 +2,7 @@ import 'package:integration_test/integration_test.dart';import 'page_style_test.dart' as page_style_test;import 'plus_menu_test.dart' as plus_menu_test;+import 'simple_table_test.dart' as simple_table_test;import 'title_test.dart' as title_test;void main() {@@ -11,4 +12,5 @@ void main() {title_test.main();page_style_test.main();plus_menu_test.main();+ simple_table_test.main();}diff --git a/frontend/appflowy_flutter/integration_test/mobile/document/simple_table_test.dart b/frontend/appflowy_flutter/integration_test/mobile/document/simple_table_test.dartnew file mode 100644index 0000000000..c7a244fec3--- /dev/null+++ b/frontend/appflowy_flutter/integration_test/mobile/document/simple_table_test.dart@@ -0,0 +1,398 @@+import 'dart:async';++import 'package:appflowy/generated/locale_keys.g.dart';+import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table.dart';+import 'package:appflowy_editor/appflowy_editor.dart';+import 'package:easy_localization/easy_localization.dart';+import 'package:flutter_test/flutter_test.dart';+import 'package:integration_test/integration_test.dart';++import '../../shared/util.dart';++void main() {+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();++ group('simple table:', () {+ testWidgets('''+1. insert a simple table via + menu+2. insert a row above the table+3. insert a row below the table+4. insert a column left to the table+5. insert a column right to the table+6. delete the first row+7. delete the first column+''', (tester) async {+ await tester.launchInAnonymousMode();+ await tester.createNewDocumentOnMobile('simple table');++ final editorState = tester.editor.getCurrentEditorState();+ // focus on the editor+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: [0])),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ final firstParagraphPath = [0, 0, 0, 0];++ // open the plus menu and select the table block+ {+ await tester.openPlusMenuAndClickButton(+ LocaleKeys.document_slashMenu_name_table.tr(),+ );++ // check the block is inserted+ final table = editorState.getNodeAtPath([0])!;+ expect(table.type, equals(SimpleTableBlockKeys.type));+ expect(table.rowLength, equals(2));+ expect(table.columnLength, equals(2));++ // focus on the first cell++ final selection = editorState.selection!;+ expect(selection.isCollapsed, isTrue);+ expect(selection.start.path, equals(firstParagraphPath));+ }++ // insert left and insert right+ {+ // click the column menu button+ await tester.clickColumnMenuButton(0);++ // insert left, insert right+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_insertLeft.tr(),+ ),+ );+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_insertRight+ .tr(),+ ),+ );++ await tester.cancelTableActionMenu();++ // check the table is updated+ final table = editorState.getNodeAtPath([0])!;+ expect(table.type, equals(SimpleTableBlockKeys.type));+ expect(table.rowLength, equals(2));+ expect(table.columnLength, equals(4));+ }++ // insert above and insert below+ {+ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // click the row menu button+ await tester.clickRowMenuButton(0);++ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_insertAbove+ .tr(),+ ),+ );+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_insertBelow+ .tr(),+ ),+ );+ await tester.cancelTableActionMenu();++ // check the table is updated+ final table = editorState.getNodeAtPath([0])!;+ expect(table.rowLength, equals(4));+ expect(table.columnLength, equals(4));+ }++ // delete the first row+ {+ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // delete the first row+ await tester.clickRowMenuButton(0);+ await tester.clickSimpleTableQuickAction(SimpleTableMoreAction.delete);+ await tester.cancelTableActionMenu();++ // check the table is updated+ final table = editorState.getNodeAtPath([0])!;+ expect(table.rowLength, equals(3));+ expect(table.columnLength, equals(4));+ }++ // delete the first column+ {+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ await tester.clickColumnMenuButton(0);+ await tester.clickSimpleTableQuickAction(SimpleTableMoreAction.delete);+ await tester.cancelTableActionMenu();++ // check the table is updated+ final table = editorState.getNodeAtPath([0])!;+ expect(table.rowLength, equals(3));+ expect(table.columnLength, equals(3));+ }+ });++ testWidgets('''+1. insert a simple table via + menu+2. enable header column+3. enable header row+4. set to page width+5. distribute columns evenly+''', (tester) async {+ await tester.launchInAnonymousMode();+ await tester.createNewDocumentOnMobile('simple table');++ final editorState = tester.editor.getCurrentEditorState();+ // focus on the editor+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: [0])),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ final firstParagraphPath = [0, 0, 0, 0];++ // open the plus menu and select the table block+ {+ await tester.openPlusMenuAndClickButton(+ LocaleKeys.document_slashMenu_name_table.tr(),+ );++ // check the block is inserted+ final table = editorState.getNodeAtPath([0])!;+ expect(table.type, equals(SimpleTableBlockKeys.type));+ expect(table.rowLength, equals(2));+ expect(table.columnLength, equals(2));++ // focus on the first cell++ final selection = editorState.selection!;+ expect(selection.isCollapsed, isTrue);+ expect(selection.start.path, equals(firstParagraphPath));+ }++ // enable header column+ {+ // click the column menu button+ await tester.clickColumnMenuButton(0);++ // enable header column+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_headerColumn+ .tr(),+ ),+ );+ }++ // enable header row+ {+ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // click the row menu button+ await tester.clickRowMenuButton(0);++ // enable header column+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_headerRow.tr(),+ ),+ );+ }++ // check the table is updated+ final table = editorState.getNodeAtPath([0])!;+ expect(table.type, equals(SimpleTableBlockKeys.type));+ expect(table.isHeaderColumnEnabled, isTrue);+ expect(table.isHeaderRowEnabled, isTrue);++ // set to page width+ {+ final table = editorState.getNodeAtPath([0])!;+ final beforeWidth = table.width;+ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // click the row menu button+ await tester.clickRowMenuButton(0);++ // enable header column+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_setToPageWidth+ .tr(),+ ),+ );++ // check the table is updated+ expect(table.width, greaterThan(beforeWidth));+ }++ // distribute columns evenly+ {+ final table = editorState.getNodeAtPath([0])!;+ final beforeWidth = table.width;++ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // click the column menu button+ await tester.clickColumnMenuButton(0);++ // distribute columns evenly+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys+ .document_plugins_simpleTable_moreActions_distributeColumnsWidth+ .tr(),+ ),+ );++ // check the table is updated+ expect(table.width, equals(beforeWidth));+ }+ });++ testWidgets('''+1. insert a simple table via + menu+2. bold+3. clear content+''', (tester) async {+ await tester.launchInAnonymousMode();+ await tester.createNewDocumentOnMobile('simple table');++ final editorState = tester.editor.getCurrentEditorState();+ // focus on the editor+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: [0])),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ final firstParagraphPath = [0, 0, 0, 0];++ // open the plus menu and select the table block+ {+ await tester.openPlusMenuAndClickButton(+ LocaleKeys.document_slashMenu_name_table.tr(),+ );++ // check the block is inserted+ final table = editorState.getNodeAtPath([0])!;+ expect(table.type, equals(SimpleTableBlockKeys.type));+ expect(table.rowLength, equals(2));+ expect(table.columnLength, equals(2));++ // focus on the first cell++ final selection = editorState.selection!;+ expect(selection.isCollapsed, isTrue);+ expect(selection.start.path, equals(firstParagraphPath));+ }++ await tester.ime.insertText('Hello');++ // enable bold+ {+ // click the column menu button+ await tester.clickColumnMenuButton(0);++ // enable bold+ await tester.clickSimpleTableBoldContentAction();+ await tester.cancelTableActionMenu();++ // check the first cell is bold+ final paragraph = editorState.getNodeAtPath(firstParagraphPath)!;+ expect(paragraph.delta!, isNotEmpty);+ expect(+ paragraph.delta!.toJson(),+ equals([+ {+ 'insert': 'Hello',+ 'attributes': {'bold': true},+ }+ ]),+ );+ }++ // clear content+ {+ // focus on the first cell+ unawaited(+ editorState.updateSelectionWithReason(+ Selection.collapsed(Position(path: firstParagraphPath)),+ reason: SelectionUpdateReason.uiEvent,+ ),+ );+ await tester.pumpAndSettle();++ // click the column menu button+ await tester.clickColumnMenuButton(0);++ // clear content+ await tester.tapButton(+ find.findTextInFlowyText(+ LocaleKeys.document_plugins_simpleTable_moreActions_clearContents+ .tr(),+ ),+ );+ await tester.cancelTableActionMenu();++ // check the first cell is empty+ final paragraph = editorState.getNodeAtPath(firstParagraphPath)!;+ expect(paragraph.delta!, isEmpty);+ }+ });+ });+}diff --git a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart b/frontend/appflowy_flutter/integration_test/shared/common_operations.dartindex febb9ed721..6ac67d0e33 100644--- a/frontend/appflowy_flutter/integration_test/shared/common_operations.dart+++ b/frontend/appflowy_flutter/integration_test/shared/common_operations.dart@@ -8,6 +8,8 @@ import 'package:appflowy/mobile/presentation/base/type_option_menu_item.dart';import 'package:appflowy/mobile/presentation/presentation.dart';import 'package:appflowy/plugins/document/presentation/editor_plugins/base/emoji_picker_button.dart';import 'package:appflowy/plugins/document/presentation/editor_plugins/mobile_toolbar_v3/add_block_toolbar_item.dart';+import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table.dart';+import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/_simple_table_bottom_sheet_actions.dart';import 'package:appflowy/plugins/shared/share/share_button.dart';import 'package:appflowy/shared/feature_flags.dart';import 'package:appflowy/shared/icon_emoji_picker/flowy_icon_emoji_picker.dart';@@ -847,6 +849,55 @@ extension CommonOperations on WidgetTester {await tapButton(toggleHeading1);await pumpUntilNotFound(addMenuItem);}++ /// Click the column menu button in the simple table+ Future<void> clickColumnMenuButton(int index) async {+ final columnMenuButton = find.byWidgetPredicate(+ (w) =>+ w is SimpleTableMobileReorderButton &&+ w.index == index &&+ w.type == SimpleTableMoreActionType.column,+ );+ await tapButton(columnMenuButton);+ await pumpUntilFound(find.byType(SimpleTableCellBottomSheet));+ }++ /// Click the row menu button in the simple table+ Future<void> clickRowMenuButton(int index) async {+ final rowMenuButton = find.byWidgetPredicate(+ (w) =>+ w is SimpleTableMobileReorderButton &&+ w.index == index &&+ w.type == SimpleTableMoreActionType.row,+ );+ await tapButton(rowMenuButton);+ await pumpUntilFound(find.byType(SimpleTableCellBottomSheet));+ }++ /// Click the SimpleTableQuickAction+ Future<void> clickSimpleTableQuickAction(SimpleTableMoreAction action) async {+ final button = find.byWidgetPredicate(+ (widget) => widget is SimpleTableQuickAction && widget.type == action,+ );+ await tapButton(button);+ }++ /// Click the SimpleTableContentAction+ Future<void> clickSimpleTableBoldContentAction() async {+ final button = find.byType(SimpleTableContentBoldAction);+ await tapButton(button);+ }++ /// Cancel the table action menu+ Future<void> cancelTableActionMenu() async {+ final finder = find.byType(SimpleTableCellBottomSheet);+ if (finder.evaluate().isEmpty) {+ return;+ }++ await tapAt(Offset.zero);+ await pumpUntilNotFound(finder);+ }}extension SettingsFinder on CommonFinders {diff --git a/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/shared.dart b/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/shared.dartindex ee7581bdb0..70cc8c5214 100644--- a/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/shared.dart+++ b/frontend/appflowy_flutter/lib/mobile/presentation/notifications/widgets/shared.dart@@ -14,6 +14,7 @@ import 'package:easy_localization/easy_localization.dart';import 'package:flowy_infra_ui/flowy_infra_ui.dart';import 'package:flutter/material.dart';import 'package:flutter_bloc/flutter_bloc.dart';+import 'package:universal_platform/universal_platform.dart';const _kNotificationIconHeight = 36.0;@@ -264,7 +265,11 @@ class NotificationDocumentContent extends StatelessWidget {styleCustomizer: styleCustomizer,// the editor is not editable in the chateditable: false,- customHeadingPadding: EdgeInsets.zero,+ customHeadingPadding: UniversalPlatform.isDesktop+ ? EdgeInsets.zero+ : EdgeInsets.symmetric(+ vertical: EditorStyleCustomizer.nodeHorizontalPadding,+ ),);return IgnorePointer(diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dartindex f5606dea23..efa7a6405f 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart@@ -79,12 +79,25 @@ Map<String, BlockComponentBuilder> buildBlockComponentBuilders({BlockComponentConfiguration _buildDefaultConfiguration(BuildContext context) {final configuration = BlockComponentConfiguration(- padding: (_) {+ padding: (node) {if (UniversalPlatform.isMobile) {final pageStyle = context.read<DocumentPageStyleBloc>().state;final factor = pageStyle.fontLayout.factor;- final padding = pageStyle.lineHeightLayout.padding * factor;- return EdgeInsets.only(top: padding);+ final top = pageStyle.lineHeightLayout.padding * factor;+ EdgeInsets edgeInsets = EdgeInsets.only(top: top);+ // only add padding for the top level node, otherwise the nested node will have extra padding+ if (node.path.length == 1) {+ if (node.type != SimpleTableBlockKeys.type) {+ // do not add padding for the simple table to allow it overflow+ edgeInsets = edgeInsets.copyWith(+ left: EditorStyleCustomizer.nodeHorizontalPadding,+ );+ }+ edgeInsets = edgeInsets.copyWith(+ right: EditorStyleCustomizer.nodeHorizontalPadding,+ );+ }+ return edgeInsets;}return const EdgeInsets.symmetric(vertical: 5.0);@@ -354,10 +367,7 @@ SimpleTableBlockComponentBuilder _buildSimpleTableBlockComponentBuilder(if (UniversalPlatform.isDesktop) {return padding;} else {- return padding.copyWith(- left: 0,- right: padding.left,- );+ return padding;}},);@@ -514,9 +524,17 @@ HeadingBlockComponentBuilder _buildHeadingBlockComponentBuilder(final factor = pageStyle.fontLayout.factor;final headingPaddings =pageStyle.lineHeightLayout.headingPaddings.map((e) => e * factor);- int level = node.attributes[HeadingBlockKeys.level] ?? 6;- level = level.clamp(1, 6);- return EdgeInsets.only(top: headingPaddings.elementAt(level - 1));+ final level =+ (node.attributes[HeadingBlockKeys.level] ?? 6).clamp(1, 6);+ final top = headingPaddings.elementAt(level - 1);+ EdgeInsets edgeInsets = EdgeInsets.only(top: top);+ if (node.path.length == 1) {+ edgeInsets = edgeInsets.copyWith(+ left: EditorStyleCustomizer.nodeHorizontalPadding,+ right: EditorStyleCustomizer.nodeHorizontalPadding,+ );+ }+ return edgeInsets;}return const EdgeInsets.only(top: 12.0, bottom: 4.0);diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dartindex ba714d399c..495fb7c922 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dart@@ -228,14 +228,6 @@ class _SimpleTableBlockWidgetState extends State<SimpleTableBlockWidget>),child: child,);- } else if (UniversalPlatform.isMobile) {- child = Transform.translate(- offset: Offset(- -SimpleTableConstants.tableHitTestLeftPadding,- 0,- ),- child: child,- );}child = Container(diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dartindex ca7837632a..4b79eee10a 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dart@@ -2,6 +2,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_tabimport 'package:appflowy_editor/appflowy_editor.dart';import 'package:flutter/material.dart';import 'package:provider/provider.dart';+import 'package:universal_platform/universal_platform.dart';class SimpleTableCellBlockKeys {const SimpleTableCellBlockKeys._();@@ -84,13 +85,21 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>node: node,);+ /// Notify if the cell is editing.ValueNotifier<bool> isEditingCellNotifier = ValueNotifier(false);+ /// Notify if the cell is hit by the reordering offset.+ ///+ /// This value is only available on mobile.+ ValueNotifier<bool> isReorderingHitCellNotifier = ValueNotifier(false);+@overridevoid initState() {super.initState();simpleTableContext?.isSelectingTable.addListener(_onSelectingTableChanged);+ simpleTableContext?.reorderingOffset+ .addListener(_onReorderingOffsetChanged);node.parentTableNode?.addListener(_onSelectingTableChanged);editorState.selectionNotifier.addListener(_onSelectionChanged);@@ -104,6 +113,9 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>simpleTableContext?.isSelectingTable.removeListener(_onSelectingTableChanged,);+ simpleTableContext?.reorderingOffset.removeListener(+ _onReorderingOffsetChanged,+ );node.parentTableNode?.removeListener(_onSelectingTableChanged);editorState.selectionNotifier.removeListener(_onSelectionChanged);isEditingCellNotifier.dispose();@@ -117,53 +129,59 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>return const SizedBox.shrink();}- return MouseRegion(- hitTestBehavior: HitTestBehavior.opaque,- onEnter: (event) => simpleTableContext!.hoveringTableCell.value = node,- child: Stack(- clipBehavior: Clip.none,- children: [- _buildCell(),- if (editorState.editable) ...[- if (node.columnIndex == 0)- Positioned(- // if the cell is in the first row, add padding to the top of the cell- // to make the row action button clickable.- top: node.rowIndex == 0- ? SimpleTableConstants.tableHitTestTopPadding- : 0,- bottom: 0,- left: -SimpleTableConstants.tableLeftPadding,- child: _buildRowMoreActionButton(),- ),- if (node.rowIndex == 0)- Positioned(- left: node.columnIndex == 0- ? SimpleTableConstants.tableHitTestLeftPadding- : 0,- right: 0,- child: _buildColumnMoreActionButton(),- ),- if (node.columnIndex == 0 && node.rowIndex == 0)- Positioned(- left: 2,- top: 0,- child: _buildTableActionMenu(),- ),+ Widget child = Stack(+ clipBehavior: Clip.none,+ children: [+ _buildCell(),+ if (editorState.editable) ...[+ if (node.columnIndex == 0)Positioned(- right: 0,+ // if the cell is in the first row, add padding to the top of the cell+ // to make the row action button clickable.top: node.rowIndex == 0? SimpleTableConstants.tableHitTestTopPadding: 0,bottom: 0,- child: SimpleTableColumnResizeHandle(- node: node,- ),+ left: -SimpleTableConstants.tableLeftPadding,+ child: _buildRowMoreActionButton(),+ ),+ if (node.rowIndex == 0)+ Positioned(+ left: node.columnIndex == 0+ ? SimpleTableConstants.tableHitTestLeftPadding+ : 0,+ right: 0,+ child: _buildColumnMoreActionButton(),+ ),+ if (node.columnIndex == 0 && node.rowIndex == 0)+ Positioned(+ left: 2,+ top: 2,+ child: _buildTableActionMenu(),+ ),+ Positioned(+ right: 0,+ top: node.rowIndex == 0+ ? SimpleTableConstants.tableHitTestTopPadding+ : 0,+ bottom: 0,+ child: SimpleTableColumnResizeHandle(+ node: node,),- ],+ ),],- ),+ ],);++ if (UniversalPlatform.isDesktop) {+ child = MouseRegion(+ hitTestBehavior: HitTestBehavior.opaque,+ onEnter: (event) => simpleTableContext!.hoveringTableCell.value = node,+ child: child,+ );+ }++ return child;}Widget _buildCell() {@@ -171,6 +189,12 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>return const SizedBox.shrink();}+ return UniversalPlatform.isDesktop+ ? _buildDesktopCell()+ : _buildMobileCell();+ }++ Widget _buildDesktopCell() {return Padding(// add padding to the top of the cell if it is the first row, otherwise the// column action button is not clickable.@@ -224,6 +248,55 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>);}+ Widget _buildMobileCell() {+ return Padding(+ padding: EdgeInsets.only(+ top: node.rowIndex == 0+ ? SimpleTableConstants.tableHitTestTopPadding+ : 0,+ left: node.columnIndex == 0+ ? SimpleTableConstants.tableHitTestLeftPadding+ : 0,+ ),+ child: ValueListenableBuilder<bool>(+ valueListenable: isEditingCellNotifier,+ builder: (context, isEditingCell, child) {+ return ValueListenableBuilder(+ valueListenable: simpleTableContext!.selectingColumn,+ builder: (context, selectingColumn, _) {+ return ValueListenableBuilder(+ valueListenable: simpleTableContext!.selectingRow,+ builder: (context, selectingRow, _) {+ return ValueListenableBuilder(+ valueListenable: isReorderingHitCellNotifier,+ builder: (context, isReorderingHitCellNotifier, _) {+ return DecoratedBox(+ decoration: _buildDecoration(),+ child: child!,+ );+ },+ );+ },+ );+ },+ );+ },+ child: Container(+ padding: SimpleTableConstants.cellEdgePadding,+ constraints: const BoxConstraints(+ minWidth: SimpleTableConstants.minimumColumnWidth,+ ),+ width: node.columnWidth,+ child: node.children.isEmpty+ ? _buildEmptyCellContent()+ : Column(+ children: node.children.map(_buildCellContent).toList(),+ ),+ ),+ ),+ );+ }+Widget _buildCellContent(Node childNode) {final alignment = _buildAlignment();@@ -382,4 +455,51 @@ class SimpleTableCellBlockWidgetState extends State<SimpleTableCellBlockWidget>}}}++ /// Calculate if the cell is hit by the reordering offset.+ /// If the cell is hit, set the isReorderingCell to true.+ void _onReorderingOffsetChanged() {+ final simpleTableContext = this.simpleTableContext;+ if (UniversalPlatform.isDesktop || simpleTableContext == null) {+ return;+ }++ final isReordering = simpleTableContext.isReordering;+ if (!isReordering) {+ return;+ }++ final isReorderingColumn = simpleTableContext.isReorderingColumn.value.$1;+ final isReorderingRow = simpleTableContext.isReorderingRow.value.$1;+ if (!isReorderingColumn && !isReorderingRow) {+ return;+ }++ final reorderingOffset = simpleTableContext.reorderingOffset.value;++ final renderBox = node.renderBox;+ if (renderBox == null) {+ return;+ }++ final cellRect = renderBox.localToGlobal(Offset.zero) & renderBox.size;++ bool isHitCurrentCell = false;+ if (isReorderingColumn) {+ isHitCurrentCell = cellRect.left < reorderingOffset.dx &&+ cellRect.right > reorderingOffset.dx;+ } else if (isReorderingRow) {+ isHitCurrentCell = cellRect.top < reorderingOffset.dy &&+ cellRect.bottom > reorderingOffset.dy;+ }++ isReorderingHitCellNotifier.value = isHitCurrentCell;+ if (isHitCurrentCell) {+ if (isReorderingColumn) {+ simpleTableContext.isReorderingHitIndex.value = node.columnIndex;+ } else if (isReorderingRow) {+ simpleTableContext.isReorderingHitIndex.value = node.rowIndex;+ }+ }+ }}diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dartindex ff225437fa..0f531b1c91 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dart@@ -81,6 +81,11 @@ class SimpleTableContext {/// This value is available on mobile onlyfinal ValueNotifier<Node?> isEditingCell = ValueNotifier(null);+ /// isReorderingHitCell is the cell that the user is reordering+ ///+ /// This value is available on mobile only+ final ValueNotifier<int?> isReorderingHitIndex = ValueNotifier(null);+void _onHoveringOnColumnsAndRowsChanged() {if (!_enableTableDebugLog) {return;@@ -171,6 +176,7 @@ class SimpleTableContext {isReorderingRow.dispose();reorderingOffset.dispose();isEditingCell.dispose();+ isReorderingHitIndex.dispose();}}@@ -201,7 +207,8 @@ class SimpleTableConstants {);static double get tablePageOffset => UniversalPlatform.isMobile- ? EditorStyleCustomizer.optionMenuWidth + 24+ ? EditorStyleCustomizer.optionMenuWidth ++ EditorStyleCustomizer.nodeHorizontalPadding * 2: EditorStyleCustomizer.optionMenuWidth + 12;// Add row buttondiff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dartindex db5cb1ac5c..8b4e2f5153 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dart@@ -361,7 +361,7 @@ class _SimpleTableMoreActionMenuState extends State<SimpleTableMoreActionMenu> {child: SimpleTableMobileDraggableReorderButton(index: widget.index,type: widget.type,- node: widget.tableCellNode,+ cellNode: widget.tableCellNode,isShowingMenu: this.isShowingMenu,editorState: editorState,simpleTableContext: simpleTableContext,@@ -407,7 +407,14 @@ class SimpleTableActionMenu extends StatelessWidget {}return GestureDetector(- onTap: () => _showTableActionBottomSheet(context),+ behavior: HitTestBehavior.opaque,+ onTap: () {+ editorState.service.keyboardService?.closeKeyboard();+ // delay the bottom sheet show to make sure the keyboard is closed+ Future.delayed(Durations.short3, () {+ _showTableActionBottomSheet(context);+ });+ },child: Container(width: 20,height: 20,@@ -431,6 +438,9 @@ class SimpleTableActionMenu extends StatelessWidget {return;}+ // increase the keep editor focus notifier to prevent the editor from losing focus+ keepEditorFocusNotifier.increase();+unawaited(editorState.updateSelectionWithReason(Selection.collapsed(@@ -439,6 +449,10 @@ class SimpleTableActionMenu extends StatelessWidget {),),customSelectionType: SelectionType.block,+ extraInfo: {+ selectionExtraInfoDisableMobileToolbarKey: true,+ selectionExtraInfoDoNotAttachTextService: true,+ },),);@@ -465,5 +479,10 @@ class SimpleTableActionMenu extends StatelessWidget {);simpleTableContext.isSelectingTable.value = false;+ keepEditorFocusNotifier.decrease();++ // remove the extra info+ editorState.selectionType = null;+ editorState.selectionExtraInfo = null;}}diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_action_sheet.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_action_sheet.dartindex 0bfa576314..fe19b53977 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_action_sheet.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_action_sheet.dart@@ -1,5 +1,6 @@import 'package:appflowy/mobile/presentation/bottom_sheet/show_mobile_bottom_sheet.dart';import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table.dart';+import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_feedback.dart';import 'package:appflowy_editor/appflowy_editor.dart';import 'package:flutter/material.dart';import 'package:provider/provider.dart';@@ -7,7 +8,7 @@ import 'package:provider/provider.dart';class SimpleTableMobileDraggableReorderButton extends StatelessWidget {const SimpleTableMobileDraggableReorderButton({super.key,- required this.node,+ required this.cellNode,required this.index,required this.isShowingMenu,required this.type,@@ -15,7 +16,7 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {required this.simpleTableContext,});- final Node node;+ final Node cellNode;final int index;final ValueNotifier<bool> isShowingMenu;final SimpleTableMoreActionType type;@@ -31,20 +32,23 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {onDragEnd: (_) => _stopDragging(),feedback: SimpleTableFeedback(editorState: editorState,- node: node,+ node: cellNode,type: type,index: index,),child: SimpleTableMobileReorderButton(index: index,type: type,- node: node,+ node: cellNode,isShowingMenu: isShowingMenu,),);}void _startDragging() {+ isShowingMenu.value = true;+ editorState.selection = null;+switch (type) {case SimpleTableMoreActionType.column:simpleTableContext.isReorderingColumn.value = (true, index);@@ -59,6 +63,8 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {}void _stopDragging() {+ isShowingMenu.value = false;+switch (type) {case SimpleTableMoreActionType.column:_reorderColumn();@@ -67,6 +73,8 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {}simpleTableContext.reorderingOffset.value = Offset.zero;+ simpleTableContext.isReorderingHitIndex.value = null;+switch (type) {case SimpleTableMoreActionType.column:simpleTableContext.isReorderingColumn.value = (false, -1);@@ -79,13 +87,13 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {void _reorderColumn() {final fromIndex = simpleTableContext.isReorderingColumn.value.$2;- final toIndex = simpleTableContext.hoveringTableCell.value?.columnIndex;+ final toIndex = simpleTableContext.isReorderingHitIndex.value;if (toIndex == null) {return;}editorState.reorderColumn(- node,+ cellNode,fromIndex: fromIndex,toIndex: toIndex,);@@ -93,13 +101,13 @@ class SimpleTableMobileDraggableReorderButton extends StatelessWidget {void _reorderRow() {final fromIndex = simpleTableContext.isReorderingRow.value.$2;- final toIndex = simpleTableContext.hoveringTableCell.value?.rowIndex;+ final toIndex = simpleTableContext.isReorderingHitIndex.value;if (toIndex == null) {return;}editorState.reorderRow(- node,+ cellNode,fromIndex: fromIndex,toIndex: toIndex,);diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dartindex bc9f5b1909..e241f8bf72 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dart@@ -2,6 +2,7 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_tabimport 'package:appflowy_editor/appflowy_editor.dart';import 'package:flutter/material.dart';import 'package:provider/provider.dart';+import 'package:universal_platform/universal_platform.dart';class SimpleTableBorderBuilder {SimpleTableBorderBuilder({@@ -15,7 +16,9 @@ class SimpleTableBorderBuilder {final Node node;/// Build the border for the cell.- Border? buildBorder({bool isEditingCell = false}) {+ Border? buildBorder({+ bool isEditingCell = false,+ }) {if (SimpleTableConstants.borderType != SimpleTableBorderRenderType.cell) {return null;}@@ -28,24 +31,16 @@ class SimpleTableBorderBuilder {final isCellInSelectedRow =node.rowIndex == simpleTableContext.selectingRow.value;- // check if the cell is in the hovering column- final isCellInHoveringColumn =- simpleTableContext.hoveringTableCell.value?.columnIndex ==- node.columnIndex;-- final isCellInHoveringRow =- simpleTableContext.hoveringTableCell.value?.rowIndex == node.rowIndex;-- // check if the cell is in the reordering column- final isReordering = simpleTableContext.isReordering;+ final isReordering = simpleTableContext.isReordering &&+ (simpleTableContext.isReorderingColumn.value.$1 ||+ simpleTableContext.isReorderingRow.value.$1);final editorState = context.read<EditorState>();final editable = editorState.editable;if (!editable) {return buildCellBorder();- } else if (isReordering &&- (isCellInHoveringColumn || isCellInHoveringRow)) {+ } else if (isReordering) {return buildReorderingBorder();} else if (simpleTableContext.isSelectingTable.value) {return buildSelectingTableBorder();@@ -175,9 +170,21 @@ class SimpleTableBorderBuilder {return buildCellBorder();}- final hoveringTableCell = simpleTableContext.hoveringTableCell.value;+ bool isHitCurrentCell = false;++ if (UniversalPlatform.isDesktop) {+ // On desktop, we use the dragging column index to determine the highlight border+ // Check if the hovering table cell column index hit the current node column index+ isHitCurrentCell =+ simpleTableContext.hoveringTableCell.value?.columnIndex ==+ node.columnIndex;+ } else if (UniversalPlatform.isMobile) {+ // On mobile, we use the isReorderingHitIndex to determine the highlight border+ isHitCurrentCell =+ simpleTableContext.isReorderingHitIndex.value == node.columnIndex;+ }+// if the hovering column is not the current column, don't show the highlight border- final isHitCurrentCell = hoveringTableCell?.columnIndex == node.columnIndex;if (!isHitCurrentCell) {return buildCellBorder();}@@ -214,12 +221,24 @@ class SimpleTableBorderBuilder {return buildCellBorder();}- final hoveringTableCell = simpleTableContext.hoveringTableCell.value;- final isHitCurrentCell = hoveringTableCell?.rowIndex == node.rowIndex;+ bool isHitCurrentCell = false;++ if (UniversalPlatform.isDesktop) {+ // On desktop, we use the dragging row index to determine the highlight border+ // Check if the hovering table cell row index hit the current node row index+ isHitCurrentCell =+ simpleTableContext.hoveringTableCell.value?.rowIndex == node.rowIndex;+ } else if (UniversalPlatform.isMobile) {+ // On mobile, we use the isReorderingHitIndex to determine the highlight border+ isHitCurrentCell =+ simpleTableContext.isReorderingHitIndex.value == node.rowIndex;+ }+if (!isHitCurrentCell) {return buildCellBorder();}+ // For the row reordering, we only need to update the top and bottom borderfinal isTopSide =simpleTableContext.isReorderingRow.value.$2 > node.rowIndex;final isBottomSide =diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_feedback.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_feedback.dartnew file mode 100644index 0000000000..1e5a2cf6c0--- /dev/null+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_feedback.dart@@ -0,0 +1,128 @@+import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';+import 'package:appflowy_editor/appflowy_editor.dart';+import 'package:flutter/material.dart';+import 'package:provider/provider.dart';++class SimpleTableFeedback extends StatefulWidget {+ const SimpleTableFeedback({+ super.key,+ required this.editorState,+ required this.node,+ required this.type,+ required this.index,+ });++ /// The node of the table.+ /// Its type must be one of the following:+ /// [SimpleTableBlockKeys.type], [SimpleTableRowBlockKeys.type], [SimpleTableCellBlockKeys.type].+ final Node node;++ /// The type of the more action.+ ///+ /// If the type is [SimpleTableMoreActionType.column], the feedback will use index as column index.+ /// If the type is [SimpleTableMoreActionType.row], the feedback will use index as row index.+ final SimpleTableMoreActionType type;++ /// The index of the column or row.+ final int index;++ final EditorState editorState;++ @override+ State<SimpleTableFeedback> createState() => _SimpleTableFeedbackState();+}++class _SimpleTableFeedbackState extends State<SimpleTableFeedback> {+ final simpleTableContext = SimpleTableContext();+ late final Node dummyNode;++ @override+ void initState() {+ super.initState();++ assert(+ [+ SimpleTableBlockKeys.type,+ SimpleTableRowBlockKeys.type,+ SimpleTableCellBlockKeys.type,+ ].contains(widget.node.type),+ 'The node type must be one of the following: '+ '[SimpleTableBlockKeys.type], [SimpleTableRowBlockKeys.type], [SimpleTableCellBlockKeys.type].',+ );++ simpleTableContext.isSelectingTable.value = true;+ dummyNode = _buildDummyNode();+ }++ @override+ void dispose() {+ simpleTableContext.dispose();+ dummyNode.dispose();++ super.dispose();+ }++ @override+ Widget build(BuildContext context) {+ return Provider.value(+ value: widget.editorState,+ child: SimpleTableWidget(+ node: dummyNode,+ simpleTableContext: simpleTableContext,+ enableAddColumnButton: false,+ enableAddRowButton: false,+ enableAddColumnAndRowButton: false,+ enableHoverEffect: false,+ isFeedback: true,+ ),+ );+ }++ /// Build the dummy node for the feedback.+ ///+ /// For example,+ ///+ /// If the type is [SimpleTableMoreActionType.row], we should build the dummy table node using the data from the first row of the table node.+ /// If the type is [SimpleTableMoreActionType.column], we should build the dummy table node using the data from the first column of the table node.+ Node _buildDummyNode() {+ // deep copy the table node to avoid mutating the original node+ final tableNode = widget.node.parentTableNode?.deepCopy();+ if (tableNode == null) {+ return simpleTableBlockNode(children: []);+ }++ switch (widget.type) {+ case SimpleTableMoreActionType.row:+ if (widget.index >= tableNode.rowLength || widget.index < 0) {+ return simpleTableBlockNode(children: []);+ }++ final row = tableNode.children[widget.index];+ return tableNode.copyWith(+ children: [row],+ attributes: {+ ...tableNode.attributes,+ if (widget.index != 0) SimpleTableBlockKeys.enableHeaderRow: false,+ },+ );+ case SimpleTableMoreActionType.column:+ if (widget.index >= tableNode.columnLength || widget.index < 0) {+ return simpleTableBlockNode(children: []);+ }++ final rows = tableNode.children.map((row) {+ final cell = row.children[widget.index];+ return simpleTableRowBlockNode(children: [cell]);+ }).toList();++ return tableNode.copyWith(+ children: rows,+ attributes: {+ ...tableNode.attributes,+ if (widget.index != 0)+ SimpleTableBlockKeys.enableHeaderColumn: false,+ },+ );+ }+ }+}diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dartindex 21369395c0..bb87196051 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dart@@ -1,8 +1,8 @@import 'package:appflowy/generated/flowy_svgs.g.dart';import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';+import 'package:appflowy/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_feedback.dart';import 'package:appflowy_editor/appflowy_editor.dart';import 'package:flutter/material.dart';-import 'package:provider/provider.dart';class SimpleTableDraggableReorderButton extends StatelessWidget {const SimpleTableDraggableReorderButton({@@ -66,6 +66,7 @@ class SimpleTableDraggableReorderButton extends StatelessWidget {}simpleTableContext.reorderingOffset.value = Offset.zero;+switch (type) {case SimpleTableMoreActionType.column:simpleTableContext.isReorderingColumn.value = (false, -1);@@ -145,113 +146,3 @@ class SimpleTableReorderButton extends StatelessWidget {);}}--class SimpleTableFeedback extends StatefulWidget {- const SimpleTableFeedback({- super.key,- required this.editorState,- required this.node,- required this.type,- required this.index,- });-- /// The node of the table.- /// Its type must be [SimpleTableBlockKeys.type].- final Node node;-- /// The type of the more action.- ///- /// If the type is [SimpleTableMoreActionType.column], the feedback will use index as column index.- /// If the type is [SimpleTableMoreActionType.row], the feedback will use index as row index.- final SimpleTableMoreActionType type;-- /// The index of the column or row.- final int index;-- final EditorState editorState;-- @override- State<SimpleTableFeedback> createState() => _SimpleTableFeedbackState();-}--class _SimpleTableFeedbackState extends State<SimpleTableFeedback> {- final simpleTableContext = SimpleTableContext();- late final Node dummyNode;-- @override- void initState() {- super.initState();-- simpleTableContext.isSelectingTable.value = true;- dummyNode = _buildDummyNode();- }-- @override- void dispose() {- simpleTableContext.dispose();- dummyNode.dispose();-- super.dispose();- }-- @override- Widget build(BuildContext context) {- return Provider.value(- value: widget.editorState,- child: SimpleTableWidget(- node: dummyNode,- simpleTableContext: simpleTableContext,- enableAddColumnButton: false,- enableAddRowButton: false,- enableAddColumnAndRowButton: false,- enableHoverEffect: false,- isFeedback: true,- ),- );- }-- /// Build the dummy node for the feedback.- ///- /// For example,- ///- /// If the type is [SimpleTableMoreActionType.row], we should build the dummy table node using the data from the first row of the table node.- /// If the type is [SimpleTableMoreActionType.column], we should build the dummy table node using the data from the first column of the table node.- Node _buildDummyNode() {- // deep copy the table node to avoid mutating the original node- final tableNode = widget.node.deepCopy();-- switch (widget.type) {- case SimpleTableMoreActionType.row:- if (widget.index >= tableNode.rowLength || widget.index < 0) {- return simpleTableBlockNode(children: []);- }-- final row = tableNode.children[widget.index];- return tableNode.copyWith(- children: [row],- attributes: {- ...tableNode.attributes,- if (widget.index != 0) SimpleTableBlockKeys.enableHeaderRow: false,- },- );- case SimpleTableMoreActionType.column:- if (widget.index >= tableNode.columnLength || widget.index < 0) {- return simpleTableBlockNode(children: []);- }-- final rows = tableNode.children.map((row) {- final cell = row.children[widget.index];- return simpleTableRowBlockNode(children: [cell]);- }).toList();-- return tableNode.copyWith(- children: rows,- attributes: {- ...tableNode.attributes,- if (widget.index != 0)- SimpleTableBlockKeys.enableHeaderColumn: false,- },- );- }- }-}diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dartindex 24287ad411..94f4c6c8d5 100644--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_style.dart@@ -42,12 +42,15 @@ class EditorStyleCustomizer {static const double minDocumentWidth = 480;static EdgeInsets get documentPadding => UniversalPlatform.isMobile- ? const EdgeInsets.symmetric(horizontal: 24)+ ? EdgeInsets.zero: EdgeInsets.only(left: 40,right: 40 + EditorStyleCustomizer.optionMenuWidth,);+ static double get nodeHorizontalPadding =>+ UniversalPlatform.isMobile ? 24 : 0;+static EdgeInsets get documentPaddingWithOptionMenu =>documentPadding + EdgeInsets.only(left: optionMenuWidth);