feat(shortcuts): Add Shortcuts to Help Menu (#1870)

* feat(shortcuts): Add Shortcuts to Help Menu

- Added option of shorcuts in help menu
- Clicking on the shortcut leads to the `Shortcuts.md` file

* fix: l10n and todos

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
Aman Negi
2023-02-28 08:08:57 +05:30
committed by GitHub
parent 4a81fed6e4
commit 2451d3188c
3 changed files with 12 additions and 3 deletions

View File

@ -71,6 +71,7 @@
}, },
"dialogCreatePageNameHint": "Page name", "dialogCreatePageNameHint": "Page name",
"questionBubble": { "questionBubble": {
"shortcuts": "Shortcuts",
"whatsNew": "What's new?", "whatsNew": "What's new?",
"help": "Help & Support", "help": "Help & Support",
"debug": { "debug": {

View File

@ -64,6 +64,10 @@ class BubbleActionList extends StatelessWidget {
case BubbleAction.debug: case BubbleAction.debug:
_DebugToast().show(); _DebugToast().show();
break; break;
case BubbleAction.shortcuts:
_launchURL(
"https://github.com/AppFlowy-IO/AppFlowy-Docs/blob/main/essential-documentation/shortcuts.md");
break;
} }
} }
@ -160,7 +164,7 @@ class FlowyVersionDescription extends CustomActionCell {
} }
} }
enum BubbleAction { whatsNews, help, debug } enum BubbleAction { whatsNews, help, debug, shortcuts }
class BubbleActionWrapper extends ActionCell { class BubbleActionWrapper extends ActionCell {
final BubbleAction inner; final BubbleAction inner;
@ -182,6 +186,8 @@ extension QuestionBubbleExtension on BubbleAction {
return LocaleKeys.questionBubble_help.tr(); return LocaleKeys.questionBubble_help.tr();
case BubbleAction.debug: case BubbleAction.debug:
return LocaleKeys.questionBubble_debug_name.tr(); return LocaleKeys.questionBubble_debug_name.tr();
case BubbleAction.shortcuts:
return LocaleKeys.questionBubble_shortcuts.tr();
} }
} }
@ -193,6 +199,8 @@ extension QuestionBubbleExtension on BubbleAction {
return '👥'; return '👥';
case BubbleAction.debug: case BubbleAction.debug:
return '🐛'; return '🐛';
case BubbleAction.shortcuts:
return '⌨️';
} }
} }
} }

View File

@ -50,14 +50,14 @@ List<ShortcutEvent> builtInShortcutEvents = [
handler: cursorDownSelect, handler: cursorDownSelect,
), ),
ShortcutEvent( ShortcutEvent(
key: 'Cursor down select', key: 'Cursor left word select',
command: 'shift+alt+arrow left', command: 'shift+alt+arrow left',
windowsCommand: 'shift+alt+arrow left', windowsCommand: 'shift+alt+arrow left',
linuxCommand: 'shift+alt+arrow left', linuxCommand: 'shift+alt+arrow left',
handler: cursorLeftWordSelect, handler: cursorLeftWordSelect,
), ),
ShortcutEvent( ShortcutEvent(
key: 'Cursor down select', key: 'Cursor right word select',
command: 'shift+alt+arrow right', command: 'shift+alt+arrow right',
windowsCommand: 'shift+alt+arrow right', windowsCommand: 'shift+alt+arrow right',
linuxCommand: 'shift+alt+arrow right', linuxCommand: 'shift+alt+arrow right',