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
No known key found for this signature in database
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 }); await appContext.tabManager.openTabWithNoteWithHoisting("_backendLog", { activate: true });
} }
async showHelpCommand() {
await appContext.tabManager.openTabWithNoteWithHoisting("_help", { activate: true });
}
async showLaunchBarSubtreeCommand() { async showLaunchBarSubtreeCommand() {
const rootNote = utils.isMobile() ? "_lbMobileRoot" : "_lbRoot"; const rootNote = utils.isMobile() ? "_lbMobileRoot" : "_lbRoot";
await this.showAndHoistSubtree(rootNote); await this.showAndHoistSubtree(rootNote);

View File

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

View File

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

View File

@ -641,7 +641,8 @@
"show_hidden_subtree": "Show Hidden Subtree", "show_hidden_subtree": "Show Hidden Subtree",
"show_help": "Show Help", "show_help": "Show Help",
"about": "About TriliumNext Notes", "about": "About TriliumNext Notes",
"logout": "Logout" "logout": "Logout",
"show-cheatsheet": "Show Cheatsheet"
}, },
"sync_status": { "sync_status": {
"unknown": "<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>", "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"), description: t("keyboard_actions.show-help"),
scope: "window" scope: "window"
}, },
{
actionName: "showCheatsheet",
defaultShortcuts: ["Shift+F1"],
description: t("keyboard_actions.show-cheatsheet"),
scope: "window"
},
{ {
separator: t("keyboard_actions.text-note-operations") separator: t("keyboard_actions.text-note-operations")

View File

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

View File

@ -88,10 +88,11 @@
"reset-zoom-level": "Reset zoom level", "reset-zoom-level": "Reset zoom level",
"copy-without-formatting": "Copy selected text without formatting", "copy-without-formatting": "Copy selected text without formatting",
"force-save-revision": "Force creating / saving new note revision of the active note", "force-save-revision": "Force creating / saving new note revision of the active note",
"show-help": "Shows built-in Help / cheatsheet", "show-help": "Shows the built-in User Guide",
"toggle-book-properties": "Toggle Book Properties", "toggle-book-properties": "Toggle Book Properties",
"toggle-classic-editor-toolbar": "Toggle the Formatting tab for the editor with fixed toolbar", "toggle-classic-editor-toolbar": "Toggle the Formatting tab for the editor with fixed toolbar",
"export-as-pdf": "Exports the current note as a PDF" "export-as-pdf": "Exports the current note as a PDF",
"show-cheatsheet": "Shows a modal with common keyboard operations"
}, },
"login": { "login": {
"title": "Login", "title": "Login",