[PR #7402] [MERGED] feat: support columns block in editor on desktop #7867

Closed
opened 2026-03-23 23:21:33 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7402
Author: @LucasXu0
Created: 2/20/2025
Status: Merged
Merged: 2/27/2025
Merged by: @LucasXu0

Base: mainHead: columns_block


📝 Commits (10+)

  • dc47a34 feat: support columns block in editor
  • ab4fd27 feat: upgrade simple columns block
  • 45b0268 fix: build error
  • fee7ac6 feat: add column width resizer
  • 3e96816 fix: drag visual border
  • ffd1a09 fix: drag button position issue
  • 938f940 feat: add rule to check if the column is empty
  • 395a4f2 fix: flutter analyze
  • 4e791c8 feat: add document rules to delete the columns if its children are empty
  • 60f728c feat: support adding image in columns block

📊 Changes

28 files changed (+1093 additions, -65 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/cloud/document/document_option_actions_test.dart (+1 -1)
📝 frontend/appflowy_flutter/integration_test/desktop/document/document_with_multi_image_block_test.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/mobile/presentation/selection_menu/mobile_selection_menu_item_widget.dart (+27 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/application/document_bloc.dart (+10 -34)
frontend/appflowy_flutter/lib/plugins/document/application/document_rules.dart (+118 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+34 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart (+1 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/draggable_option_button.dart (+52 -2)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart (+97 -12)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/visual_drag_area.dart (+29 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_block_component.dart (+194 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_block_width_resizer.dart (+124 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_node_extension.dart (+34 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_columns_block_component.dart (+224 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_columns_block_constant.dart (+6 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_copy_command.dart (+8 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart (+7 -3)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/columns_item.dart (+92 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items_builder.dart (+6 -0)

...and 8 more files

📄 Description

Feature Preview

  • define columns block type and builder
  • define column block type and builder
  • support mulitple columns blocks style
    • 2 columns
    • 3 columns
    • 4 columns
  • add columns block in slash menu
  • support dragging a block to the right side of another block to create a column
  • support resizing the column block width
  • adjust the + and ... button position
  • delete a column (users can delete the content inside the column one by one)
  • drag menu (the columns block or column block don't support the drag menu)
  • unable to render image on columns
  • integrate the columns block and column block in editor
    • 2 columns
    • 3 columns
    • 4 columns
Known issues

Fix in the another PR

  • unable to use keyboard to navigate across the columns
  • the image doesnt render properly in column block

Use cases

Screenshot 2025-02-21 at 17 51 03 Screenshot 2025-02-26 at 14 47 21

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/7402 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 2/20/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `columns_block` --- ### 📝 Commits (10+) - [`dc47a34`](https://github.com/AppFlowy-IO/AppFlowy/commit/dc47a3431272e1b1f0fb1c245f454393df570436) feat: support columns block in editor - [`ab4fd27`](https://github.com/AppFlowy-IO/AppFlowy/commit/ab4fd27c6ab315bd2ca42601da95e072c761515a) feat: upgrade simple columns block - [`45b0268`](https://github.com/AppFlowy-IO/AppFlowy/commit/45b026857af12db5e497b2b10c8457acff8c2def) fix: build error - [`fee7ac6`](https://github.com/AppFlowy-IO/AppFlowy/commit/fee7ac69a122230e98b4813e888549cb86a666ee) feat: add column width resizer - [`3e96816`](https://github.com/AppFlowy-IO/AppFlowy/commit/3e968160e12341f367d688f9ab6ba714b5d4c8f3) fix: drag visual border - [`ffd1a09`](https://github.com/AppFlowy-IO/AppFlowy/commit/ffd1a09eaaa92ac5c479c98208a2f900b5bab5a8) fix: drag button position issue - [`938f940`](https://github.com/AppFlowy-IO/AppFlowy/commit/938f940e45dd3fed34c371104495141c9d16ddec) feat: add rule to check if the column is empty - [`395a4f2`](https://github.com/AppFlowy-IO/AppFlowy/commit/395a4f2d5c2d040629a7267c9a9f82775a5afef9) fix: flutter analyze - [`4e791c8`](https://github.com/AppFlowy-IO/AppFlowy/commit/4e791c84a4019b85493041d59f74c618e5559a65) feat: add document rules to delete the columns if its children are empty - [`60f728c`](https://github.com/AppFlowy-IO/AppFlowy/commit/60f728cf5c8e9f5d23072e36dbee6e08468ddd38) feat: support adding image in columns block ### 📊 Changes **28 files changed** (+1093 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/cloud/document/document_option_actions_test.dart` (+1 -1) 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_with_multi_image_block_test.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/mobile/presentation/selection_menu/mobile_selection_menu_item_widget.dart` (+27 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/application/document_bloc.dart` (+10 -34) ➕ `frontend/appflowy_flutter/lib/plugins/document/application/document_rules.dart` (+118 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+34 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_button.dart` (+1 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/draggable_option_button.dart` (+52 -2) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/util.dart` (+97 -12) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/visual_drag_area.dart` (+29 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_block_component.dart` (+194 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_block_width_resizer.dart` (+124 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_column_node_extension.dart` (+34 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_columns_block_component.dart` (+224 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/columns/simple_columns_block_constant.dart` (+6 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/custom_copy_command.dart` (+8 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart` (+7 -3) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/columns_item.dart` (+92 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items/slash_menu_items.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items_builder.dart` (+6 -0) _...and 8 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] define columns block type and builder - [x] define column block type and builder - [x] support mulitple columns blocks style - [x] 2 columns - [x] 3 columns - [x] 4 columns - [x] add columns block in slash menu - [x] support dragging a block to the right side of another block to create a column - [x] support resizing the column block width - [x] adjust the + and ... button position - [x] delete a column (users can delete the content inside the column one by one) - [x] drag menu (the columns block or column block don't support the drag menu) - [x] unable to render image on columns - [x] integrate the columns block and column block in editor - [x] 2 columns - [x] 3 columns - [x] 4 columns ##### Known issues Fix in the another PR - [ ] unable to use keyboard to navigate across the columns - [ ] the image doesnt render properly in column block Use cases <img width="1497" alt="Screenshot 2025-02-21 at 17 51 03" src="https://github.com/user-attachments/assets/9a369342-6975-473c-a5d8-30b907f35961" /> <img width="1960" alt="Screenshot 2025-02-26 at 14 47 21" src="https://github.com/user-attachments/assets/27855d53-8549-4226-9ebb-f33731c3ab00" /> <!--- 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. - [ ] 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:21:33 +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#7867
No description provided.