[PR #6831] [MERGED] feat: simple table redesign #7597

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/6831
Author: @LucasXu0
Created: 11/19/2024
Status: Merged
Merged: 11/28/2024
Merged by: @LucasXu0

Base: mainHead: table_v2


📝 Commits (10+)

  • 3966af6 feat: define the simple table block data strucuture
  • e20c9ef fix: close keyboard when uploading file
  • d6b49e7 Merge branch 'main' into table_v2
  • c910163 feat: integrate a simple table
  • 06a72e0 feat: support selectable mixin for table
  • 4653345 feat: render border for table
  • 943b176 feat: support add column/row
  • bbefca9 feat: support add column and row
  • a03766f feat: support add column and row button
  • c545a96 feat: support table border and cell border

📊 Changes

53 files changed (+5719 additions, -22 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_4.dart (+3 -0)
frontend/appflowy_flutter/integration_test/desktop/document/document_with_simple_table_test.dart (+42 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/application/document_data_pb_extension.dart (+14 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+83 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/visual_drag_area.dart (+3 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_block_component.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/keyboard_interceptor/keyboard_interceptor.dart (+29 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/command_shortcuts.dart (+4 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items.dart (+37 -6)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shared_widget.dart (+633 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_down_command.dart (+81 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_left_command.dart (+19 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_right_command.dart (+19 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_up_command.dart (+77 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_backspace_command.dart (+33 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_commands.dart (+16 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_tab_command.dart (+35 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/table_command_extension.dart (+147 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/simple_table_block_component.dart (+361 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/simple_table_cell_block_component.dart (+397 -0)

...and 33 more files

📄 Description

Feature Preview

  • revamp the UI
    • table action menu
    • table cell border
    • option menu
    • render the border when selecting column or row
  • re-implement the logic
    • drag to resize the cell width
      • don't persist data while dragging
      • persist the data after drag ends
    • redefine the simple table structure
    • insert left (column)
      • update the column map (align, color)
    • insert right (column)
      • update the column map (align, color)
    • insert above (row)
      • update the row map (align, color)
    • insert below (row)
      • update the row map (align, color)
    • duplicate
      • column
        • content
        • color
        • align
      • row
        • content
        • color
        • align
    • clear content
    • delete (row)
      • update the column map (align, color)
    • delete (column)
      • update the column map (align, color)
    • align
      • column
      • row
    • color
      • column
      • row
    • header column
      • background color
      • bold
    • header row
      • background color
      • bold
    • shortcuts
      • arrow up/down/left/right
      • tab
      • backspace
      • delete
  • tests
    • delete operation
    • insert operation
    • update style operation
      • align
      • column width
      • background color
      • header column and header row
    • duplicate operation
    • clear content operation

Include the tasks below in another PR

  • integration tests
    • delete a row(column)
    • insert a row(column)
    • update style(background color, align, ...)
    • enable header column/row
    • delete the table
    • only one cell
  • issues
    • a magic space between two cells
      Screenshot 2024-11-21 at 18 09 44
      Screenshot 2024-11-21 at 22 06 34

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/6831 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 11/19/2024 **Status:** ✅ Merged **Merged:** 11/28/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `table_v2` --- ### 📝 Commits (10+) - [`3966af6`](https://github.com/AppFlowy-IO/AppFlowy/commit/3966af6ef5eac70e15bd36787aef769969edfba4) feat: define the simple table block data strucuture - [`e20c9ef`](https://github.com/AppFlowy-IO/AppFlowy/commit/e20c9ef9fe8dd1631a9f49594993d533ee7d0c95) fix: close keyboard when uploading file - [`d6b49e7`](https://github.com/AppFlowy-IO/AppFlowy/commit/d6b49e7df4dd65712f09292c5760827428dca69e) Merge branch 'main' into table_v2 - [`c910163`](https://github.com/AppFlowy-IO/AppFlowy/commit/c9101636098bf8079f8471dd2d558e2fe163a7ea) feat: integrate a simple table - [`06a72e0`](https://github.com/AppFlowy-IO/AppFlowy/commit/06a72e0357fc99b63631d6102aa3f5099ceb6281) feat: support selectable mixin for table - [`4653345`](https://github.com/AppFlowy-IO/AppFlowy/commit/465334521d54de31b4e4ff98d481137979ebbe77) feat: render border for table - [`943b176`](https://github.com/AppFlowy-IO/AppFlowy/commit/943b176109fc39b6a126c789bac8c541d02a2964) feat: support add column/row - [`bbefca9`](https://github.com/AppFlowy-IO/AppFlowy/commit/bbefca9f05b004808052fc01c3f8878c604916e9) feat: support add column and row - [`a03766f`](https://github.com/AppFlowy-IO/AppFlowy/commit/a03766f628aebc1fe57af7fce6d09e588ce3bbe5) feat: support add column and row button - [`c545a96`](https://github.com/AppFlowy-IO/AppFlowy/commit/c545a9686fe65e70e0a7e68ac12d78c7b3bdcddf) feat: support table border and cell border ### 📊 Changes **53 files changed** (+5719 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_4.dart` (+3 -0) ➕ `frontend/appflowy_flutter/integration_test/desktop/document/document_with_simple_table_test.dart` (+42 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/application/document_data_pb_extension.dart` (+14 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+83 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/visual_drag_area.dart` (+3 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/file/file_block_component.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/keyboard_interceptor/keyboard_interceptor.dart` (+29 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/command_shortcuts.dart` (+4 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items.dart` (+37 -6) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shared_widget.dart` (+633 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_down_command.dart` (+81 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_left_command.dart` (+19 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_right_command.dart` (+19 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_arrow_up_command.dart` (+77 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_backspace_command.dart` (+33 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_commands.dart` (+16 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/simple_table_tab_command.dart` (+35 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/shortcuts/table_command_extension.dart` (+147 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/simple_table_block_component.dart` (+361 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/table/simple_table_cell_block_component.dart` (+397 -0) _...and 33 more files_ </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] revamp the UI - [x] table action menu - [x] table cell border - [x] option menu - [x] render the border when selecting column or row - [x] re-implement the logic - [x] drag to resize the cell width - [x] don't persist data while dragging - [x] persist the data after drag ends - [x] redefine the simple table structure - [x] insert left (column) - [x] update the column map (align, color) - [x] insert right (column) - [x] update the column map (align, color) - [x] insert above (row) - [x] update the row map (align, color) - [x] insert below (row) - [x] update the row map (align, color) - [x] duplicate - [x] column - [x] content - [x] color - [x] align - [x] row - [x] content - [x] color - [x] align - [x] clear content - [x] delete (row) - [x] update the column map (align, color) - [x] delete (column) - [x] update the column map (align, color) - [x] align - [x] column - [x] row - [x] color - [x] column - [x] row - [x] header column - [x] background color - [x] bold - [x] header row - [x] background color - [x] bold - [x] shortcuts - [x] arrow up/down/left/right - [x] tab - [x] backspace - [x] delete - [x] tests - [x] delete operation - [x] insert operation - [x] update style operation - [x] align - [x] column width - [x] background color - [x] header column and header row - [x] duplicate operation - [x] clear content operation ## Include the tasks below in another PR - [ ] integration tests - [ ] delete a row(column) - [ ] insert a row(column) - [ ] update style(background color, align, ...) - [ ] enable header column/row - [ ] delete the table - [ ] only one cell - [ ] issues - [ ] a magic space between two cells <img width="40" alt="Screenshot 2024-11-21 at 18 09 44" src="https://github.com/user-attachments/assets/9f128594-fdaa-403b-b7a7-e384e8a8001f"> <img width="500" alt="Screenshot 2024-11-21 at 22 06 34" src="https://github.com/user-attachments/assets/1f036585-a396-4374-b766-bc631b7178e3"> <!--- 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) - [x] 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:22 +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#7597
No description provided.