[PR #6558] [MERGED] feat: turn into multiple lines #7455

Closed
opened 2026-03-23 23:19:42 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/6558
Author: @LucasXu0
Created: 10/16/2024
Status: Merged
Merged: 10/16/2024
Merged by: @LucasXu0

Base: mainHead: turn_into_multiple_lines


📝 Commits (10+)

  • e3a5005 feat: select multiple lines with block selection style
  • d0e6184 feat: multiple nodes conversion
  • 3e9c2e6 fix: exclude children for the block can't contain children
  • ac31960 chore: update editor version
  • dca5a2e fix: unit test
  • 9ed1666 test: convert nested list to heading/quote/callout
  • e64266b test: transform nodes at the same level into another block type
  • 278d733 test: add undo redo for turn into
  • 6842d82 test: add multi lines integration test
  • 8930815 chore: remove debug logs

📊 Changes

7 files changed (+526 additions, -159 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_option_action_test.dart (+47 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+5 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart (+46 -30)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/draggable_option_button.dart (+70 -20)
📝 frontend/appflowy_flutter/pubspec.lock (+8 -8)
📝 frontend/appflowy_flutter/pubspec.yaml (+3 -2)
📝 frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart (+347 -98)

📄 Description

Feature Preview

https://github.com/user-attachments/assets/165c1b4b-bc9f-4abb-9838-b72a9786cdea

  • select multiple lines with block selection style.
  • turn into multiple lines
  • a. take care of the blocks that are not allowed to have children, such as headings, quotes, and callouts, when turning them into...
    • nested list -> heading
    • nested list -> callout
    • nested list -> quote
  • b. Only transform nodes at the same level into another block type (not including their children, if they have any)
    • multiple nested list -> another block type
  • c. revert back
    • block -> block -> undo -> redo
    • nested list -> block -> undo -> redo
    • nested list with children - > block -> undo -> redo
  • known issues
    • update selection after turning block into another block
    • sometimes, block selection doesn't work
  • unit tests
    • a.
    • b.
    • c.
  • integration test
    • turn into multi lines

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/6558 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 10/16/2024 **Status:** ✅ Merged **Merged:** 10/16/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `turn_into_multiple_lines` --- ### 📝 Commits (10+) - [`e3a5005`](https://github.com/AppFlowy-IO/AppFlowy/commit/e3a50051490c72da78f205cc864130aedc741807) feat: select multiple lines with block selection style - [`d0e6184`](https://github.com/AppFlowy-IO/AppFlowy/commit/d0e6184ade22871d033cc149f026bb05382c55ec) feat: multiple nodes conversion - [`3e9c2e6`](https://github.com/AppFlowy-IO/AppFlowy/commit/3e9c2e6be78a319a7052d46297b21b4ff4cfc0b9) fix: exclude children for the block can't contain children - [`ac31960`](https://github.com/AppFlowy-IO/AppFlowy/commit/ac319602f1e067e726190bc48ae509a127f413ee) chore: update editor version - [`dca5a2e`](https://github.com/AppFlowy-IO/AppFlowy/commit/dca5a2e523b0243dc52562ad83c5e520e6acb603) fix: unit test - [`9ed1666`](https://github.com/AppFlowy-IO/AppFlowy/commit/9ed166652a7926cbfa934020dab580940ac61d03) test: convert nested list to heading/quote/callout - [`e64266b`](https://github.com/AppFlowy-IO/AppFlowy/commit/e64266b34433130a4987245e3d8694c28a3b5e40) test: transform nodes at the same level into another block type - [`278d733`](https://github.com/AppFlowy-IO/AppFlowy/commit/278d733264b1480e5c0be7e3507b27ab6563e6ee) test: add undo redo for turn into - [`6842d82`](https://github.com/AppFlowy-IO/AppFlowy/commit/6842d826b8061f537efeb46fda802e9cd9d1071d) test: add multi lines integration test - [`8930815`](https://github.com/AppFlowy-IO/AppFlowy/commit/8930815af7f7c1f958336516c82d6d0f8bc1bae5) chore: remove debug logs ### 📊 Changes **7 files changed** (+526 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_option_action_test.dart` (+47 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+5 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart` (+46 -30) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/drag_to_reorder/draggable_option_button.dart` (+70 -20) 📝 `frontend/appflowy_flutter/pubspec.lock` (+8 -8) 📝 `frontend/appflowy_flutter/pubspec.yaml` (+3 -2) 📝 `frontend/appflowy_flutter/test/unit_test/document/turn_into/turn_into_test.dart` (+347 -98) </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 https://github.com/user-attachments/assets/165c1b4b-bc9f-4abb-9838-b72a9786cdea - [x] select multiple lines with block selection style. - [x] turn into multiple lines - [x] a. take care of the blocks that are not allowed to have children, such as headings, quotes, and callouts, when turning them into... - [x] nested list -> heading - [x] nested list -> callout - [x] nested list -> quote - [x] b. Only transform nodes at the same level into another block type (not including their children, if they have any) - [x] multiple nested list -> another block type - [x] c. revert back - [x] block -> block -> undo -> redo - [x] nested list -> block -> undo -> redo - [x] nested list with children - > block -> undo -> redo - [ ] known issues - [ ] update selection after turning block into another block - [ ] sometimes, block selection doesn't work - [x] unit tests - [x] a. - [x] b. - [x] c. - [x] integration test - [x] turn into multi lines <!--- 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:19:42 +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#7455
No description provided.