Skip to content

Commit

Permalink
feat(shortcuts): Add Shortcuts to Help Menu
Browse files Browse the repository at this point in the history
- Added option of shorcuts in help menu
- Clicking on the shortcut leads to the `Shortcuts.md` file
  • Loading branch information
AmanNegi committed Feb 18, 2023
1 parent 7c3a823 commit 8061262
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/app_flowy/assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
},
"dialogCreatePageNameHint": "Page name",
"questionBubble": {
"shortcuts": "Shortcuts",
"whatsNew": "What's new?",
"help": "Help & Support",
"debug": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ class BubbleActionList extends StatelessWidget {
case BubbleAction.debug:
_DebugToast().show();
break;
case BubbleAction.shortcuts:
_launchURL(
"https://github.com/AppFlowy-IO/AppFlowy-Docs/blob/main/essential-documentation/shortcuts.md");
break;
}
}

Expand Down Expand Up @@ -160,7 +164,7 @@ class FlowyVersionDescription extends CustomActionCell {
}
}

enum BubbleAction { whatsNews, help, debug }
enum BubbleAction { whatsNews, help, debug, shortcuts }

class BubbleActionWrapper extends ActionCell {
final BubbleAction inner;
Expand All @@ -182,6 +186,11 @@ extension QuestionBubbleExtension on BubbleAction {
return LocaleKeys.questionBubble_help.tr();
case BubbleAction.debug:
return LocaleKeys.questionBubble_debug_name.tr();
case BubbleAction.shortcuts:
// return LocaleKeys.questionBubble_shortcuts.tr();

// TODO: Use localized approach
return "Shortcuts";
}
}

Expand All @@ -193,6 +202,8 @@ extension QuestionBubbleExtension on BubbleAction {
return '👥';
case BubbleAction.debug:
return '🐛';
case BubbleAction.shortcuts:
return '⌨️';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ List<ShortcutEvent> builtInShortcutEvents = [
command: 'shift+arrow down',
handler: cursorDownSelect,
),
// TODO: Use Unique and correct key names here
ShortcutEvent(
key: 'Cursor down select',
command: 'shift+alt+arrow left',
Expand Down

0 comments on commit 8061262

Please sign in to comment.