[PR #6912] [MERGED] feat: support column and row reordering in tables #7634

Closed
opened 2026-03-23 23:20:31 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/6912
Author: @LucasXu0
Created: 12/3/2024
Status: Merged
Merged: 12/6/2024
Merged by: @LucasXu0

Base: mainHead: feat/reorder_table


📝 Commits (10+)

  • 893049c chore: update changelog
  • 60d7bf7 feat: add draggable in table reorder button
  • 1ab5dc4 feat: support displaying text color, background color and font item in table cell
  • 3177a18 Merge branch 'release/0.7.7' into feat/reorder_table
  • 5a9393b feat: separate gestures for popup menu and drag operations
  • dae7bbc Merge branch 'main' into feat/reorder_table
  • 5c05e65 feat: support feedback mode for table
  • 0b1e2e8 feat: build dummy node to render table feedback
  • d8c5409 feat: disable column resize handle when dragging column
  • e50eae1 feat: higtlight the cell border when dragging

📊 Changes

16 files changed (+1887 additions, -494 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/text_robot.dart (+1 -7)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/_shared_widget.dart (+0 -133)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dart (+14 -114)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dart (+37 -158)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dart (+58 -22)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dart (+96 -58)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_map_operation.dart (+335 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_node_extension.dart (+15 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_operations.dart (+1 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_reorder_operation.dart (+120 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dart (+247 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_column_resize_handle.dart (+110 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dart (+258 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_widget.dart (+195 -0)
frontend/appflowy_flutter/test/unit_test/simple_table/simple_table_reorder_operation_test.dart (+335 -0)
📝 frontend/appflowy_flutter/test/unit_test/simple_table/simple_table_test_helper.dart (+65 -1)

📄 Description

Feature Preview

  • reorder
    • reorder column transaction
    • reorder row transaction
    • render the feedback
      • column
      • row
      • border
      • build the dummy node based on the selected column or row from the existing table node
    • highlight the cell border when dragging
      • column
        • if the dragging column index > current index, show the border on the right side
        • if the dragging column < current index, show the border on the left side
      • row
        • if the dragging row < current index, show the border on the bottom side
        • if the dragging row > current index, show the border on the top side
    • separate gestures for popup menu and drag operations
    • disable resize handle when dragging the column
  • test

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/6912 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 12/3/2024 **Status:** ✅ Merged **Merged:** 12/6/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `feat/reorder_table` --- ### 📝 Commits (10+) - [`893049c`](https://github.com/AppFlowy-IO/AppFlowy/commit/893049c13e3200d7d0fd051b561f51381eceb073) chore: update changelog - [`60d7bf7`](https://github.com/AppFlowy-IO/AppFlowy/commit/60d7bf76fb8fa448158d5d4c33f90dd2e7bf34a3) feat: add draggable in table reorder button - [`1ab5dc4`](https://github.com/AppFlowy-IO/AppFlowy/commit/1ab5dc4c7d36ee324499367b265c7294cbec911a) feat: support displaying text color, background color and font item in table cell - [`3177a18`](https://github.com/AppFlowy-IO/AppFlowy/commit/3177a18a9de25b833057b9ab8db171fea29d60d7) Merge branch 'release/0.7.7' into feat/reorder_table - [`5a9393b`](https://github.com/AppFlowy-IO/AppFlowy/commit/5a9393bc6734e735b2d50fa5cfe636054ea8d439) feat: separate gestures for popup menu and drag operations - [`dae7bbc`](https://github.com/AppFlowy-IO/AppFlowy/commit/dae7bbc1ce2c19b425c90314e288200e02bcae5e) Merge branch 'main' into feat/reorder_table - [`5c05e65`](https://github.com/AppFlowy-IO/AppFlowy/commit/5c05e6520e888a48b0af4ecec0361082ec9fe621) feat: support feedback mode for table - [`0b1e2e8`](https://github.com/AppFlowy-IO/AppFlowy/commit/0b1e2e844cf176dd51392716cc21641fd669f8f1) feat: build dummy node to render table feedback - [`d8c5409`](https://github.com/AppFlowy-IO/AppFlowy/commit/d8c54094be007e174cfbea8b0142a061ff3e0849) feat: disable column resize handle when dragging column - [`e50eae1`](https://github.com/AppFlowy-IO/AppFlowy/commit/e50eae14232bbc6dd626bb286c5a2ab1f073df1e) feat: higtlight the cell border when dragging ### 📊 Changes **16 files changed** (+1887 additions, -494 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/base/text_robot.dart` (+1 -7) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/_shared_widget.dart` (+0 -133) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_block_component.dart` (+14 -114) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_cell_block_component.dart` (+37 -158) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_constants.dart` (+58 -22) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_more_action.dart` (+96 -58) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_map_operation.dart` (+335 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_node_extension.dart` (+15 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_operations.dart` (+1 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_operations/simple_table_reorder_operation.dart` (+120 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_border_builder.dart` (+247 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_column_resize_handle.dart` (+110 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_reorder_button.dart` (+258 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/simple_table/simple_table_widgets/simple_table_widget.dart` (+195 -0) ➕ `frontend/appflowy_flutter/test/unit_test/simple_table/simple_table_reorder_operation_test.dart` (+335 -0) 📝 `frontend/appflowy_flutter/test/unit_test/simple_table/simple_table_test_helper.dart` (+65 -1) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview - [x] reorder - [x] reorder column transaction - [x] reorder row transaction - [x] render the feedback - [x] column - [x] row - [x] border - [x] build the dummy node based on the selected column or row from the existing table node - [x] highlight the cell border when dragging - [x] column - [x] if the dragging column index > current index, show the border on the right side - [x] if the dragging column < current index, show the border on the left side - [x] row - [x] if the dragging row < current index, show the border on the bottom side - [x] if the dragging row > current index, show the border on the top side - [x] separate gestures for popup menu and drag operations - [x] disable resize handle when dragging the column - [x] test <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:20:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#7634
No description provided.