Skip to content

Commit 8e077a2

Browse files
committed
fix: Address todo list advanced settings feedback
- Remove unnecessary todoListEnabled migration logic (no backfill needed) - Fix Advanced Settings text wrapping with proper CSS classes - Temperature and rate limit controls already under advanced settings
1 parent 195f4eb commit 8e077a2

File tree

3 files changed

+4
-67
lines changed

3 files changed

+4
-67
lines changed

src/core/config/ProviderSettingsManager.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const providerProfilesSchema = z.object({
3232
diffSettingsMigrated: z.boolean().optional(),
3333
openAiHeadersMigrated: z.boolean().optional(),
3434
consecutiveMistakeLimitMigrated: z.boolean().optional(),
35-
todoListEnabledMigrated: z.boolean().optional(),
3635
})
3736
.optional(),
3837
})
@@ -56,7 +55,6 @@ export class ProviderSettingsManager {
5655
diffSettingsMigrated: true, // Mark as migrated on fresh installs
5756
openAiHeadersMigrated: true, // Mark as migrated on fresh installs
5857
consecutiveMistakeLimitMigrated: true, // Mark as migrated on fresh installs
59-
todoListEnabledMigrated: true, // Mark as migrated on fresh installs
6058
},
6159
}
6260

@@ -123,7 +121,6 @@ export class ProviderSettingsManager {
123121
diffSettingsMigrated: false,
124122
openAiHeadersMigrated: false,
125123
consecutiveMistakeLimitMigrated: false,
126-
todoListEnabledMigrated: false,
127124
} // Initialize with default values
128125
isDirty = true
129126
}
@@ -152,12 +149,6 @@ export class ProviderSettingsManager {
152149
isDirty = true
153150
}
154151

155-
if (!providerProfiles.migrations.todoListEnabledMigrated) {
156-
await this.migrateTodoListEnabled(providerProfiles)
157-
providerProfiles.migrations.todoListEnabledMigrated = true
158-
isDirty = true
159-
}
160-
161152
if (isDirty) {
162153
await this.store(providerProfiles)
163154
}
@@ -263,18 +254,6 @@ export class ProviderSettingsManager {
263254
}
264255
}
265256

266-
private async migrateTodoListEnabled(providerProfiles: ProviderProfiles) {
267-
try {
268-
for (const [_name, apiConfig] of Object.entries(providerProfiles.apiConfigs)) {
269-
if (apiConfig.todoListEnabled === undefined) {
270-
apiConfig.todoListEnabled = true
271-
}
272-
}
273-
} catch (error) {
274-
console.error(`[MigrateTodoListEnabled] Failed to migrate todo list enabled setting:`, error)
275-
}
276-
}
277-
278257
/**
279258
* Clean model ID by removing prefix before "/"
280259
*/

src/core/config/__tests__/ProviderSettingsManager.spec.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ describe("ProviderSettingsManager", () => {
6767
diffSettingsMigrated: true,
6868
openAiHeadersMigrated: true,
6969
consecutiveMistakeLimitMigrated: true,
70-
todoListEnabledMigrated: true,
7170
},
7271
}),
7372
)
@@ -187,48 +186,6 @@ describe("ProviderSettingsManager", () => {
187186
expect(storedConfig.migrations.consecutiveMistakeLimitMigrated).toEqual(true)
188187
})
189188

190-
it("should call migrateTodoListEnabled if it has not done so already", async () => {
191-
mockSecrets.get.mockResolvedValue(
192-
JSON.stringify({
193-
currentApiConfigName: "default",
194-
apiConfigs: {
195-
default: {
196-
config: {},
197-
id: "default",
198-
todoListEnabled: undefined,
199-
},
200-
test: {
201-
apiProvider: "anthropic",
202-
todoListEnabled: undefined,
203-
},
204-
existing: {
205-
apiProvider: "anthropic",
206-
// this should not really be possible, unless someone has loaded a hand edited config,
207-
// but we don't overwrite so we'll check that
208-
todoListEnabled: false,
209-
},
210-
},
211-
migrations: {
212-
rateLimitSecondsMigrated: true,
213-
diffSettingsMigrated: true,
214-
openAiHeadersMigrated: true,
215-
consecutiveMistakeLimitMigrated: true,
216-
todoListEnabledMigrated: false,
217-
},
218-
}),
219-
)
220-
221-
await providerSettingsManager.initialize()
222-
223-
// Get the last call to store, which should contain the migrated config
224-
const calls = mockSecrets.store.mock.calls
225-
const storedConfig = JSON.parse(calls[calls.length - 1][1])
226-
expect(storedConfig.apiConfigs.default.todoListEnabled).toEqual(true)
227-
expect(storedConfig.apiConfigs.test.todoListEnabled).toEqual(true)
228-
expect(storedConfig.apiConfigs.existing.todoListEnabled).toEqual(false)
229-
expect(storedConfig.migrations.todoListEnabledMigrated).toEqual(true)
230-
})
231-
232189
it("should throw error if secrets storage fails", async () => {
233190
mockSecrets.get.mockRejectedValue(new Error("Storage failed"))
234191

webview-ui/src/components/settings/ApiOptions.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,10 @@ const ApiOptions = ({
751751

752752
{!fromWelcomeView && (
753753
<Collapsible open={isAdvancedSettingsOpen} onOpenChange={setIsAdvancedSettingsOpen}>
754-
<CollapsibleTrigger className="flex items-center gap-1 w-full cursor-pointer hover:opacity-80 mb-2">
755-
<span className={`codicon codicon-chevron-${isAdvancedSettingsOpen ? "down" : "right"}`}></span>
756-
<span className="font-medium">{t("settings:advancedSettings.title")}</span>
754+
<CollapsibleTrigger className="flex items-center gap-2 w-full cursor-pointer hover:opacity-80 mb-2">
755+
<span
756+
className={`codicon codicon-chevron-${isAdvancedSettingsOpen ? "down" : "right"} flex-shrink-0`}></span>
757+
<span className="font-medium whitespace-nowrap">{t("settings:advancedSettings.title")}</span>
757758
</CollapsibleTrigger>
758759
<CollapsibleContent className="space-y-3">
759760
<TodoListSettingsControl

0 commit comments

Comments
 (0)