Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
76f4f64
refactor: migrate shortcut management to PreferenceService
kangfenmao Apr 7, 2026
f101f42
refactor: enhance shortcut management and zoom functionality in AppMe…
kangfenmao Apr 7, 2026
e2c2ed0
refactor: optimize shortcut handling and improve preference resolution
kangfenmao Apr 7, 2026
88f6e23
refactor: add labelKey to shortcut definitions and improve shortcut d…
kangfenmao Apr 7, 2026
97ff8fa
refactor: add Windows_NavigateToSettings IPC channel and update navig…
kangfenmao Apr 7, 2026
343d722
refactor: update auto-generated configuration and mappings with new t…
kangfenmao Apr 7, 2026
a17fc81
fix: address review feedback for shortcut system
kangfenmao Apr 7, 2026
03129ef
refactor: streamline shortcut system by removing unused properties an…
kangfenmao Apr 7, 2026
f54fc1a
refactor: replace persistOnBlur with global in shortcut definitions a…
kangfenmao Apr 7, 2026
6075b25
refactor: shortcut keys to use a new naming convention
kangfenmao Apr 7, 2026
6854148
refactor: rename toggle_show_assistants to toggle_sidebar in shortcut…
kangfenmao Apr 7, 2026
3da7678
refactor(shortcuts): improve coerceShortcutPreference logic and updat…
kangfenmao Apr 8, 2026
5db3478
refactor(shortcuts): rename defaultKey to defaultBinding and update r…
kangfenmao Apr 8, 2026
f934bd0
refactor: update auto-generated timestamps in boot and preference con…
kangfenmao Apr 9, 2026
112ea63
Merge branch 'v2' into refactor/v2/shortcuts
kangfenmao Apr 10, 2026
c001915
Merge branch 'v2' into refactor/v2/shortcuts
0xfullex Apr 10, 2026
e9b1ea4
Refactor shortcut keys to remove 'app.' prefix and update related map…
kangfenmao Apr 10, 2026
dff76cf
Refactor shortcut system: update key references to binding, enhance e…
kangfenmao Apr 10, 2026
ed66528
Refactor shortcut system: remove default bindings, update tests, and …
kangfenmao Apr 13, 2026
6e9b6f3
Merge branch 'v2' of github.com:CherryHQ/cherry-studio into refactor/…
kangfenmao Apr 13, 2026
a529579
refactor(shortcuts): enhance mini window shortcut handling and improv…
kangfenmao Apr 13, 2026
1461597
refactor(shortcuts): tighten shared shortcut metadata
kangfenmao Apr 14, 2026
9ab7653
test(shortcuts): cover shortcut service registration
kangfenmao Apr 14, 2026
76b6147
Merge branch 'v2' into refactor/v2/shortcuts
kangfenmao Apr 14, 2026
69b2708
refactor(shortcuts): streamline shortcut handling and improve setting…
kangfenmao Apr 14, 2026
e55955b
refactor(shortcuts): update shortcut enabling logic and enhance setti…
kangfenmao Apr 14, 2026
6245e3f
refactor(shortcuts): enhance shortcut handling and streamline setting…
kangfenmao Apr 14, 2026
6edcd01
refactor(shortcuts): update shortcut system documentation for clarity…
kangfenmao Apr 14, 2026
2ce92c6
refactor(shortcuts): update shortcut definitions to improve clarity a…
kangfenmao Apr 14, 2026
a94b006
refactor(shortcuts): update shortcut keys and mappings for quick assi…
kangfenmao Apr 14, 2026
ac74297
refactor(shortcuts): reorganize and reintroduce quick assistant toggl…
kangfenmao Apr 14, 2026
37879ec
refactor(shortcuts): reorganize shortcut mappings and restore mini wi…
kangfenmao Apr 14, 2026
96325fb
refactor(shortcuts): implement feature toggle for shortcut definition…
kangfenmao Apr 14, 2026
39651e7
refactor(shortcuts): streamline default shortcut preference retrieval…
kangfenmao Apr 14, 2026
c8ea7fe
refactor(shortcuts): enhance selection shortcut registration logic ba…
kangfenmao Apr 14, 2026
e986bc6
refactor: rename toggle_sidebar shortcut to toggle_show_assistants an…
kangfenmao Apr 14, 2026
0bf173f
refactor(shortcuts): add methods for managing shortcuts in ConfigMana…
kangfenmao Apr 14, 2026
e3dd377
refactor(shortcuts): implement shortcut registration conflict handlin…
kangfenmao Apr 14, 2026
1bd8bde
refactor(shortcuts): encapsulate runtime state reset logic and enhanc…
kangfenmao Apr 14, 2026
4eac6ef
Merge branch 'v2' into refactor/v2/shortcuts
kangfenmao Apr 16, 2026
862eba9
fix(i18n): update Russian translations for shortcuts and tab actions
kangfenmao Apr 16, 2026
43a9da5
refactor(shortcuts): streamline shortcut definitions and update label…
kangfenmao Apr 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/references/data/preference-schema-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Only use object values when the data is frequently read/written as a whole unit.

