Skip to content

Commit 8e333cb

Browse files
fix: avoid auto-applying OpenCode config on dropdown selection
Selecting a config in the OpenCode Configurations dropdown no longer calls setDefaultConfig. The dropdown now only updates activeConfigName so users can preview or edit a config without it being applied as the default. Also replaces the icon-only Star button with a labeled Apply button that shows 'Applied' (outline, disabled) when the selected config is already the default, making the apply action explicit and visible.
1 parent 0b1d3b1 commit 8e333cb

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

frontend/src/components/settings/OpenCodeConfigManager.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useState, useEffect, useRef } from 'react'
22
import { cn } from '@/lib/utils'
3-
import { Loader2, Plus, Trash2, Edit, StarOff, Download, RotateCcw, FileText, ArrowUpCircle, History, ChevronDown } from 'lucide-react'
3+
import { Loader2, Plus, Trash2, Edit, Download, RotateCcw, FileText, ArrowUpCircle, History, ChevronDown } from 'lucide-react'
44
import { Button } from '@/components/ui/button'
55
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
66
import { Label } from '@/components/ui/label'
@@ -638,10 +638,6 @@ export function OpenCodeConfigManager({ hideHealthStatus = false }: OpenCodeConf
638638
value={activeConfigName}
639639
onValueChange={(value) => {
640640
setActiveConfigName(value)
641-
const next = configs.find((c) => c.name === value)
642-
if (next && !next.isDefault) {
643-
void setDefaultConfig(next)
644-
}
645641
}}
646642
>
647643
<SelectTrigger className="w-full sm:max-w-xs">
@@ -687,12 +683,12 @@ export function OpenCodeConfigManager({ hideHealthStatus = false }: OpenCodeConf
687683
<Edit className="h-4 w-4" />
688684
</Button>
689685
<Button
690-
variant="ghost"
691686
size="sm"
687+
variant={activeConfig?.isDefault ? 'outline' : 'default'}
692688
disabled={!activeConfig || activeConfig.isDefault || isUpdating}
693689
onClick={() => activeConfig && setDefaultConfig(activeConfig)}
694690
>
695-
<StarOff className="h-4 w-4" />
691+
{activeConfig?.isDefault ? 'Applied' : 'Apply'}
696692
</Button>
697693
<Button
698694
variant="ghost"

0 commit comments

Comments
 (0)