Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(options): drop keyboard shortcut descriptions that restate the title
Elian Doran625699098a56
diff --git a/apps/client/src/services/command_registry.spec.ts b/apps/client/src/services/command_registry.spec.tsindex ccbd3fc868..14e769b0a1 100644--- a/apps/client/src/services/command_registry.spec.ts+++ b/apps/client/src/services/command_registry.spec.ts@@ -182,11 +182,11 @@ describe("CommandRegistry keyboard actions", () => {expect(treeCmd.name).toBe("command_palette.tree-action-name:Tree Action");});- it("skips already-registered, description-less, electron-only and ignored actions", async () => {+ it("skips already-registered, electron-only and ignored actions, but registers description-less ones", async () => {getActions.mockImplementation(async () => [// Collides with a manually-registered default command id -> skipped.action({ actionName: "export-note" }),- // No description -> skipped.+ // No description -> still registered (separators are filtered out upstream).action({ actionName: "noDesc", description: undefined }),// Electron-only while not in electron -> skipped.action({ actionName: "electronOnly", isElectronOnly: true }),@@ -200,7 +200,8 @@ describe("CommandRegistry keyboard actions", () => {// export-note stays the manually-registered command (has a handler).expect(registry.getCommand("export-note")!.handler).toBeTypeOf("function");- expect(registry.getCommand("noDesc")).toBeUndefined();+ expect(registry.getCommand("noDesc")).toBeDefined();+ expect(registry.getCommand("noDesc")!.description).toBeUndefined();expect(registry.getCommand("electronOnly")).toBeUndefined();expect(registry.getCommand("ignored")).toBeUndefined();diff --git a/apps/client/src/services/command_registry.ts b/apps/client/src/services/command_registry.tsindex 62f32d6e55..5ad87458b2 100644--- a/apps/client/src/services/command_registry.ts+++ b/apps/client/src/services/command_registry.ts@@ -139,11 +139,6 @@ export class CommandRegistry {continue;}- // Skip actions that don't have a description (likely separators)- if (!action.description) {- continue;- }-// Skip Electron-only actions if not in Electron environmentif (action.isElectronOnly && !utils.isElectron()) {continue;diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.jsonindex e1f767fa41..779722b838 100644--- a/apps/server/src/assets/translations/en/server.json+++ b/apps/server/src/assets/translations/en/server.json@@ -3,7 +3,6 @@"back-in-note-history": "Navigate to previous note in history","forward-in-note-history": "Navigate to next note in history","open-jump-to-note-dialog": "Open \"Jump to note\" dialog",- "open-command-palette": "Open command palette","scroll-to-active-note": "Scroll note tree to active note","quick-search": "Activate quick search bar","search-in-subtree": "Search for notes in the active note's subtree",@@ -16,11 +15,6 @@"create-note-after": "Create note after active note","create-note-into": "Create note as child of active note","create-note-into-inbox": "Create a note in the inbox (if defined) or day note",- "delete-note": "Delete note",- "move-note-up": "Move note up",- "move-note-down": "Move note down",- "move-note-up-in-hierarchy": "Move note up in hierarchy",- "move-note-down-in-hierarchy": "Move note down in hierarchy","edit-note-title": "Jump from tree to the note detail and edit title","edit-branch-prefix": "Show \"Edit branch prefix\" dialog","clone-notes-to": "Clone selected notes",@@ -30,27 +24,12 @@"paste-notes-from-clipboard": "Paste notes from the clipboard into active note","cut-notes-to-clipboard": "Cut selected notes to the clipboard","select-all-notes-in-parent": "Select all notes from the current note level",- "add-note-above-to-the-selection": "Add note above to the selection",- "add-note-below-to-selection": "Add note below to the selection",- "duplicate-subtree": "Duplicate subtree","tabs-and-windows": "Tabs & Windows",- "open-new-tab": "Open new tab",- "close-active-tab": "Close active tab","reopen-last-tab": "Reopen the last closed tab","activate-next-tab": "Activate tab on the right","activate-previous-tab": "Activate tab on the left","open-new-window": "Open new empty window","toggle-tray": "Show/hide the application from the system tray",- "first-tab": "Activate the first tab in the list",- "second-tab": "Activate the second tab in the list",- "third-tab": "Activate the third tab in the list",- "fourth-tab": "Activate the fourth tab in the list",- "fifth-tab": "Activate the fifth tab in the list",- "sixth-tab": "Activate the sixth tab in the list",- "seventh-tab": "Activate the seventh tab in the list",- "eight-tab": "Activate the eighth tab in the list",- "ninth-tab": "Activate the ninth tab in the list",- "last-tab": "Activate the last tab in the list","dialogs": "Dialogs","show-note-source": "Show \"Note Source\" dialog","show-options": "Open \"Options\" page",@@ -67,44 +46,26 @@"paste-markdown-into-text": "Pastes Markdown from clipboard into text note","cut-into-note": "Cuts the selection from the current note and creates subnote with the selected text","add-include-note-to-text": "Opens the dialog to include a note",- "edit-readonly-note": "Edit a read-only note","attributes-labels-and-relations": "Attributes (labels & relations)","add-new-label": "Create new label","create-new-relation": "Create new relation","ribbon-tabs": "Ribbon tabs",- "toggle-basic-properties": "Toggle Basic Properties",- "toggle-file-properties": "Toggle File Properties",- "toggle-image-properties": "Toggle Image Properties",- "toggle-owned-attributes": "Toggle Owned Attributes",- "toggle-inherited-attributes": "Toggle Inherited Attributes",- "toggle-promoted-attributes": "Toggle Promoted Attributes","toggle-link-map": "Toggle Link Map",- "toggle-note-info": "Toggle Note Info",- "toggle-note-paths": "Toggle Note Paths",- "toggle-similar-notes": "Toggle Similar Notes","other": "Other","toggle-right-pane": "Toggle the display of the right pane, which includes Table of Contents and Highlights",- "print-active-note": "Print active note","open-note-externally": "Open note as a file with default application","render-active-note": "Render (re-render) active note","run-active-note": "Run active JavaScript (frontend/backend) code note","toggle-note-hoisting": "Toggle note hoisting of active note","unhoist": "Unhoist from anywhere",- "reload-frontend-app": "Reload frontend",- "open-dev-tools": "Open developer tools","find-in-text": "Toggle search panel","toggle-left-note-tree-panel": "Toggle left (note tree) panel",- "toggle-full-screen": "Toggle full screen",- "zoom-out": "Zoom Out",- "zoom-in": "Zoom In","note-navigation": "Note navigation",- "reset-zoom-level": "Reset zoom level","copy-without-formatting": "Copy selected text without formatting","force-save-revision": "Force creating / saving new note revision of the active note","save-named-revision": "Save a named revision of the active note","toggle-book-properties": "Toggle Collection Properties","toggle-classic-editor-toolbar": "Toggle the Formatting tab for the editor with fixed toolbar",- "export-as-pdf": "Export the current note as a PDF","toggle-zen-mode": "Enables/disables the zen mode (minimal UI for more focused editing)"},"keyboard_action_names": {diff --git a/packages/trilium-core/src/services/keyboard_actions.ts b/packages/trilium-core/src/services/keyboard_actions.tsindex d90d281f22..9b4a873a87 100644--- a/packages/trilium-core/src/services/keyboard_actions.ts+++ b/packages/trilium-core/src/services/keyboard_actions.ts@@ -53,7 +53,6 @@ function getDefaultKeyboardActions() {actionName: "commandPalette",friendlyName: t("keyboard_action_names.command-palette"),defaultShortcuts: ["CommandOrControl+Shift+J"],- description: t("keyboard_actions.open-command-palette"),scope: "window",ignoreFromCommandPalette: true},@@ -110,7 +109,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.sort-child-notes"),iconClass: "bx bx-sort-down",defaultShortcuts: ["Alt+S"],- description: t("keyboard_actions.sort-child-notes"),scope: "note-tree"},{@@ -154,7 +152,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.delete-notes"),iconClass: "bx bx-trash",defaultShortcuts: ["Delete"],- description: t("keyboard_actions.delete-note"),scope: "note-tree"},{@@ -162,7 +159,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.move-note-up"),iconClass: "bx bx-up-arrow-alt",defaultShortcuts: isMac() ? ["Alt+Up"] : ["CommandOrControl+Up"],- description: t("keyboard_actions.move-note-up"),scope: "note-tree"},{@@ -170,7 +166,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.move-note-down"),iconClass: "bx bx-down-arrow-alt",defaultShortcuts: isMac() ? ["Alt+Down"] : ["CommandOrControl+Down"],- description: t("keyboard_actions.move-note-down"),scope: "note-tree"},{@@ -178,7 +173,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.move-note-up-in-hierarchy"),iconClass: "bx bx-arrow-from-bottom",defaultShortcuts: isMac() ? ["Alt+Left"] : ["CommandOrControl+Left"],- description: t("keyboard_actions.move-note-up-in-hierarchy"),scope: "note-tree"},{@@ -186,7 +180,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.move-note-down-in-hierarchy"),iconClass: "bx bx-arrow-from-top",defaultShortcuts: isMac() ? ["Alt+Right"] : ["CommandOrControl+Right"],- description: t("keyboard_actions.move-note-down-in-hierarchy"),scope: "note-tree"},{@@ -262,7 +255,6 @@ function getDefaultKeyboardActions() {actionName: "addNoteAboveToSelection",friendlyName: t("keyboard_action_names.add-note-above-to-selection"),defaultShortcuts: ["Shift+Up"],- description: t("keyboard_actions.add-note-above-to-the-selection"),scope: "note-tree",ignoreFromCommandPalette: true},@@ -270,7 +262,6 @@ function getDefaultKeyboardActions() {actionName: "addNoteBelowToSelection",friendlyName: t("keyboard_action_names.add-note-below-to-selection"),defaultShortcuts: ["Shift+Down"],- description: t("keyboard_actions.add-note-below-to-selection"),scope: "note-tree",ignoreFromCommandPalette: true},@@ -279,7 +270,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.duplicate-subtree"),iconClass: "bx bx-outline",defaultShortcuts: [],- description: t("keyboard_actions.duplicate-subtree"),scope: "note-tree"},@@ -291,7 +281,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.open-new-tab"),iconClass: "bx bx-plus",defaultShortcuts: isElectron() ? ["CommandOrControl+T"] : [],- description: t("keyboard_actions.open-new-tab"),scope: "window"},{@@ -299,7 +288,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.close-active-tab"),iconClass: "bx bx-minus",defaultShortcuts: isElectron() ? ["CommandOrControl+W"] : [],- description: t("keyboard_actions.close-active-tab"),scope: "window"},{@@ -357,7 +345,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-first-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+1"],- description: t("keyboard_actions.first-tab"),scope: "window"},{@@ -365,7 +352,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-second-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+2"],- description: t("keyboard_actions.second-tab"),scope: "window"},{@@ -373,7 +359,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-third-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+3"],- description: t("keyboard_actions.third-tab"),scope: "window"},{@@ -381,7 +366,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-fourth-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+4"],- description: t("keyboard_actions.fourth-tab"),scope: "window"},{@@ -389,7 +373,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-fifth-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+5"],- description: t("keyboard_actions.fifth-tab"),scope: "window"},{@@ -397,7 +380,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-sixth-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+6"],- description: t("keyboard_actions.sixth-tab"),scope: "window"},{@@ -405,7 +387,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-seventh-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+7"],- description: t("keyboard_actions.seventh-tab"),scope: "window"},{@@ -413,7 +394,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-eighth-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+8"],- description: t("keyboard_actions.eight-tab"),scope: "window"},{@@ -421,7 +401,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-ninth-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+9"],- description: t("keyboard_actions.ninth-tab"),scope: "window"},{@@ -429,7 +408,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.switch-to-last-tab"),iconClass: "bx bx-rectangle",defaultShortcuts: ["CommandOrControl+0"],- description: t("keyboard_actions.last-tab"),scope: "window"},@@ -558,7 +536,6 @@ function getDefaultKeyboardActions() {actionName: "editReadOnlyNote",iconClass: "bx bx-edit-alt",defaultShortcuts: [],- description: t("keyboard_actions.edit-readonly-note"),scope: "window"},@@ -600,7 +577,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-basic-properties"),iconClass: "bx bx-slider",defaultShortcuts: [],- description: t("keyboard_actions.toggle-basic-properties"),scope: "window"},{@@ -616,7 +592,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-file-properties"),iconClass: "bx bx-file",defaultShortcuts: [],- description: t("keyboard_actions.toggle-file-properties"),scope: "window"},{@@ -624,7 +599,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-image-properties"),iconClass: "bx bx-image",defaultShortcuts: [],- description: t("keyboard_actions.toggle-image-properties"),scope: "window"},{@@ -632,7 +606,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-owned-attributes"),iconClass: "bx bx-list-check",defaultShortcuts: ["Alt+A"],- description: t("keyboard_actions.toggle-owned-attributes"),scope: "window"},{@@ -640,7 +613,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-inherited-attributes"),iconClass: "bx bx-list-plus",defaultShortcuts: [],- description: t("keyboard_actions.toggle-inherited-attributes"),scope: "window"},// TODO: Remove or change since promoted attributes have been changed.@@ -649,7 +621,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-promoted-attributes"),iconClass: "bx bx-star",defaultShortcuts: [],- description: t("keyboard_actions.toggle-promoted-attributes"),scope: "window"},{@@ -665,7 +636,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-note-info"),iconClass: "bx bx-info-circle",defaultShortcuts: [],- description: t("keyboard_actions.toggle-note-info"),scope: "window"},{@@ -673,7 +643,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-note-paths"),iconClass: "bx bx-collection",defaultShortcuts: [],- description: t("keyboard_actions.toggle-note-paths"),scope: "window"},{@@ -681,7 +650,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-ribbon-tab-similar-notes"),iconClass: "bx bx-bar-chart",defaultShortcuts: [],- description: t("keyboard_actions.toggle-similar-notes"),scope: "window"},@@ -702,7 +670,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.print-active-note"),iconClass: "bx bx-printer",defaultShortcuts: [],- description: t("keyboard_actions.print-active-note"),scope: "window"},{@@ -710,7 +677,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.export-active-note-as-pdf"),iconClass: "bx bxs-file-pdf",defaultShortcuts: [],- description: t("keyboard_actions.export-as-pdf"),scope: "window"},{@@ -758,7 +724,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.reload-frontend-app"),iconClass: "bx bx-refresh",defaultShortcuts: ["F5", "CommandOrControl+R"],- description: t("keyboard_actions.reload-frontend-app"),scope: "window"},{@@ -767,7 +732,6 @@ function getDefaultKeyboardActions() {iconClass: "bx bx-bug-alt",defaultShortcuts: isElectron() ? ["CommandOrControl+Shift+I"] : [],isElectronOnly: true,- description: t("keyboard_actions.open-dev-tools"),scope: "window"},{@@ -791,7 +755,6 @@ function getDefaultKeyboardActions() {friendlyName: t("keyboard_action_names.toggle-full-screen"),iconClass: "bx bx-fullscreen",defaultShortcuts: ["F11"],- description: t("keyboard_actions.toggle-full-screen"),scope: "window"},{@@ -800,14 +763,12 @@ function getDefaultKeyboardActions() {iconClass: "bx bx-zoom-out",defaultShortcuts: isElectron() ? ["CommandOrControl+-"] : [],isElectronOnly: true,- description: t("keyboard_actions.zoom-out"),scope: "window"},{actionName: "zoomIn",friendlyName: t("keyboard_action_names.zoom-in"),iconClass: "bx bx-zoom-in",- description: t("keyboard_actions.zoom-in"),defaultShortcuts: isElectron() ? ["CommandOrControl+="] : [],isElectronOnly: true,scope: "window"@@ -816,7 +777,6 @@ function getDefaultKeyboardActions() {actionName: "zoomReset",friendlyName: t("keyboard_action_names.reset-zoom-level"),iconClass: "bx bx-search-alt",- description: t("keyboard_actions.reset-zoom-level"),defaultShortcuts: isElectron() ? ["CommandOrControl+0"] : [],isElectronOnly: true,scope: "window"