fix: improve dark material picker contrast
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-19 13:23:47 +08:00
parent 87a6e6561d
commit 5d1d2eb653

View File

@ -84,8 +84,8 @@ export function AgentWorkflowMaterialPicker({
)}
>
<div className="space-y-1">
<div className={cn("text-sm font-medium", isDark ? "text-white/88" : "")}>{title}</div>
<div className={cn("text-xs", isDark ? "text-white/50" : "text-muted-foreground")}>
<div className={cn("text-sm font-medium", isDark ? "text-white/92" : "")}>{title}</div>
<div className={cn("text-xs", isDark ? "text-white/62" : "text-muted-foreground")}>
{description}
</div>
</div>
@ -136,7 +136,10 @@ export function AgentWorkflowMaterialPicker({
type="button"
onClick={onSearch}
disabled={disabled || isLoading || !value.trim()}
className={cn(isDark && "border-white/12 bg-white/8 text-white hover:bg-white/12")}
className={cn(
isDark &&
"border-white/12 bg-white/[0.05] text-white/85 hover:bg-white/[0.11] hover:text-white disabled:text-white/40"
)}
>
{isLoading ? (
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
@ -148,7 +151,7 @@ export function AgentWorkflowMaterialPicker({
</div>
{searchNote ? (
<div className={cn("text-xs", isDark ? "text-white/42" : "text-muted-foreground")}>
<div className={cn("text-xs", isDark ? "text-white/56" : "text-muted-foreground")}>
{searchNote}
</div>
) : null}
@ -178,7 +181,7 @@ export function AgentWorkflowMaterialPicker({
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/70" : "bg-background"
isDark ? "bg-white/8 text-white/82" : "bg-background"
)}
>
命中:{result.matchedSku || result.query}
@ -187,7 +190,7 @@ export function AgentWorkflowMaterialPicker({
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/70" : "bg-background"
isDark ? "bg-white/8 text-white/82" : "bg-background"
)}
>
SPU:{result.matchedSpu}
@ -197,27 +200,27 @@ export function AgentWorkflowMaterialPicker({
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/70" : "bg-background"
isDark ? "bg-white/8 text-white/82" : "bg-background"
)}
>
型号:{result.productModel}
</span>
) : null}
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/70" : "bg-background"
)}
>
共 {result.totalCount} 张
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/82" : "bg-background"
)}
>
共 {result.totalCount} 张
</span>
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/70" : "bg-background"
)}
>
已选 {selectedCount} 张
<span
className={cn(
"rounded-full px-2 py-1",
isDark ? "bg-white/8 text-white/82" : "bg-background"
)}
>
已选 {selectedCount} 张
</span>
</div>
<div className="flex items-center gap-2">
@ -227,6 +230,10 @@ export function AgentWorkflowMaterialPicker({
size="sm"
onClick={handleSelectAll}
disabled={!result.images?.length}
className={cn(
isDark &&
"border-white/12 bg-white/[0.04] text-white/82 hover:bg-white/[0.10] hover:text-white disabled:text-white/35"
)}
>
全选
</Button>
@ -236,6 +243,10 @@ export function AgentWorkflowMaterialPicker({
size="sm"
onClick={() => onSelectedImageIdsChange([])}
disabled={selectedCount === 0}
className={cn(
isDark &&
"border-white/12 bg-white/[0.04] text-white/82 hover:bg-white/[0.10] hover:text-white disabled:text-white/35"
)}
>
清空已选
</Button>
@ -276,10 +287,10 @@ export function AgentWorkflowMaterialPicker({
)}
</div>
<div className="min-w-0 flex-1">
<div className={cn("truncate text-sm font-medium", isDark ? "text-white/88" : "")}>
<div className={cn("truncate text-sm font-medium", isDark ? "text-white/92" : "")}>
{option.skuName}
</div>
<div className={cn("mt-1 text-[11px]", isDark ? "text-white/45" : "text-muted-foreground")}>
<div className={cn("mt-1 text-[11px]", isDark ? "text-white/62" : "text-muted-foreground")}>
{option.hasWhiteBackground
? `已有 ${option.whiteBackgroundCount} 张白底图`
: "暂无白底图"}
@ -291,6 +302,10 @@ export function AgentWorkflowMaterialPicker({
variant="outline"
disabled={!option.hasWhiteBackground}
onClick={() => onSkuOptionSelect?.(option.skuName)}
className={cn(
isDark &&
"border-white/12 bg-white/[0.04] text-white/88 hover:bg-white/[0.10] hover:text-white disabled:text-white/35"
)}
>
选择SKU
</Button>
@ -358,10 +373,10 @@ export function AgentWorkflowMaterialPicker({
</div>
</div>
<div className="space-y-1 px-3 py-2">
<div className={cn("truncate text-xs font-medium", isDark ? "text-white/85" : "")}>
<div className={cn("truncate text-xs font-medium", isDark ? "text-white/88" : "")}>
{image.fileName}
</div>
<div className={cn("text-[11px]", isDark ? "text-white/45" : "text-muted-foreground")}>
<div className={cn("text-[11px]", isDark ? "text-white/60" : "text-muted-foreground")}>
点击{selected ? "取消" : "选择"},可多选带入生图模式
</div>
</div>
@ -376,7 +391,7 @@ export function AgentWorkflowMaterialPicker({
className={cn(
"flex min-h-[124px] flex-col items-center justify-center rounded-[24px] border border-dashed px-4 text-center text-sm",
isDark
? "border-white/12 bg-white/[0.03] text-white/42"
? "border-white/12 bg-white/[0.03] text-white/56"
: "bg-background/60 text-muted-foreground"
)}
>
@ -403,7 +418,7 @@ export function AgentWorkflowMaterialPicker({
<div
className={cn(
"flex items-start gap-2 rounded-[20px] px-3 py-2 text-xs",
isDark ? "bg-white/[0.04] text-white/45" : "bg-background text-muted-foreground"
isDark ? "bg-white/[0.04] text-white/60" : "bg-background text-muted-foreground"
)}
>
<RefreshCw className="mt-0.5 h-3.5 w-3.5 shrink-0" />