[PR #6598] [MERGED] feat: support toggle heading #7485

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

📋 Pull Request Information

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

Base: mainHead: toggle_heading


📝 Commits (10+)

  • 978126b feat: support toggle heading
  • 1de6b86 feat: add numbered list shortcut and heading shortcut
  • 4715422 feat: update format greater to toggle list shortcut
  • 70f5757 feat: add removeToggleHeadingStyle shortcut
  • d130d7f feat: add toggle list and toggle headings in turn into menu
  • 6239664 feat: turn into toggle heading block
  • 1b6129e feat: highlight selected toggle heading
  • 0288cb2 fix: collapsed button animation
  • d9a33fc test: turn heading block to toggle heading block
  • 8922a9f test: turn toggle heading block to heading block

📊 Changes

24 files changed (+1149 additions, -66 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_2.dart (+4 -1)
frontend/appflowy_flutter/integration_test/desktop/document/document_with_toggle_heading_block_test.dart (+82 -0)
📝 frontend/appflowy_flutter/integration_test/desktop/document/document_with_toggle_list_test.dart (+49 -0)
📝 frontend/appflowy_flutter/integration_test/shared/common_operations.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/core/network_monitor.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart (+41 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart (+4 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart (+104 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/option_actions.dart (+1 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart (+52 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/character_shortcuts.dart (+7 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/command_shortcuts.dart (+1 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/heading_block_shortcuts.dart (+50 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/numbered_list_block_shortcuts.dart (+95 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items.dart (+56 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toggle/toggle_block_component.dart (+119 -43)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toggle/toggle_block_shortcuts.dart (+164 -7)
📝 frontend/appflowy_flutter/lib/shared/patterns/common_patterns.dart (+3 -0)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart (+1 -1)

...and 4 more files

📄 Description

Feature Preview

desktop

https://github.com/user-attachments/assets/3fc64b2a-2d64-44f7-bf15-6cffe3a5518e

mobile

Screenshot 2024-10-23 at 15 44 48
  • support toggle heading block
    • desktop
    • mobile
  • add toggle heading 1-3 into slash menu
  • reuse the heading block style builder to customize toggle heading block
  • turn into
    • other block types -> toggle list or toggle heading
    • toggle list or toggle heading -> other block types
    • add toggle list and toggle heading 1-3 into turn into menu
  • shortcuts
    • disable number markdown syntax in toggle heading block
    • '>' + '#' to toggle heading block
    • '#' + '>' to toggle heading block
    • press backspace in toggle heading block should remove the level first
  • undo & redo
  • tests

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/6598 **Author:** [@LucasXu0](https://github.com/LucasXu0) **Created:** 10/22/2024 **Status:** ✅ Merged **Merged:** 10/23/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `toggle_heading` --- ### 📝 Commits (10+) - [`978126b`](https://github.com/AppFlowy-IO/AppFlowy/commit/978126b3a8cfd5c31decf7c0c95ba6aee292f766) feat: support toggle heading - [`1de6b86`](https://github.com/AppFlowy-IO/AppFlowy/commit/1de6b86df6e6c89eda6031176727be702784817e) feat: add numbered list shortcut and heading shortcut - [`4715422`](https://github.com/AppFlowy-IO/AppFlowy/commit/47154223096768c72aaad33933352e5667cab1d7) feat: update format greater to toggle list shortcut - [`70f5757`](https://github.com/AppFlowy-IO/AppFlowy/commit/70f5757175cbe9689d24397b25b460337e9aa941) feat: add removeToggleHeadingStyle shortcut - [`d130d7f`](https://github.com/AppFlowy-IO/AppFlowy/commit/d130d7fc5db02fdda26eda3117ae5ec619bc4065) feat: add toggle list and toggle headings in turn into menu - [`6239664`](https://github.com/AppFlowy-IO/AppFlowy/commit/62396642911d7ee01b679422a23fef26cceb8563) feat: turn into toggle heading block - [`1b6129e`](https://github.com/AppFlowy-IO/AppFlowy/commit/1b6129e678af24e12c8fed3912163f7bf4367614) feat: highlight selected toggle heading - [`0288cb2`](https://github.com/AppFlowy-IO/AppFlowy/commit/0288cb2bafafe5cf8734f87109b0c975042db86e) fix: collapsed button animation - [`d9a33fc`](https://github.com/AppFlowy-IO/AppFlowy/commit/d9a33fc8b5b3052b69fcdeb256934e630c9bac55) test: turn heading block to toggle heading block - [`8922a9f`](https://github.com/AppFlowy-IO/AppFlowy/commit/8922a9fe495260861f5a48f2794766ec868729e8) test: turn toggle heading block to heading block ### 📊 Changes **24 files changed** (+1149 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_test_runner_2.dart` (+4 -1) ➕ `frontend/appflowy_flutter/integration_test/desktop/document/document_with_toggle_heading_block_test.dart` (+82 -0) 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_with_toggle_list_test.dart` (+49 -0) 📝 `frontend/appflowy_flutter/integration_test/shared/common_operations.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/core/network_monitor.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_configuration.dart` (+41 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart` (+4 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/block_action_option_cubit.dart` (+104 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/option_actions.dart` (+1 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/actions/option/turn_into_option_action.dart` (+52 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/character_shortcuts.dart` (+7 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/command_shortcuts.dart` (+1 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/heading_block_shortcuts.dart` (+50 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/shortcuts/numbered_list_block_shortcuts.dart` (+95 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/slash_menu/slash_menu_items.dart` (+56 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toggle/toggle_block_component.dart` (+119 -43) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toggle/toggle_block_shortcuts.dart` (+164 -7) 📝 `frontend/appflowy_flutter/lib/shared/patterns/common_patterns.dart` (+3 -0) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_shortcuts_view.dart` (+1 -1) _...and 4 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 desktop https://github.com/user-attachments/assets/3fc64b2a-2d64-44f7-bf15-6cffe3a5518e mobile <img width="542" alt="Screenshot 2024-10-23 at 15 44 48" src="https://github.com/user-attachments/assets/a086473a-f1c2-4777-95d1-3fbe9f54c328"> - [x] support toggle heading block - [x] desktop - [x] mobile - [x] add toggle heading 1-3 into slash menu - [x] reuse the heading block style builder to customize toggle heading block - [x] turn into - [x] other block types -> toggle list or toggle heading - [x] toggle list or toggle heading -> other block types - [x] add toggle list and toggle heading 1-3 into turn into menu - [x] shortcuts - [x] disable number markdown syntax in toggle heading block - [x] '>' + '#' to toggle heading block - [x] '#' + '>' to toggle heading block - [x] press backspace in toggle heading block should remove the level first - [x] undo & redo - [x] tests <!--- 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:19:51 +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#7485
No description provided.