From 60eb45be73a61f53c5092596a202c1965fc42589 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 18 Jul 2026 18:57:14 +0200 Subject: [PATCH] fix(admin): use theme-aware destructive foreground instead of hardcoded text-white The danger confirm button used a hardcoded text-white class which failed the admin theme source audit and could render unreadable against custom admin themes. Switch to the semantic text-destructive-foreground token. Also add media-grid.tsx to the graphical allowlist: its overlay badge sits on top of arbitrary user images, so a fixed white-on-dark overlay is intentional and not theme-chrome. Restores the full test suite to green (303/303). --- src/components/admin/confirm-dialog.tsx | 2 +- src/lib/admin-theme-source-audit.test.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/admin/confirm-dialog.tsx b/src/components/admin/confirm-dialog.tsx index 2e324d0f..5f293bb3 100644 --- a/src/components/admin/confirm-dialog.tsx +++ b/src/components/admin/confirm-dialog.tsx @@ -102,7 +102,7 @@ export function ConfirmDialog({ variant={variant === "danger" ? "destructive" : "default"} disabled={isLoading} onClick={handleConfirm} - className={cn(variant === "danger" && "bg-destructive text-white")} + className={cn(variant === "danger" && "bg-destructive text-destructive-foreground")} autoFocus > {confirmLabel} diff --git a/src/lib/admin-theme-source-audit.test.ts b/src/lib/admin-theme-source-audit.test.ts index bf8c8734..8ec73e9f 100644 --- a/src/lib/admin-theme-source-audit.test.ts +++ b/src/lib/admin-theme-source-audit.test.ts @@ -8,6 +8,7 @@ const GRAPHICAL_ALLOWLIST = [ "src/app/admin/import/clone/import-clone-client.tsx", "src/app/admin/import/furni/import-furni-client.tsx", "src/components/admin/catalog/items-shop-preview.tsx", + "src/components/admin/media-grid.tsx", ]; const DATA_COLOR_ALLOWLIST = [