Skip to content

Commit 03631c6

Browse files
fix: add missing settings commands to Command Palette
- Fix Calendar Settings path: calendars -> calendar - Fix Sync Settings path: sync -> caldav - Add Event Defaults Settings command (tab=events) - Add Data Settings command (tab=data) - Add Toggle CalDAV Debug Mode command
1 parent 0bce034 commit 03631c6

2 files changed

Lines changed: 58 additions & 4 deletions

File tree

src/features/commandPalette/commands/index.ts

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ interface CommandFactoryDeps {
1212
toggleSidebar?: () => void
1313
triggerSync?: () => void
1414
themeMode?: ThemeMode
15+
caldavDebugMode?: boolean
1516
updateSettings?: (
16-
settings: Partial<{ themeMode: ThemeMode; lightTheme: string; darkTheme: string }>
17+
settings: Partial<{
18+
themeMode: ThemeMode
19+
lightTheme: string
20+
darkTheme: string
21+
caldavDebugMode: boolean
22+
}>
1723
) => void
1824
}
1925

@@ -220,10 +226,22 @@ const createSettingsCommands = (deps: CommandFactoryDeps): Command[] => [
220226
keywords: ['calendars', 'calendar settings'],
221227
icon: '📅',
222228
action: () => {
223-
deps.navigate('/settings?tab=calendars')
229+
deps.navigate('/settings?tab=calendar')
224230
return 'Opened calendar settings'
225231
},
226232
},
233+
{
234+
id: 'settings-events',
235+
label: 'Event Defaults Settings',
236+
description: 'Configure default event settings',
237+
category: 'settings',
238+
keywords: ['event defaults', 'event settings', 'default duration'],
239+
icon: '📝',
240+
action: () => {
241+
deps.navigate('/settings?tab=events')
242+
return 'Opened event defaults settings'
243+
},
244+
},
227245
{
228246
id: 'settings-notifications',
229247
label: 'Notification Settings',
@@ -244,10 +262,22 @@ const createSettingsCommands = (deps: CommandFactoryDeps): Command[] => [
244262
keywords: ['sync settings', 'caldav', 'account'],
245263
icon: '🔗',
246264
action: () => {
247-
deps.navigate('/settings?tab=sync')
265+
deps.navigate('/settings?tab=caldav')
248266
return 'Opened sync settings'
249267
},
250268
},
269+
{
270+
id: 'settings-data',
271+
label: 'Data Settings',
272+
description: 'Import and export calendar data',
273+
category: 'settings',
274+
keywords: ['data', 'import', 'export', 'backup'],
275+
icon: '💾',
276+
action: () => {
277+
deps.navigate('/settings?tab=data')
278+
return 'Opened data settings'
279+
},
280+
},
251281
{
252282
id: 'settings-theme',
253283
label: 'Theme Settings',
@@ -277,6 +307,19 @@ const createSettingsCommands = (deps: CommandFactoryDeps): Command[] => [
277307
return `Switched to ${modeLabels[nextMode]} mode`
278308
},
279309
},
310+
{
311+
id: 'debug-toggle',
312+
label: 'Toggle CalDAV Debug Mode',
313+
description: 'Enable or disable CalDAV sync debug logging',
314+
category: 'settings',
315+
keywords: ['debug', 'caldav', 'sync', 'logging', 'console'],
316+
icon: '🐛',
317+
action: () => {
318+
const newValue = !deps.caldavDebugMode
319+
deps.updateSettings?.({ caldavDebugMode: newValue })
320+
return newValue ? 'CalDAV debug mode enabled' : 'CalDAV debug mode disabled'
321+
},
322+
},
280323
]
281324

282325
export const createCommandRegistry = (deps: CommandFactoryDeps): Command[] => [

src/features/commandPalette/hooks/useCommandPalette.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export function useCommandPalette({ isOpen }: UseCommandPaletteProps) {
4545

4646
const themeMode = useSettingsStore(selectThemeMode)
4747
const updateSettings = useSettingsStore(selectUpdateSettings)
48+
const caldavDebugMode = useSettingsStore((state) => state.caldavDebugMode)
4849

4950
const { syncAll, createEvent: createCalDAVEvent } = useCalDAV()
5051

@@ -55,10 +56,20 @@ export function useCommandPalette({ isOpen }: UseCommandPaletteProps) {
5556
setCurrentDate,
5657
openModal,
5758
themeMode,
59+
caldavDebugMode,
5860
updateSettings,
5961
triggerSync: syncAll,
6062
})
61-
}, [navigate, setCurrentView, setCurrentDate, openModal, themeMode, updateSettings, syncAll])
63+
}, [
64+
navigate,
65+
setCurrentView,
66+
setCurrentDate,
67+
openModal,
68+
themeMode,
69+
caldavDebugMode,
70+
updateSettings,
71+
syncAll,
72+
])
6273

6374
const parseInput = useCallback((input: string): ParsedInput => {
6475
const trimmed = input.trim().toLowerCase()

0 commit comments

Comments
 (0)