[PR #3385] [CLOSED] fix: make toggle list shortcut customizable and sort shortcuts #5707

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

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/3385
Author: @MayurSMahajan
Created: 9/12/2023
Status: Closed

Base: mainHead: chore_sort_shortcuts_list


📝 Commits (5)

  • 1ef9439 refactor: barrel files in copy and paste plugin
  • dc4e850 chore: sort by making commands lowercase
  • c46538f Merge remote-tracking branch 'upstream/main' into chore_sort_shortcuts_list
  • 8482ef8 refactor: remove cut copy paste from editor
  • de7cb5f Merge remote-tracking branch 'origin/main' into chore_sort_shortcuts_list

📊 Changes

16 files changed (+35 additions, -25 deletions)

View changed files

📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart (+6 -10)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart (+1 -1)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/commands.dart (+4 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/copy_and_paste_commands.dart (+8 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_copy_command.dart (+0 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_cut_command.dart (+2 -2)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_paste_command.dart (+1 -5)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/copy_and_paste_plugin.dart (+2 -0)
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/editor_state_extensions.dart (+5 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_html.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_image.dart (+0 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_in_app_json.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_plain_text.dart (+1 -1)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_node_extension.dart (+0 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart (+1 -3)
📝 frontend/appflowy_flutter/lib/workspace/application/settings/shortcuts/settings_shortcuts_cubit.dart (+2 -1)

📄 Description

Solves #3384

  • This PR addresses the bug of not being able to customize or reset the toggle shortcut.

  • For customizing shortcuts, we keep a commandShortcutEvents outside of the _AppFlowyEditorPageState class, this list of shortcuts is copied into defaultCommandShortcutEvents. But in recent PRs, a new commandShortcutEvents was added inside the _AppFlowyEditorPageState class. This resulted in two separate commandShortcutEvents. Like so:

  • This PR aims at refactoring the folder structure of the copy-and-paste editor plugin. It introduces some new folders and barrel files. I hope this makes the entire plugin a bit easier to read and navigate.

  • This PR also improves the sort logic, by making the shortcuts lowercase before sorting them.

Feature Preview


PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • 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.

Note: The branch name is rather confusing, please ignore.


🔄 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/3385 **Author:** [@MayurSMahajan](https://github.com/MayurSMahajan) **Created:** 9/12/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `chore_sort_shortcuts_list` --- ### 📝 Commits (5) - [`1ef9439`](https://github.com/AppFlowy-IO/AppFlowy/commit/1ef94393993007e4469acb9d19c80050fbafd04f) refactor: barrel files in copy and paste plugin - [`dc4e850`](https://github.com/AppFlowy-IO/AppFlowy/commit/dc4e850fa42b6a3df1e2ff0053779c420ce3ca19) chore: sort by making commands lowercase - [`c46538f`](https://github.com/AppFlowy-IO/AppFlowy/commit/c46538feaa59bfb9c8a232f6d2f7c5e7be0df3c1) Merge remote-tracking branch 'upstream/main' into chore_sort_shortcuts_list - [`8482ef8`](https://github.com/AppFlowy-IO/AppFlowy/commit/8482ef8cc42dfa9e6f693de714dec8c729225dda) refactor: remove cut copy paste from editor - [`de7cb5f`](https://github.com/AppFlowy-IO/AppFlowy/commit/de7cb5f04c9e5c31d7d67ef200e8f24e1d849843) Merge remote-tracking branch 'origin/main' into chore_sort_shortcuts_list ### 📊 Changes **16 files changed** (+35 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_page.dart` (+6 -10) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart` (+1 -1) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/commands.dart` (+4 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/copy_and_paste_commands.dart` (+8 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_copy_command.dart` (+0 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_cut_command.dart` (+2 -2) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/commands/custom_paste_command.dart` (+1 -5) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/copy_and_paste_plugin.dart` (+2 -0) ➕ `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/editor_state_extensions.dart` (+5 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_html.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_image.dart` (+0 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_in_app_json.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_from_plain_text.dart` (+1 -1) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/copy_and_paste/editor_state_extensions/paste_node_extension.dart` (+0 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/plugins.dart` (+1 -3) 📝 `frontend/appflowy_flutter/lib/workspace/application/settings/shortcuts/settings_shortcuts_cubit.dart` (+2 -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). --> Solves #3384 - This PR addresses the bug of not being able to customize or reset the toggle shortcut. - For customizing shortcuts, we keep a `commandShortcutEvents` outside of the `_AppFlowyEditorPageState` class, this list of shortcuts is copied into `defaultCommandShortcutEvents`. But in recent PRs, a new `commandShortcutEvents` was added inside the `_AppFlowyEditorPageState` class. This resulted in two separate `commandShortcutEvents`. Like so: - This PR aims at refactoring the folder structure of the copy-and-paste editor plugin. It introduces some new folders and barrel files. I hope this makes the entire plugin a bit easier to read and navigate. - This PR also improves the sort logic, by making the shortcuts lowercase before sorting them. <!--- 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 <!--- 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 the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [x] 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. - [x] All existing tests are passing. Note: The branch name is rather confusing, please ignore. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:19:56 +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#5707
No description provided.