Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
fix(ui): keep white on the destructive fill readable in both themes
Sergey Kozyrenko9f40102d6a3e
diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsxindex 7b0fa1a1..565a1580 100644--- a/frontend/src/components/ui/badge.tsx+++ b/frontend/src/components/ui/badge.tsx@@ -18,7 +18,12 @@ const badgeVariants = cva(variant: {blue: 'border-blue-500/20 bg-blue-500/10 text-blue-700 hover:bg-blue-500/20 dark:text-blue-400',default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',- destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',+ // The dark fill is translucent on purpose: composited over the dark+ // ground it darkens the red, which is what keeps the white foreground+ // above AA (opaque it measures 3.71). Alphas differ per theme because+ // the same fade lightens the red over a white ground.+ destructive:+ 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/90 dark:bg-destructive/80 dark:hover:bg-destructive/70',green: 'border-green-500/20 bg-green-500/10 text-green-800 hover:bg-green-500/20 dark:text-green-400',orange: 'border-orange-500/20 bg-orange-500/10 text-orange-700 hover:bg-orange-500/20 dark:text-orange-400',outline: 'text-foreground',diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsxindex 6b96648f..1972d2ff 100644--- a/frontend/src/components/ui/button.tsx+++ b/frontend/src/components/ui/button.tsx@@ -24,7 +24,11 @@ const buttonVariants = cva(},variant: {default: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',- destructive: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',+ // Translucent dark fill on purpose — over the dark ground it darkens+ // the red, keeping the white foreground above AA (opaque it is 3.71).+ // Mirrors the destructive Badge; keep the two in step.+ destructive:+ 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 dark:bg-destructive/80 dark:hover:bg-destructive/70',ghost: 'hover:bg-accent hover:text-accent-foreground',link: 'text-primary underline-offset-4 hover:underline',outline: 'border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',diff --git a/frontend/src/components/ui/context-menu.tsx b/frontend/src/components/ui/context-menu.tsxindex d6aab07e..9f8da8a9 100644--- a/frontend/src/components/ui/context-menu.tsx+++ b/frontend/src/components/ui/context-menu.tsx@@ -75,7 +75,7 @@ function ContextMenuItem({return (<ContextMenuPrimitive.ItemclassName={cn(- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/10 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",inset && 'pl-8',className,)}diff --git a/frontend/src/components/ui/dropdown-menu.tsx b/frontend/src/components/ui/dropdown-menu.tsxindex 81347ffb..a783381d 100644--- a/frontend/src/components/ui/dropdown-menu.tsx+++ b/frontend/src/components/ui/dropdown-menu.tsx@@ -81,7 +81,7 @@ function DropdownMenuItem({return (<DropdownMenuPrimitive.ItemclassName={cn(- 'focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',+ 'focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/10 relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',inset && 'pl-8',className,)}