From b6f55b0e1a6e7681e6941fc6629cd9acb81d818f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 27 Jul 2025 21:18:00 +0300 Subject: [PATCH] refactor(command_palette): unnecessary icon mapping --- apps/client/src/services/command_registry.ts | 61 +------------------- apps/server/src/services/keyboard_actions.ts | 2 +- 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/apps/client/src/services/command_registry.ts b/apps/client/src/services/command_registry.ts index 2fc9beb83..965f7eaac 100644 --- a/apps/client/src/services/command_registry.ts +++ b/apps/client/src/services/command_registry.ts @@ -177,7 +177,7 @@ class CommandRegistry { id: action.actionName, name: action.friendlyName, description: action.description, - icon: action.iconClass || this.getIconForAction(action.actionName), + icon: action.iconClass, shortcut: primaryShortcut ? this.formatShortcut(primaryShortcut) : undefined, commandName: action.actionName as CommandNames, source: "keyboard-action", @@ -195,65 +195,6 @@ class CommandRegistry { .replace(/\+/g, ' + '); } - private getIconForAction(actionName: string): string { - // Map common action patterns to icons - const iconMap: Record = { - // Navigation - 'jumpToNote': 'bx bx-search', - 'commandPalette': 'bx bx-command', - 'scrollToActiveNote': 'bx bx-target-lock', - 'backInNoteHistory': 'bx bx-arrow-back', - 'forwardInNoteHistory': 'bx bx-arrow-forward', - - // Tree operations - 'collapseTree': 'bx bx-collapse', - 'collapseSubtree': 'bx bx-minus-circle', - 'expandSubtree': 'bx bx-plus-circle', - 'sortChildNotes': 'bx bx-sort', - - // Note operations - 'createNoteAfter': 'bx bx-plus', - 'createNoteInto': 'bx bx-plus-circle', - 'createNoteIntoInbox': 'bx bx-inbox', - 'deleteNotes': 'bx bx-trash', - 'editNoteTitle': 'bx bx-edit', - 'duplicateSubtree': 'bx bx-copy', - - // Movement - 'moveNoteUp': 'bx bx-up-arrow', - 'moveNoteDown': 'bx bx-down-arrow', - 'moveNoteUpInHierarchy': 'bx bx-left-arrow', - 'moveNoteDownInHierarchy': 'bx bx-right-arrow', - - // Clipboard - 'copyNotesToClipboard': 'bx bx-copy', - 'cutNotesToClipboard': 'bx bx-cut', - 'pasteNotesFromClipboard': 'bx bx-paste', - - // Tabs - 'openNewTab': 'bx bx-tab', - 'closeActiveTab': 'bx bx-x', - 'activateNextTab': 'bx bx-chevron-right', - 'activatePreviousTab': 'bx bx-chevron-left', - 'reopenLastTab': 'bx bx-refresh', - - // Windows - 'openNewWindow': 'bx bx-window-open', - 'toggleTray': 'bx bx-hide', - 'toggleZenMode': 'bx bx-fullscreen', - - // Search - 'quickSearch': 'bx bx-search-alt', - 'searchInSubtree': 'bx bx-search-alt-2', - - // Other - 'runActiveNote': 'bx bx-play', - 'showOptions': 'bx bx-cog' - }; - - return iconMap[actionName] || 'bx bx-command'; - } - register(command: CommandDefinition) { this.commands.set(command.id, command); diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts index f848d4542..87b3fd124 100644 --- a/apps/server/src/services/keyboard_actions.ts +++ b/apps/server/src/services/keyboard_actions.ts @@ -762,7 +762,7 @@ function getDefaultKeyboardActions() { { actionName: "toggleLeftPane", friendlyName: t("keyboard_action_names.toggle-left-pane"), - iconClass: "bx bx-dock-left", + iconClass: "bx bx-sidebar", defaultShortcuts: [], description: t("keyboard_actions.toggle-left-note-tree-panel"), scope: "window"