```typescript
// Acceptable: Shortcut config is always read/written together
'shortcut.app.show_main_window': { key: string[], enabled: boolean, ... }
'shortcut.general.show_main_window': { binding: string[], enabled: boolean }
```

**Rule of thumb:** If you find yourself frequently accessing just one property of an object, split it into separate keys.
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/IpcChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ export enum IpcChannel {
Windows_IsMaximized = 'window:is-maximized',
Windows_MaximizedChanged = 'window:maximized-changed',
Windows_NavigateToAbout = 'window:navigate-to-about',
Windows_NavigateToSettings = 'window:navigate-to-settings',
Shortcut_RegistrationConflict = 'shortcut:registration-conflict',

// Tab
Tab_Attach = 'tab:attach',
Expand Down Expand Up @@ -261,8 +263,6 @@ export enum IpcChannel {

Export_Word = 'export:word',

Shortcuts_Update = 'shortcuts:update',

// backup
Backup_Backup = 'backup:backup',
Backup_Restore = 'backup:restore',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/data/bootConfig/bootConfigSchemas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Auto-generated boot config schema
* Generated at: 2026-04-13T03:21:18.289Z
* Generated at: 2026-04-14T03:21:01.612Z
*
* This file is automatically generated from classification.json (plus a
* small MANUAL_BOOT_CONFIG_ITEMS list in generate-boot-config.js for keys
Expand Down
116 changes: 54 additions & 62 deletions packages/shared/data/preference/preferenceSchemas.ts
Comment thread
kangfenmao marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Auto-generated preferences configuration
* Generated at: 2026-04-13T03:21:18.282Z
* Generated at: 2026-04-14T03:21:01.605Z
*
* This file is automatically generated from classification.json
* To update this file, modify classification.json and run:
Expand Down Expand Up @@ -424,38 +424,46 @@ export interface PreferenceSchemas {
'feature.translate.page.source_language': PreferenceTypes.TranslateSourceLanguage
// dexieSettings/settings/translate:target:language
'feature.translate.page.target_language': PreferenceTypes.TranslateLanguageCode
// redux/shortcuts/shortcuts.clear_topic
'shortcut.chat.clear': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.copy_last_message
'shortcut.chat.copy_last_message': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.edit_last_user_message
'shortcut.chat.edit_last_user_message': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.search_message_in_chat
'shortcut.chat.search_message': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.select_model
'shortcut.chat.select_model': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.toggle_new_context
'shortcut.chat.toggle_new_context': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.mini_window
'shortcut.feature.quick_assistant.toggle_window': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.selection_assistant_select_text
'shortcut.feature.selection.get_text': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.selection_assistant_toggle
'shortcut.feature.selection.toggle_enabled': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.exit_fullscreen
'shortcut.app.exit_fullscreen': Record<string, unknown>
'shortcut.general.exit_fullscreen': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.search_message
'shortcut.app.search_message': Record<string, unknown>
'shortcut.general.search': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.show_app
'shortcut.app.show_main_window': Record<string, unknown>
// redux/shortcuts/shortcuts.mini_window
'shortcut.app.show_mini_window': Record<string, unknown>
'shortcut.general.show_main_window': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.show_settings
'shortcut.app.show_settings': Record<string, unknown>
'shortcut.general.show_settings': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.toggle_show_assistants
'shortcut.app.toggle_show_assistants': Record<string, unknown>
'shortcut.general.toggle_sidebar': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.zoom_in
'shortcut.app.zoom_in': Record<string, unknown>
'shortcut.general.zoom_in': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.zoom_out
'shortcut.app.zoom_out': Record<string, unknown>
'shortcut.general.zoom_out': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.zoom_reset
'shortcut.app.zoom_reset': Record<string, unknown>
// redux/shortcuts/shortcuts.clear_topic
'shortcut.chat.clear': Record<string, unknown>
// redux/shortcuts/shortcuts.copy_last_message
'shortcut.chat.copy_last_message': Record<string, unknown>
// redux/shortcuts/shortcuts.search_message_in_chat
'shortcut.chat.search_message': Record<string, unknown>
// redux/shortcuts/shortcuts.toggle_new_context
'shortcut.chat.toggle_new_context': Record<string, unknown>
// redux/shortcuts/shortcuts.selection_assistant_select_text
'shortcut.selection.get_text': Record<string, unknown>
// redux/shortcuts/shortcuts.selection_assistant_toggle
'shortcut.selection.toggle_enabled': Record<string, unknown>
'shortcut.general.zoom_reset': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.new_topic
'shortcut.topic.new': Record<string, unknown>
'shortcut.topic.new': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.rename_topic
'shortcut.topic.rename': PreferenceTypes.PreferenceShortcutType
// redux/shortcuts/shortcuts.toggle_show_topics
'shortcut.topic.toggle_show_topics': PreferenceTypes.PreferenceShortcutType
// redux/settings/enableTopicNaming
'topic.naming.enabled': boolean
// redux/settings/topicNamingPrompt
Expand Down Expand Up @@ -713,42 +721,26 @@ export const DefaultPreferences: PreferenceSchemas = {
'feature.translate.page.scroll_sync': false,
'feature.translate.page.source_language': 'auto',
'feature.translate.page.target_language': 'zh-cn',
'shortcut.app.exit_fullscreen': { editable: false, enabled: true, key: ['Escape'], system: true },
'shortcut.app.search_message': {
editable: true,
enabled: true,
key: ['CommandOrControl', 'Shift', 'F'],
system: false
},
'shortcut.app.show_main_window': { editable: true, enabled: true, key: [], system: true },
'shortcut.app.show_mini_window': { editable: true, enabled: false, key: ['CommandOrControl', 'E'], system: true },
'shortcut.app.show_settings': { editable: false, enabled: true, key: ['CommandOrControl', ','], system: true },
'shortcut.app.toggle_show_assistants': {
editable: true,
enabled: true,
key: ['CommandOrControl', '['],
system: false
},
'shortcut.app.zoom_in': { editable: false, enabled: true, key: ['CommandOrControl', '='], system: true },
'shortcut.app.zoom_out': { editable: false, enabled: true, key: ['CommandOrControl', '-'], system: true },
'shortcut.app.zoom_reset': { editable: false, enabled: true, key: ['CommandOrControl', '0'], system: true },
'shortcut.chat.clear': { editable: true, enabled: true, key: ['CommandOrControl', 'L'], system: false },
'shortcut.chat.copy_last_message': {
editable: true,
enabled: false,
key: ['CommandOrControl', 'Shift', 'C'],
system: false
},
'shortcut.chat.search_message': { editable: true, enabled: true, key: ['CommandOrControl', 'F'], system: false },
'shortcut.chat.toggle_new_context': {
editable: true,
enabled: true,
key: ['CommandOrControl', 'K'],
system: false
},
'shortcut.selection.get_text': { editable: true, enabled: false, key: [], system: true },
'shortcut.selection.toggle_enabled': { editable: true, enabled: false, key: [], system: true },
'shortcut.topic.new': { editable: true, enabled: true, key: ['CommandOrControl', 'N'], system: false },
'shortcut.chat.clear': { binding: ['CommandOrControl', 'L'], enabled: true },
'shortcut.chat.copy_last_message': { binding: ['CommandOrControl', 'Shift', 'C'], enabled: false },
'shortcut.chat.edit_last_user_message': { binding: ['CommandOrControl', 'Shift', 'E'], enabled: false },
'shortcut.chat.search_message': { binding: ['CommandOrControl', 'F'], enabled: true },
'shortcut.chat.select_model': { binding: ['CommandOrControl', 'Shift', 'M'], enabled: true },
'shortcut.chat.toggle_new_context': { binding: ['CommandOrControl', 'K'], enabled: true },
'shortcut.feature.quick_assistant.toggle_window': { binding: ['CommandOrControl', 'E'], enabled: false },
'shortcut.feature.selection.get_text': { binding: [], enabled: false },
'shortcut.feature.selection.toggle_enabled': { binding: [], enabled: false },
'shortcut.general.exit_fullscreen': { binding: ['Escape'], enabled: true },
'shortcut.general.search': { binding: ['CommandOrControl', 'Shift', 'F'], enabled: true },
'shortcut.general.show_main_window': { binding: [], enabled: false },
'shortcut.general.show_settings': { binding: ['CommandOrControl', ','], enabled: true },
'shortcut.general.toggle_sidebar': { binding: ['CommandOrControl', '['], enabled: true },
'shortcut.general.zoom_in': { binding: ['CommandOrControl', '='], enabled: true },
'shortcut.general.zoom_out': { binding: ['CommandOrControl', '-'], enabled: true },
'shortcut.general.zoom_reset': { binding: ['CommandOrControl', '0'], enabled: true },
'shortcut.topic.new': { binding: ['CommandOrControl', 'N'], enabled: true },
'shortcut.topic.rename': { binding: ['CommandOrControl', 'T'], enabled: false },
'shortcut.topic.toggle_show_topics': { binding: ['CommandOrControl', ']'], enabled: true },
'topic.naming.enabled': true,
'topic.naming_prompt': '',
'topic.position': 'left',
Expand Down Expand Up @@ -782,9 +774,9 @@ export const DefaultPreferences: PreferenceSchemas = {

/**
* 生成统计:
* - 总配置项: 225
* - 总配置项: 229
* - electronStore项: 1
* - redux项: 205
* - redux项: 209
* - localStorage项: 0
* - dexieSettings项: 7
*/
4 changes: 1 addition & 3 deletions packages/shared/data/preference/preferenceTypes.ts
Comment thread
kangfenmao marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ export type PreferenceUpdateOptions = {
}

export type PreferenceShortcutType = {
key: string[]
editable: boolean
binding: string[]
enabled: boolean
system: boolean
}

export enum SelectionTriggerMode {
Expand Down
Loading