|
1 | 1 | ## For All Settings |
2 | 2 |
|
3 | | -1. Add the setting to ExtensionMessage.ts: |
| 3 | +1. Add the setting to schema definitions: |
4 | 4 |
|
5 | | - - Add the setting to the ExtensionState interface |
6 | | - - Make it required if it has a default value, optional if it can be undefined |
7 | | - - Example: `preferredLanguage: string` |
| 5 | + - Add the item to `globalSettingsSchema` in `schemas/index.ts` |
| 6 | + - Add the item to `globalSettingsRecord` in `schemas/index.ts` |
| 7 | + - Example: `terminalCommandDelay: z.number().optional(),` |
8 | 8 |
|
9 | | -2. Add test coverage: |
| 9 | +2. Add the setting to type definitions: |
| 10 | + |
| 11 | + - Add the item to `exports/types.ts` |
| 12 | + - Add the item to `exports/roo-code.d.ts` |
| 13 | + - Add the setting to `shared/ExtensionMessage.ts` |
| 14 | + - Add the setting to the WebviewMessage type in `shared/WebviewMessage.ts` |
| 15 | + - Example: `terminalCommandDelay?: number | undefined` |
| 16 | + |
| 17 | +3. Add test coverage: |
10 | 18 | - Add the setting to mockState in ClineProvider.test.ts |
11 | 19 | - Add test cases for setting persistence and state updates |
12 | 20 | - Ensure all tests pass before submitting changes |
|
64 | 72 | ``` |
65 | 73 |
|
66 | 74 | 5. Add the setting to handleSubmit in SettingsView.tsx: |
67 | | - - Add a vscode.postMessage call to send the setting's value when clicking Done |
| 75 | + - Add a vscode.postMessage call to send the setting's value when clicking Save |
| 76 | + - This step is critical for persistence - without it, the setting will not be saved when the user clicks Save |
68 | 77 | - Example: |
69 | 78 | ```typescript |
70 | 79 | vscode.postMessage({ type: "multisearchDiffEnabled", bool: multisearchDiffEnabled }) |
|
98 | 107 | - Add the setting to the return value in getState with a default value |
99 | 108 | - Add the setting to the destructured variables in getStateToPostToWebview |
100 | 109 | - Add the setting to the return value in getStateToPostToWebview |
| 110 | + - This step is critical for UI display - without it, the setting will not be displayed in the UI |
101 | 111 | - Add a case in setWebviewMessageListener to handle the setting's message type |
102 | 112 | - Example: |
103 | 113 | ```typescript |
|
0 commit comments