refactor(command_palette): unnecessary icon mapping

This commit is contained in:
Elian Doran 2025-07-27 21:18:00 +03:00
parent 964bc74b83
commit b6f55b0e1a
No known key found for this signature in database
2 changed files with 2 additions and 61 deletions

View File

@ -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<string, string> = {
// 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);

View File

@ -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"