@lobehub/chat 1.103.2 → 1.104.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.cursor/rules/code-review.mdc +2 -0
  2. package/.cursor/rules/typescript.mdc +3 -1
  3. package/CHANGELOG.md +50 -0
  4. package/apps/desktop/src/main/controllers/BrowserWindowsCtr.ts +1 -1
  5. package/apps/desktop/src/main/controllers/ShortcutCtr.ts +9 -1
  6. package/apps/desktop/src/main/controllers/TrayMenuCtr.ts +1 -5
  7. package/apps/desktop/src/main/controllers/__tests__/ShortcutCtr.test.ts +14 -11
  8. package/apps/desktop/src/main/core/ui/ShortcutManager.ts +71 -5
  9. package/apps/desktop/src/main/shortcuts/config.ts +4 -2
  10. package/changelog/v1.json +18 -0
  11. package/locales/ar/hotkey.json +10 -4
  12. package/locales/ar/setting.json +12 -1
  13. package/locales/bg-BG/hotkey.json +10 -4
  14. package/locales/bg-BG/setting.json +12 -1
  15. package/locales/de-DE/hotkey.json +10 -4
  16. package/locales/de-DE/setting.json +12 -1
  17. package/locales/en-US/hotkey.json +10 -4
  18. package/locales/en-US/setting.json +12 -1
  19. package/locales/es-ES/hotkey.json +10 -4
  20. package/locales/es-ES/setting.json +12 -1
  21. package/locales/fa-IR/hotkey.json +10 -4
  22. package/locales/fa-IR/setting.json +12 -1
  23. package/locales/fr-FR/hotkey.json +10 -4
  24. package/locales/fr-FR/setting.json +12 -1
  25. package/locales/it-IT/hotkey.json +10 -4
  26. package/locales/it-IT/setting.json +12 -1
  27. package/locales/ja-JP/hotkey.json +10 -4
  28. package/locales/ja-JP/setting.json +12 -1
  29. package/locales/ko-KR/hotkey.json +10 -4
  30. package/locales/ko-KR/setting.json +12 -1
  31. package/locales/nl-NL/hotkey.json +10 -4
  32. package/locales/nl-NL/setting.json +12 -1
  33. package/locales/pl-PL/hotkey.json +10 -4
  34. package/locales/pl-PL/setting.json +12 -1
  35. package/locales/pt-BR/hotkey.json +10 -4
  36. package/locales/pt-BR/setting.json +12 -1
  37. package/locales/ru-RU/hotkey.json +10 -4
  38. package/locales/ru-RU/setting.json +12 -1
  39. package/locales/tr-TR/hotkey.json +10 -4
  40. package/locales/tr-TR/setting.json +12 -1
  41. package/locales/vi-VN/hotkey.json +10 -4
  42. package/locales/vi-VN/setting.json +12 -1
  43. package/locales/zh-CN/hotkey.json +10 -4
  44. package/locales/zh-CN/setting.json +12 -1
  45. package/locales/zh-TW/hotkey.json +10 -4
  46. package/locales/zh-TW/setting.json +12 -1
  47. package/package.json +1 -1
  48. package/packages/electron-client-ipc/src/events/shortcut.ts +3 -1
  49. package/packages/electron-client-ipc/src/types/shortcut.ts +11 -0
  50. package/src/app/[variants]/(main)/image/features/GenerationFeed/BatchItem.tsx +6 -1
  51. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/ErrorState.tsx +3 -2
  52. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/LoadingState.tsx +27 -24
  53. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/SuccessState.tsx +14 -3
  54. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/index.tsx +4 -7
  55. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/types.ts +3 -0
  56. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.test.ts +600 -0
  57. package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts +126 -7
  58. package/src/app/[variants]/(main)/settings/hotkey/features/Conversation.tsx +3 -11
  59. package/src/app/[variants]/(main)/settings/hotkey/features/Desktop.tsx +92 -0
  60. package/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx +3 -11
  61. package/src/app/[variants]/(main)/settings/hotkey/page.tsx +3 -0
  62. package/src/const/desktop.ts +9 -0
  63. package/src/const/hotkeys.ts +20 -16
  64. package/src/const/imageGeneration.ts +18 -0
  65. package/src/features/User/UserPanel/useMenu.tsx +2 -2
  66. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.test.ts +3 -0
  67. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.ts +7 -5
  68. package/src/libs/model-runtime/utils/streams/openai/openai.ts +8 -4
  69. package/src/libs/model-runtime/utils/usageConverter.test.ts +45 -1
  70. package/src/libs/model-runtime/utils/usageConverter.ts +6 -2
  71. package/src/locales/default/hotkey.ts +13 -5
  72. package/src/locales/default/setting.ts +11 -0
  73. package/src/server/services/generation/index.test.ts +848 -0
  74. package/src/server/services/generation/index.ts +90 -69
  75. package/src/services/electron/settings.ts +19 -1
  76. package/src/store/electron/actions/settings.ts +42 -1
  77. package/src/store/electron/initialState.ts +9 -1
  78. package/src/store/electron/selectors/__tests__/desktopState.test.ts +6 -17
  79. package/src/store/electron/selectors/hotkey.ts +11 -0
  80. package/src/store/electron/selectors/index.ts +1 -0
  81. package/src/types/hotkey.ts +18 -4
  82. package/src/utils/number.test.ts +101 -1
  83. package/src/utils/number.ts +42 -0
@@ -45,14 +45,25 @@ export default {
45
45
  },
46
46
  hotkey: {
47
47
  conflicts: '与现有快捷键冲突',
48
+ errors: {
49
+ CONFLICT: '快捷键冲突:该快捷键已被其他功能占用',
50
+ INVALID_FORMAT: '快捷键格式无效:请使用正确的格式(如 CommandOrControl+E)',
51
+ INVALID_ID: '无效的快捷键ID',
52
+ NO_MODIFIER: '快捷键必须包含修饰键(Ctrl、Alt、Shift等)',
53
+ SYSTEM_OCCUPIED: '快捷键已被系统或其他应用程序占用',
54
+ UNKNOWN: '更新失败:未知错误',
55
+ },
48
56
  group: {
49
57
  conversation: '会话',
58
+ desktop: '桌面端',
50
59
  essential: '基础',
51
60
  },
52
61
  invalidCombination: '快捷键需要至少包含一个修饰键 (Ctrl, Alt, Shift) 和一个常规键',
53
62
  record: '按下按键以录制快捷键',
54
63
  reset: '重置为默认快捷键',
55
64
  title: '快捷键',
65
+ updateError: '快捷键更新失败:网络或系统错误',
66
+ updateSuccess: '快捷键更新成功',
56
67
  },
57
68
  llm: {
58
69
  aesGcm: '您的秘钥与代理地址等将使用 <1>AES-GCM</1> 加密算法进行加密',