/** * Shortcuts Configuration * Centralized shortcut definitions based on platform capabilities */ import { PlatformFeatures } from '../platform/const' import { PlatformFeature } from '../platform/types' 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]: PlatformFeatures[PlatformFeature.ALTERNATE_SHORTCUT_BINDINGS] ? { key: 'Enter', usePlatformMetaKey: true } : { key: 'n', usePlatformMetaKey: true }, // Go to settings - different per platform to avoid browser "preferences" conflict [ShortcutAction.GO_TO_SETTINGS]: PlatformFeatures[PlatformFeature.ALTERNATE_SHORTCUT_BINDINGS] ? { key: '.', usePlatformMetaKey: true } : { key: ',', usePlatformMetaKey: true }, // Zoom shortcuts - same on both platforms (standard shortcuts) [ShortcutAction.ZOOM_IN]: { key: '+', usePlatformMetaKey: true, }, [ShortcutAction.ZOOM_OUT]: { key: '-', usePlatformMetaKey: true, }, // Toggle artifacts split view [ShortcutAction.TOGGLE_ARTIFACTS]: { key: '\\', usePlatformMetaKey: true, }, // Create new artifact [ShortcutAction.NEW_ARTIFACT]: { key: 'a', shiftKey: true, usePlatformMetaKey: true, }, // Force save current artifact [ShortcutAction.SAVE_ARTIFACT]: { key: 's', usePlatformMetaKey: true, }, // Artifact quick switcher [ShortcutAction.ARTIFACT_QUICK_SWITCHER]: { key: 'k', usePlatformMetaKey: true, }, }