Skip to content

Commit 9f8ccd7

Browse files
committed
Enable preventFocusDisruption experiment by default
Set the PREVENT_FOCUS_DISRUPTION experiment to be enabled by default in experimentConfigsMap and updated related tests to reflect this change. Added a configuration reference documentation file to clarify where and how to modify key settings.
1 parent 8c0c221 commit 9f8ccd7

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Configuration Reference
2+
3+
Quick reference for where to find and modify key configurations in the Roopik IDE and roopik-roo extension.
4+
5+
## Experimental Settings (Dio Agent)
6+
7+
### Background Editing (preventFocusDisruption)
8+
9+
**Default:** `true` (enabled)
10+
11+
Prevents editor focus disruption when Dio makes file edits. Files are edited in the background without opening diff views or stealing focus.
12+
13+
**Files:**
14+
- `extensions/roopik-roo/src/shared/experiments.ts` - Default value in `experimentConfigsMap`
15+
- `extensions/roopik-roo/packages/types/src/experiment.ts` - Schema definition
16+
- `extensions/roopik-roo/webview-ui/src/i18n/locales/en/settings.json` - UI labels
17+
18+
**Tests:**
19+
- `extensions/roopik-roo/src/shared/__tests__/experiments.spec.ts`
20+
- `extensions/roopik-roo/src/shared/__tests__/experiments-preventFocusDisruption.spec.ts`
21+
22+
---
23+
24+
## Tool Definitions (MCP & Native Tools)
25+
26+
### Tool Descriptions and Parameters
27+
28+
**Files:**
29+
- `extensions/roopik-roo/src/core/prompts/tools/native-tools/roopik.ts` - OpenAI-compatible tool schemas (component_add, project_start, etc.)
30+
- `extensions/roopik-roo/src/core/prompts/tools/roopik/roopik-tools.ts` - XML-style tool descriptions and workflow documentation

extensions/roopik-roo/src/shared/__tests__/experiments-preventFocusDisruption.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ describe("PREVENT_FOCUS_DISRUPTION experiment", () => {
77

88
it("should have PREVENT_FOCUS_DISRUPTION in experimentConfigsMap", () => {
99
expect(experimentConfigsMap.PREVENT_FOCUS_DISRUPTION).toBeDefined()
10-
expect(experimentConfigsMap.PREVENT_FOCUS_DISRUPTION.enabled).toBe(false)
10+
expect(experimentConfigsMap.PREVENT_FOCUS_DISRUPTION.enabled).toBe(true) // Enabled by default
1111
})
1212

1313
it("should have PREVENT_FOCUS_DISRUPTION in experimentDefault", () => {
14-
expect(experimentDefault.preventFocusDisruption).toBe(false)
14+
expect(experimentDefault.preventFocusDisruption).toBe(true) // Enabled by default
1515
})
1616

1717
it("should correctly check if PREVENT_FOCUS_DISRUPTION is enabled", () => {
18-
// Test when experiment is disabled (default)
18+
// Test when experiment is explicitly disabled
1919
const disabledConfig = { preventFocusDisruption: false }
2020
expect(experiments.isEnabled(disabledConfig, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(false)
2121

2222
// Test when experiment is enabled
2323
const enabledConfig = { preventFocusDisruption: true }
2424
expect(experiments.isEnabled(enabledConfig, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(true)
2525

26-
// Test when experiment is not in config (should use default)
26+
// Test when experiment is not in config (should use default = true)
2727
const emptyConfig = {}
28-
expect(experiments.isEnabled(emptyConfig, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(false)
28+
expect(experiments.isEnabled(emptyConfig, EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION)).toBe(true)
2929
})
3030
})

extensions/roopik-roo/src/shared/__tests__/experiments.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe("experiments", () => {
99
it("is configured correctly", () => {
1010
expect(EXPERIMENT_IDS.PREVENT_FOCUS_DISRUPTION).toBe("preventFocusDisruption")
1111
expect(experimentConfigsMap.PREVENT_FOCUS_DISRUPTION).toMatchObject({
12-
enabled: false,
12+
enabled: true, // Enabled by default
1313
})
1414
})
1515
})

extensions/roopik-roo/src/shared/experiments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface ExperimentConfig {
1717
}
1818

1919
export const experimentConfigsMap: Record<ExperimentKey, ExperimentConfig> = {
20-
PREVENT_FOCUS_DISRUPTION: { enabled: false },
20+
PREVENT_FOCUS_DISRUPTION: { enabled: true }, // Enabled by default - prevents editor focus disruption during AI edits
2121
IMAGE_GENERATION: { enabled: false },
2222
RUN_SLASH_COMMAND: { enabled: false },
2323
MULTIPLE_NATIVE_TOOL_CALLS: { enabled: false },

0 commit comments

Comments
 (0)