fix: make Restore Default Themes command always enabled in Cmd+K palette
The enabled guard `!!onRestoreDefaultThemes` could evaluate to false at runtime, hiding the command from the palette. Since the handler is always defined via useCallback, the guard is unnecessary. Changed to enabled: true, matching the pattern used by other always-available commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -715,11 +715,11 @@ describe('useCommandRegistry', () => {
|
||||
expect(cmd!.enabled).toBe(true)
|
||||
})
|
||||
|
||||
it('is disabled when onRestoreDefaultThemes is not provided', () => {
|
||||
it('is always enabled even when onRestoreDefaultThemes is not provided', () => {
|
||||
const { result } = renderHook(() => useCommandRegistry(makeConfig()))
|
||||
const cmd = result.current.find(c => c.id === 'restore-default-themes')
|
||||
expect(cmd).toBeDefined()
|
||||
expect(cmd!.enabled).toBe(false)
|
||||
expect(cmd!.enabled).toBe(true)
|
||||
})
|
||||
|
||||
it('calls onRestoreDefaultThemes when executed', () => {
|
||||
|
||||
Reference in New Issue
Block a user