Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

1.5 KB
Raw Blame
/**
 * Shortcuts Configuration
 * Centralized shortcut definitions based on platform capabilities
 */

import { ShortcutAction, type ShortcutMap } from './types'

/**
 * Platform-specific shortcut mappings
 * Uses alternate bindings for web to avoid browser conflicts
 */
export const PlatformShortcuts: ShortcutMap = {
  // Toggle sidebar - same on both platforms (no browser conflict)
  [ShortcutAction.TOGGLE_SIDEBAR]: {
    key: 'b',
    usePlatformMetaKey: true,
  },

  // New chat - different per platform to avoid browser "new window" conflict
  [ShortcutAction.NEW_CHAT]: { key: 'n', usePlatformMetaKey: true },

  // New agent chat - opens home screen with agent mode pre-enabled
  [ShortcutAction.NEW_AGENT_CHAT]: { key: 'm', usePlatformMetaKey: true },

  // New project - opens create project dialog
  [ShortcutAction.NEW_PROJECT]: { key: 'p', usePlatformMetaKey: true },

  // Go to settings - different per platform to avoid browser "preferences" conflict
  [ShortcutAction.GO_TO_SETTINGS]: { key: ',', usePlatformMetaKey: true },

  // Search - opens search dialog
  [ShortcutAction.SEARCH]: { key: 'k', usePlatformMetaKey: true },

  // Switch assistant - opens the chat input assistant switcher
  [ShortcutAction.SWITCH_ASSISTANT]: { key: 'j', usePlatformMetaKey: true },

  // Zoom shortcuts - same on both platforms (standard shortcuts)
  [ShortcutAction.ZOOM_IN]: {
    key: '+',
    aliasKeys: ['=', 'Add'],
    usePlatformMetaKey: true,
  },

  [ShortcutAction.ZOOM_OUT]: {
    key: '-',
    aliasKeys: ['_', 'Subtract'],
    usePlatformMetaKey: true,
  },
}