Skip to content

Commit ffb2562

Browse files
fix(settings): rename Current to Active, drop badge, fix mobile overflow
- Renames 'Current' to 'Active' in dropdown item labels and replaces the standalone green Badge with small inline text, keeping the indicator next to the dropdown without competing visual weight - Wraps the action button row in a TooltipProvider and adds Tooltip wrappers around the four action buttons so their labels remain discoverable via hover while keeping the Apply/Applied button labeled for state - Adds flex-wrap and tighter gap on mobile so the action row wraps instead of overlapping the New Config button on narrow screens - Keeps the Invalid Config Badge since it conveys validation state
1 parent 8e333cb commit ffb2562

1 file changed

Lines changed: 68 additions & 43 deletions

File tree

frontend/src/components/settings/OpenCodeConfigManager.tsx

Lines changed: 68 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
66
import { Label } from '@/components/ui/label'
77
import { Badge } from '@/components/ui/badge'
88
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
9+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
910
import { DeleteDialog } from '@/components/ui/delete-dialog'
1011
import { CreateConfigDialog } from './CreateConfigDialog'
1112
import { OpenCodeConfigEditor } from './OpenCodeConfigEditor'
@@ -647,7 +648,7 @@ export function OpenCodeConfigManager({ hideHealthStatus = false }: OpenCodeConf
647648
{configs.map((config) => (
648649
<SelectItem key={config.id} value={config.name}>
649650
{config.name}
650-
{config.isDefault && ' (Current)'}
651+
{config.isDefault && ' (Active)'}
651652
{!config.isValid && ' (Invalid)'}
652653
</SelectItem>
653654
))}
@@ -656,54 +657,78 @@ export function OpenCodeConfigManager({ hideHealthStatus = false }: OpenCodeConf
656657

657658
<div className="flex items-center gap-2">
658659
{activeConfig?.isDefault && (
659-
<Badge variant="default" className="text-green-500 bg-green-500/10">
660-
Current
661-
</Badge>
660+
<span className="text-xs font-medium text-green-600 dark:text-green-400">
661+
Active
662+
</span>
662663
)}
663664
{activeConfig && !activeConfig.isValid && (
664665
<Badge variant="destructive">Invalid Config</Badge>
665666
)}
666667
</div>
667668

668-
<div className="flex items-center gap-2 sm:ml-auto">
669-
<Button
670-
variant="ghost"
671-
size="sm"
672-
disabled={!activeConfig}
673-
onClick={() => activeConfig && downloadConfig(activeConfig)}
674-
>
675-
<Download className="h-4 w-4" />
676-
</Button>
677-
<Button
678-
variant="ghost"
679-
size="sm"
680-
disabled={!activeConfig}
681-
onClick={() => activeConfig && startEdit(activeConfig)}
682-
>
683-
<Edit className="h-4 w-4" />
684-
</Button>
685-
<Button
686-
size="sm"
687-
variant={activeConfig?.isDefault ? 'outline' : 'default'}
688-
disabled={!activeConfig || activeConfig.isDefault || isUpdating}
689-
onClick={() => activeConfig && setDefaultConfig(activeConfig)}
690-
>
691-
{activeConfig?.isDefault ? 'Applied' : 'Apply'}
692-
</Button>
693-
<Button
694-
variant="ghost"
695-
size="sm"
696-
disabled={!activeConfig}
697-
className="text-red-500 hover:text-red-600"
698-
onClick={() => activeConfig && setDeleteConfirmConfig(activeConfig)}
699-
>
700-
<Trash2 className="h-4 w-4" />
701-
</Button>
702-
<Button size="sm" onClick={() => setIsCreateDialogOpen(true)}>
703-
<Plus className="h-3 w-3 sm:h-4 sm:w-4 mr-1" />
704-
<span className="text-xs sm:text-sm">New Config</span>
705-
</Button>
706-
</div>
669+
<TooltipProvider delayDuration={200}>
670+
<div className="flex items-center gap-1 sm:gap-1.5 sm:ml-auto flex-wrap">
671+
<Tooltip>
672+
<TooltipTrigger asChild>
673+
<Button
674+
variant="ghost"
675+
size="sm"
676+
disabled={!activeConfig}
677+
onClick={() => activeConfig && downloadConfig(activeConfig)}
678+
>
679+
<Download className="h-4 w-4" />
680+
</Button>
681+
</TooltipTrigger>
682+
<TooltipContent side="bottom">Download</TooltipContent>
683+
</Tooltip>
684+
<Tooltip>
685+
<TooltipTrigger asChild>
686+
<Button
687+
variant="ghost"
688+
size="sm"
689+
disabled={!activeConfig}
690+
onClick={() => activeConfig && startEdit(activeConfig)}
691+
>
692+
<Edit className="h-4 w-4" />
693+
</Button>
694+
</TooltipTrigger>
695+
<TooltipContent side="bottom">Edit</TooltipContent>
696+
</Tooltip>
697+
<Tooltip>
698+
<TooltipTrigger asChild>
699+
<Button
700+
size="sm"
701+
variant={activeConfig?.isDefault ? 'outline' : 'default'}
702+
disabled={!activeConfig || activeConfig.isDefault || isUpdating}
703+
onClick={() => activeConfig && setDefaultConfig(activeConfig)}
704+
>
705+
{activeConfig?.isDefault ? 'Applied' : 'Apply'}
706+
</Button>
707+
</TooltipTrigger>
708+
<TooltipContent side="bottom">
709+
{activeConfig?.isDefault ? 'Applied' : 'Apply as default'}
710+
</TooltipContent>
711+
</Tooltip>
712+
<Tooltip>
713+
<TooltipTrigger asChild>
714+
<Button
715+
variant="ghost"
716+
size="sm"
717+
disabled={!activeConfig}
718+
className="text-red-500 hover:text-red-600"
719+
onClick={() => activeConfig && setDeleteConfirmConfig(activeConfig)}
720+
>
721+
<Trash2 className="h-4 w-4" />
722+
</Button>
723+
</TooltipTrigger>
724+
<TooltipContent side="bottom">Delete</TooltipContent>
725+
</Tooltip>
726+
<Button size="sm" onClick={() => setIsCreateDialogOpen(true)}>
727+
<Plus className="h-3 w-3 sm:h-4 sm:w-4 mr-1" />
728+
<span className="text-xs sm:text-sm">New Config</span>
729+
</Button>
730+
</div>
731+
</TooltipProvider>
707732
</div>
708733

709734
{activeConfig && (

0 commit comments

Comments
 (0)