@@ -75,140 +75,143 @@ export function SettingsShortcutsSection({
7575 const isMac = isMacPlatform ( ) ;
7676 const [ searchQuery , setSearchQuery ] = useState ( "" ) ;
7777
78- const groups : ShortcutGroup [ ] = [
79- {
80- title : "File" ,
81- subtitle : "Create agents and worktrees from the keyboard." ,
82- items : [
83- {
84- label : "New Agent" ,
85- draftKey : "newAgent" ,
86- settingKey : "newAgentShortcut" ,
87- help : `Default: ${ formatShortcut ( "cmd+n" ) } ` ,
88- } ,
89- {
90- label : "New Worktree Agent" ,
91- draftKey : "newWorktreeAgent" ,
92- settingKey : "newWorktreeAgentShortcut" ,
93- help : `Default: ${ formatShortcut ( "cmd+shift+n" ) } ` ,
94- } ,
95- {
96- label : "New Clone Agent" ,
97- draftKey : "newCloneAgent" ,
98- settingKey : "newCloneAgentShortcut" ,
99- help : `Default: ${ formatShortcut ( "cmd+alt+n" ) } ` ,
100- } ,
101- {
102- label : "Archive active thread" ,
103- draftKey : "archiveThread" ,
104- settingKey : "archiveThreadShortcut" ,
105- help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+a" : "ctrl+alt+a" ) } ` ,
106- } ,
107- ] ,
108- } ,
109- {
110- title : "Composer" ,
111- subtitle : "Cycle between model, access, reasoning, and collaboration modes." ,
112- items : [
113- {
114- label : "Cycle model" ,
115- draftKey : "model" ,
116- settingKey : "composerModelShortcut" ,
117- help : `Press a new shortcut while focused. Default: ${ formatShortcut ( "cmd+shift+m" ) } ` ,
118- } ,
119- {
120- label : "Cycle access mode" ,
121- draftKey : "access" ,
122- settingKey : "composerAccessShortcut" ,
123- help : `Default: ${ formatShortcut ( "cmd+shift+a" ) } ` ,
124- } ,
125- {
126- label : "Cycle reasoning mode" ,
127- draftKey : "reasoning" ,
128- settingKey : "composerReasoningShortcut" ,
129- help : `Default: ${ formatShortcut ( "cmd+shift+r" ) } ` ,
130- } ,
131- {
132- label : "Cycle collaboration mode" ,
133- draftKey : "collaboration" ,
134- settingKey : "composerCollaborationShortcut" ,
135- help : `Default: ${ formatShortcut ( "shift+tab" ) } ` ,
136- } ,
137- {
138- label : "Stop active run" ,
139- draftKey : "interrupt" ,
140- settingKey : "interruptShortcut" ,
141- help : `Default: ${ formatShortcut ( getDefaultInterruptShortcut ( ) ) } ` ,
142- } ,
143- ] ,
144- } ,
145- {
146- title : "Panels" ,
147- subtitle : "Toggle sidebars and panels." ,
148- items : [
149- {
150- label : "Toggle projects sidebar" ,
151- draftKey : "projectsSidebar" ,
152- settingKey : "toggleProjectsSidebarShortcut" ,
153- help : `Default: ${ formatShortcut ( "cmd+shift+p" ) } ` ,
154- } ,
155- {
156- label : "Toggle git sidebar" ,
157- draftKey : "gitSidebar" ,
158- settingKey : "toggleGitSidebarShortcut" ,
159- help : `Default: ${ formatShortcut ( "cmd+shift+g" ) } ` ,
160- } ,
161- {
162- label : "Branch switcher" ,
163- draftKey : "branchSwitcher" ,
164- settingKey : "branchSwitcherShortcut" ,
165- help : `Default: ${ formatShortcut ( "cmd+b" ) } ` ,
166- } ,
167- {
168- label : "Toggle debug panel" ,
169- draftKey : "debugPanel" ,
170- settingKey : "toggleDebugPanelShortcut" ,
171- help : `Default: ${ formatShortcut ( "cmd+shift+d" ) } ` ,
172- } ,
173- {
174- label : "Toggle terminal panel" ,
175- draftKey : "terminal" ,
176- settingKey : "toggleTerminalShortcut" ,
177- help : `Default: ${ formatShortcut ( "cmd+shift+t" ) } ` ,
178- } ,
179- ] ,
180- } ,
181- {
182- title : "Navigation" ,
183- subtitle : "Cycle between agents and workspaces." ,
184- items : [
185- {
186- label : "Next agent" ,
187- draftKey : "cycleAgentNext" ,
188- settingKey : "cycleAgentNextShortcut" ,
189- help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+down" : "ctrl+alt+down" ) } ` ,
190- } ,
191- {
192- label : "Previous agent" ,
193- draftKey : "cycleAgentPrev" ,
194- settingKey : "cycleAgentPrevShortcut" ,
195- help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+up" : "ctrl+alt+up" ) } ` ,
196- } ,
197- {
198- label : "Next workspace" ,
199- draftKey : "cycleWorkspaceNext" ,
200- settingKey : "cycleWorkspaceNextShortcut" ,
201- help : `Default: ${ formatShortcut ( isMac ? "cmd+shift+down" : "ctrl+alt+shift+down" ) } ` ,
202- } ,
203- {
204- label : "Previous workspace" ,
205- draftKey : "cycleWorkspacePrev" ,
206- settingKey : "cycleWorkspacePrevShortcut" ,
207- help : `Default: ${ formatShortcut ( isMac ? "cmd+shift+up" : "ctrl+alt+shift+up" ) } ` ,
208- } ,
209- ] ,
210- } ,
211- ] ;
78+ const groups = useMemo < ShortcutGroup [ ] > (
79+ ( ) => [
80+ {
81+ title : "File" ,
82+ subtitle : "Create agents and worktrees from the keyboard." ,
83+ items : [
84+ {
85+ label : "New Agent" ,
86+ draftKey : "newAgent" ,
87+ settingKey : "newAgentShortcut" ,
88+ help : `Default: ${ formatShortcut ( "cmd+n" ) } ` ,
89+ } ,
90+ {
91+ label : "New Worktree Agent" ,
92+ draftKey : "newWorktreeAgent" ,
93+ settingKey : "newWorktreeAgentShortcut" ,
94+ help : `Default: ${ formatShortcut ( "cmd+shift+n" ) } ` ,
95+ } ,
96+ {
97+ label : "New Clone Agent" ,
98+ draftKey : "newCloneAgent" ,
99+ settingKey : "newCloneAgentShortcut" ,
100+ help : `Default: ${ formatShortcut ( "cmd+alt+n" ) } ` ,
101+ } ,
102+ {
103+ label : "Archive active thread" ,
104+ draftKey : "archiveThread" ,
105+ settingKey : "archiveThreadShortcut" ,
106+ help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+a" : "ctrl+alt+a" ) } ` ,
107+ } ,
108+ ] ,
109+ } ,
110+ {
111+ title : "Composer" ,
112+ subtitle : "Cycle between model, access, reasoning, and collaboration modes." ,
113+ items : [
114+ {
115+ label : "Cycle model" ,
116+ draftKey : "model" ,
117+ settingKey : "composerModelShortcut" ,
118+ help : `Press a new shortcut while focused. Default: ${ formatShortcut ( "cmd+shift+m" ) } ` ,
119+ } ,
120+ {
121+ label : "Cycle access mode" ,
122+ draftKey : "access" ,
123+ settingKey : "composerAccessShortcut" ,
124+ help : `Default: ${ formatShortcut ( "cmd+shift+a" ) } ` ,
125+ } ,
126+ {
127+ label : "Cycle reasoning mode" ,
128+ draftKey : "reasoning" ,
129+ settingKey : "composerReasoningShortcut" ,
130+ help : `Default: ${ formatShortcut ( "cmd+shift+r" ) } ` ,
131+ } ,
132+ {
133+ label : "Cycle collaboration mode" ,
134+ draftKey : "collaboration" ,
135+ settingKey : "composerCollaborationShortcut" ,
136+ help : `Default: ${ formatShortcut ( "shift+tab" ) } ` ,
137+ } ,
138+ {
139+ label : "Stop active run" ,
140+ draftKey : "interrupt" ,
141+ settingKey : "interruptShortcut" ,
142+ help : `Default: ${ formatShortcut ( getDefaultInterruptShortcut ( ) ) } ` ,
143+ } ,
144+ ] ,
145+ } ,
146+ {
147+ title : "Panels" ,
148+ subtitle : "Toggle sidebars and panels." ,
149+ items : [
150+ {
151+ label : "Toggle projects sidebar" ,
152+ draftKey : "projectsSidebar" ,
153+ settingKey : "toggleProjectsSidebarShortcut" ,
154+ help : `Default: ${ formatShortcut ( "cmd+shift+p" ) } ` ,
155+ } ,
156+ {
157+ label : "Toggle git sidebar" ,
158+ draftKey : "gitSidebar" ,
159+ settingKey : "toggleGitSidebarShortcut" ,
160+ help : `Default: ${ formatShortcut ( "cmd+shift+g" ) } ` ,
161+ } ,
162+ {
163+ label : "Branch switcher" ,
164+ draftKey : "branchSwitcher" ,
165+ settingKey : "branchSwitcherShortcut" ,
166+ help : `Default: ${ formatShortcut ( "cmd+b" ) } ` ,
167+ } ,
168+ {
169+ label : "Toggle debug panel" ,
170+ draftKey : "debugPanel" ,
171+ settingKey : "toggleDebugPanelShortcut" ,
172+ help : `Default: ${ formatShortcut ( "cmd+shift+d" ) } ` ,
173+ } ,
174+ {
175+ label : "Toggle terminal panel" ,
176+ draftKey : "terminal" ,
177+ settingKey : "toggleTerminalShortcut" ,
178+ help : `Default: ${ formatShortcut ( "cmd+shift+t" ) } ` ,
179+ } ,
180+ ] ,
181+ } ,
182+ {
183+ title : "Navigation" ,
184+ subtitle : "Cycle between agents and workspaces." ,
185+ items : [
186+ {
187+ label : "Next agent" ,
188+ draftKey : "cycleAgentNext" ,
189+ settingKey : "cycleAgentNextShortcut" ,
190+ help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+down" : "ctrl+alt+down" ) } ` ,
191+ } ,
192+ {
193+ label : "Previous agent" ,
194+ draftKey : "cycleAgentPrev" ,
195+ settingKey : "cycleAgentPrevShortcut" ,
196+ help : `Default: ${ formatShortcut ( isMac ? "cmd+ctrl+up" : "ctrl+alt+up" ) } ` ,
197+ } ,
198+ {
199+ label : "Next workspace" ,
200+ draftKey : "cycleWorkspaceNext" ,
201+ settingKey : "cycleWorkspaceNextShortcut" ,
202+ help : `Default: ${ formatShortcut ( isMac ? "cmd+shift+down" : "ctrl+alt+shift+down" ) } ` ,
203+ } ,
204+ {
205+ label : "Previous workspace" ,
206+ draftKey : "cycleWorkspacePrev" ,
207+ settingKey : "cycleWorkspacePrevShortcut" ,
208+ help : `Default: ${ formatShortcut ( isMac ? "cmd+shift+up" : "ctrl+alt+shift+up" ) } ` ,
209+ } ,
210+ ] ,
211+ } ,
212+ ] ,
213+ [ isMac ] ,
214+ ) ;
212215
213216 const normalizedSearchQuery = searchQuery . trim ( ) . toLowerCase ( ) ;
214217 const filteredGroups = useMemo ( ( ) => {
0 commit comments