mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix issue where sound effects setting wasn't working (#51)
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
# Roo Cline Changelog
|
# Roo Cline Changelog
|
||||||
|
|
||||||
|
## [2.1.13]
|
||||||
|
|
||||||
|
- Fix https://github.com/RooVetGit/Roo-Cline/issues/50 where sound effects were not respecting settings
|
||||||
|
|
||||||
## [2.1.12]
|
## [2.1.12]
|
||||||
|
|
||||||
- Incorporate JoziGila's [PR](https://github.com/cline/cline/pull/158) to add support for editing through diffs
|
- Incorporate JoziGila's [PR](https://github.com/cline/cline/pull/158) to add support for editing through diffs
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ A fork of Cline, an autonomous coding agent, with some added experimental config
|
|||||||
- Support for OpenRouter compression
|
- Support for OpenRouter compression
|
||||||
- Support for editing through diffs
|
- Support for editing through diffs
|
||||||
|
|
||||||
Creating a snake game with "Always approve write operations" and "Always approve browser actions":
|
Here's an example of Roo-Cline autonomously creating a snake game with "Always approve write operations" and "Always approve browser actions" turned on:
|
||||||
|
|
||||||
https://github.com/user-attachments/assets/c2bb31dc-e9b2-4d73-885d-17f1471a4987
|
https://github.com/user-attachments/assets/c2bb31dc-e9b2-4d73-885d-17f1471a4987
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "roo-cline",
|
"name": "roo-cline",
|
||||||
"version": "2.1.12",
|
"version": "2.1.13",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "roo-cline",
|
"name": "roo-cline",
|
||||||
"version": "2.1.12",
|
"version": "2.1.13",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
"@anthropic-ai/bedrock-sdk": "^0.10.2",
|
||||||
"@anthropic-ai/sdk": "^0.26.0",
|
"@anthropic-ai/sdk": "^0.26.0",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"displayName": "Roo Cline",
|
"displayName": "Roo Cline",
|
||||||
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
|
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
|
||||||
"publisher": "RooVeterinaryInc",
|
"publisher": "RooVeterinaryInc",
|
||||||
"version": "2.1.12",
|
"version": "2.1.13",
|
||||||
"icon": "assets/icons/rocket.png",
|
"icon": "assets/icons/rocket.png",
|
||||||
"galleryBanner": {
|
"galleryBanner": {
|
||||||
"color": "#617A91",
|
"color": "#617A91",
|
||||||
|
|||||||
@@ -539,6 +539,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||||||
case "soundEnabled":
|
case "soundEnabled":
|
||||||
const soundEnabled = message.bool ?? true
|
const soundEnabled = message.bool ?? true
|
||||||
await this.updateGlobalState("soundEnabled", soundEnabled)
|
await this.updateGlobalState("soundEnabled", soundEnabled)
|
||||||
|
setSoundEnabled(soundEnabled) // Add this line to update the sound utility
|
||||||
await this.postStateToWebview()
|
await this.postStateToWebview()
|
||||||
break
|
break
|
||||||
case "diffEnabled":
|
case "diffEnabled":
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ClineProvider } from '../ClineProvider'
|
import { ClineProvider } from '../ClineProvider'
|
||||||
import * as vscode from 'vscode'
|
import * as vscode from 'vscode'
|
||||||
import { ExtensionMessage, ExtensionState } from '../../../shared/ExtensionMessage'
|
import { ExtensionMessage, ExtensionState } from '../../../shared/ExtensionMessage'
|
||||||
|
import { setSoundEnabled } from '../../../utils/sound'
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
jest.mock('vscode', () => ({
|
jest.mock('vscode', () => ({
|
||||||
@@ -25,6 +26,11 @@ jest.mock('vscode', () => ({
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
// Mock sound utility
|
||||||
|
jest.mock('../../../utils/sound', () => ({
|
||||||
|
setSoundEnabled: jest.fn()
|
||||||
|
}))
|
||||||
|
|
||||||
// Mock ESM modules
|
// Mock ESM modules
|
||||||
jest.mock('p-wait-for', () => ({
|
jest.mock('p-wait-for', () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
||||||
@@ -233,4 +239,23 @@ describe('ClineProvider', () => {
|
|||||||
expect(state).toHaveProperty('soundEnabled')
|
expect(state).toHaveProperty('soundEnabled')
|
||||||
expect(state).toHaveProperty('diffEnabled')
|
expect(state).toHaveProperty('diffEnabled')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('updates sound utility when sound setting changes', async () => {
|
||||||
|
provider.resolveWebviewView(mockWebviewView)
|
||||||
|
|
||||||
|
// Get the message handler from onDidReceiveMessage
|
||||||
|
const messageHandler = (mockWebviewView.webview.onDidReceiveMessage as jest.Mock).mock.calls[0][0]
|
||||||
|
|
||||||
|
// Simulate setting sound to enabled
|
||||||
|
await messageHandler({ type: 'soundEnabled', bool: true })
|
||||||
|
expect(setSoundEnabled).toHaveBeenCalledWith(true)
|
||||||
|
expect(mockContext.globalState.update).toHaveBeenCalledWith('soundEnabled', true)
|
||||||
|
expect(mockPostMessage).toHaveBeenCalled()
|
||||||
|
|
||||||
|
// Simulate setting sound to disabled
|
||||||
|
await messageHandler({ type: 'soundEnabled', bool: false })
|
||||||
|
expect(setSoundEnabled).toHaveBeenCalledWith(false)
|
||||||
|
expect(mockContext.globalState.update).toHaveBeenCalledWith('soundEnabled', false)
|
||||||
|
expect(mockPostMessage).toHaveBeenCalled()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user