feat(in-app-help): integrate into existing help command

This commit is contained in:
Elian Doran
2025-02-02 17:49:26 +02:00
parent 122c1ad1ec
commit e24013adf5
7 changed files with 23 additions and 4 deletions

View File

@@ -90,6 +90,10 @@ export default class RootCommandExecutor extends Component {
await appContext.tabManager.openTabWithNoteWithHoisting("_backendLog", { activate: true });
}
async showHelpCommand() {
await appContext.tabManager.openTabWithNoteWithHoisting("_help", { activate: true });
}
async showLaunchBarSubtreeCommand() {
const rootNote = utils.isMobile() ? "_lbMobileRoot" : "_lbRoot";
await this.showAndHoistSubtree(rootNote);

View File

@@ -226,6 +226,12 @@ const TPL = `
<kbd data-command="showHelp"></kbd>
</li>
<li class="dropdown-item show-help-button" data-trigger-command="showCheatsheet">
<span class="bx bx-help-circle"></span>
${t("global_menu.show-cheatsheet")}
<kbd data-command="showCheatsheet"></kbd>
</li>
<li class="dropdown-item show-about-dialog-button">
<span class="bx bx-info-circle"></span>
${t("global_menu.about")}

View File

@@ -153,7 +153,7 @@ export default class HelpDialog extends BasicWidget {
this.$widget = $(TPL);
}
showHelpEvent() {
showCheatsheetEvent() {
utils.openDialog(this.$widget);
}
}

View File

@@ -641,7 +641,8 @@
"show_hidden_subtree": "Show Hidden Subtree",
"show_help": "Show Help",
"about": "About TriliumNext Notes",
"logout": "Logout"
"logout": "Logout",
"show-cheatsheet": "Show Cheatsheet"
},
"sync_status": {
"unknown": "<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>",

View File

@@ -344,6 +344,12 @@ function getDefaultKeyboardActions() {
description: t("keyboard_actions.show-help"),
scope: "window"
},
{
actionName: "showCheatsheet",
defaultShortcuts: ["Shift+F1"],
description: t("keyboard_actions.show-cheatsheet"),
scope: "window"
},
{
separator: t("keyboard_actions.text-note-operations")

View File

@@ -51,6 +51,7 @@ const enum KeyboardActionNamesEnum {
showRecentChanges,
showSQLConsole,
showBackendLog,
showCheatsheet,
showHelp,
addLinkToText,
followLinkUnderCursor,