AppFlowy
AppFlowy copied to clipboard
feat: customize command shortcuts
Feature Preview
https://github.com/AppFlowy-IO/AppFlowy/assets/47064215/d439c58a-d026-48d1-9f55-8c5427ceebe9
Solves #1882
PR Checklist
- [x] My code adheres to the AppFlowy Style Guide
- [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.
Codecov Report
Merging #2848 (45c5ed7) into main (0fb004a) will increase coverage by
0.13%
. The diff coverage is80.70%
.
@@ Coverage Diff @@
## main #2848 +/- ##
==========================================
+ Coverage 68.70% 68.84% +0.13%
==========================================
Files 426 430 +4
Lines 20241 20469 +228
==========================================
+ Hits 13907 14091 +184
- Misses 6334 6378 +44
Flag | Coverage Δ | |
---|---|---|
appflowy_flutter_integrateion_test | 65.80% <15.78%> (-0.57%) |
:arrow_down: |
appflowy_flutter_unit_test | 13.15% <73.24%> (+0.80%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
...ace/application/settings/settings_dialog_bloc.dart | 95.45% <ø> (ø) |
|
...rkspace/presentation/settings/settings_dialog.dart | 92.10% <0.00%> (-2.49%) |
:arrow_down: |
...ngs/widgets/settings_customize_shortcuts_view.dart | 71.68% <71.68%> (ø) |
|
...n/settings/shortcuts/settings_shortcuts_cubit.dart | 83.78% <83.78%> (ø) |
|
...settings/shortcuts/settings_shortcuts_service.dart | 91.17% <91.17%> (ø) |
|
...pplication/settings/shortcuts/shortcuts_model.dart | 92.30% <92.30%> (ø) |
|
...lib/plugins/document/presentation/editor_page.dart | 96.27% <100.00%> (+0.30%) |
:arrow_up: |
...e/presentation/settings/widgets/settings_menu.dart | 84.37% <100.00%> (+2.89%) |
:arrow_up: |
Should we retain this warning for this particular case(customizing the same shortcut for the event)?
![]()
Should we retain this warning for this particular case(customizing the same shortcut for the event)?
In my new changes, we simply ignore the user's request to assign the same keybinding to a shortcut.
Can we aim to release this feature by the end of next week?
Yes. I added reset to default
just now. cc @MayurSMahajan.
I found a new issue. Currently, you're using the standardCommandShortcutEvents
, but I changed it to commandShortcutEvents
, which includes the code block commands. However, when customizing the code block event, it will throw an exception because some events inside the code block are using the same command as the standardCommandShortcutEvents
.
Capitalize the first letter of each command
Questions:
- How can I delete a key binding / set to something else?
- How did command conflicts handle?
- Can there be visual clues to show which key bind belongs to which command? If my screen is large, it's hard to locate in the current design (shown in this screenshot)
- How is the list sorted? Can it be user friendly?
Capitalize the first letter of each command
Questions:
1. How can I delete a key binding / set to something else? 2. How did command conflicts handle? 3. Can there be visual clues to show which key bind belongs to which command? If my screen is large, it's hard to locate in the current design (shown in this screenshot) 4. How is the list sorted? Can it be user-friendly? 
-
There is no way to delete a key binding. You can assign a new KeyBinding by clicking on it and then typing the desired key combination you want. (Deleting a key binding is not possible since we don't allow our CommandShortcutEvents to be null.)
-
Command conflicts are handled by checking the type of command, i.e. is a command used for CodeBlock or not. The same keybinding can be used for one Codeblock shortcut and one non-Codeblock shortcut. However, you can not assign the same keybinding to two Codeblock shortcuts or two non-Codeblock shortcuts.
3 & 4. Let me submit a new commit addressing these issues.
I've added a divider after each command and keybinding, which makes it visually easy to know which command and keybinding belong to each other. We are also sorting the list of shortcuts alphabetically, to make the UX better.
Hi @MayurSMahajan , when can this PR be merged?
Hey @annieappflowy! Actually, the PR is ready to be merged but there is some problem with CI/CD, we hope to resolve the issue soon. Maybe in a couple of days, we'll have it merged.
Hey @annieappflowy! Actually, the PR is ready to be merged but there is some problem with CI/CD, we hope to resolve the issue soon. Maybe in a couple of days, we'll have it merged.
As long as a test introduced in this PR isn't failing on all platforms, I believe we can continue. Windows tests are failing, and we don't have a solution as of yet, we will keep working on it. :+1: