Default diff editing to on for new installs

This commit is contained in:
Matt Rubens
2024-12-19 23:23:19 -05:00
parent 7e7f5276b9
commit b6b5c8e422
3 changed files with 16 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"roo-cline": patch
---
Default diff editing to on for new installs

View File

@@ -972,7 +972,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
.filter((item) => item.ts && item.task)
.sort((a, b) => b.ts - a.ts),
soundEnabled: soundEnabled ?? false,
diffEnabled: diffEnabled ?? false,
diffEnabled: diffEnabled ?? true,
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
allowedCommands,
soundVolume: soundVolume ?? 0.5,
@@ -1166,7 +1166,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
taskHistory,
allowedCommands,
soundEnabled: soundEnabled ?? false,
diffEnabled: diffEnabled ?? false,
diffEnabled: diffEnabled ?? true,
soundVolume,
browserLargeViewport: browserLargeViewport ?? false,
fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0,

View File

@@ -300,6 +300,15 @@ describe('ClineProvider', () => {
expect(state).toHaveProperty('diffEnabled')
})
test('diffEnabled defaults to true when not set', async () => {
// Mock globalState.get to return undefined for diffEnabled
(mockContext.globalState.get as jest.Mock).mockReturnValue(undefined)
const state = await provider.getState()
expect(state.diffEnabled).toBe(true)
})
test('updates sound utility when sound setting changes', async () => {
provider.resolveWebviewView(mockWebviewView)