Skip to content

Commit 6d15f53

Browse files
authored
Merge pull request #186 from RooVetGit/default_diff_editing_to_on
Default diff editing to on for new installs
2 parents d85d2e4 + b6b5c8e commit 6d15f53

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
Default diff editing to on for new installs

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
972972
.filter((item) => item.ts && item.task)
973973
.sort((a, b) => b.ts - a.ts),
974974
soundEnabled: soundEnabled ?? false,
975-
diffEnabled: diffEnabled ?? false,
975+
diffEnabled: diffEnabled ?? true,
976976
shouldShowAnnouncement: lastShownAnnouncementId !== this.latestAnnouncementId,
977977
allowedCommands,
978978
soundVolume: soundVolume ?? 0.5,
@@ -1166,7 +1166,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
11661166
taskHistory,
11671167
allowedCommands,
11681168
soundEnabled: soundEnabled ?? false,
1169-
diffEnabled: diffEnabled ?? false,
1169+
diffEnabled: diffEnabled ?? true,
11701170
soundVolume,
11711171
browserLargeViewport: browserLargeViewport ?? false,
11721172
fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0,

src/core/webview/__tests__/ClineProvider.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ describe('ClineProvider', () => {
300300
expect(state).toHaveProperty('diffEnabled')
301301
})
302302

303+
test('diffEnabled defaults to true when not set', async () => {
304+
// Mock globalState.get to return undefined for diffEnabled
305+
(mockContext.globalState.get as jest.Mock).mockReturnValue(undefined)
306+
307+
const state = await provider.getState()
308+
309+
expect(state.diffEnabled).toBe(true)
310+
})
311+
303312
test('updates sound utility when sound setting changes', async () => {
304313
provider.resolveWebviewView(mockWebviewView)
305314

0 commit comments

Comments
 (0)