mirror of
https://github.com/Luchexx/wacrm.git
synced 2026-11-02 09:19:51 +00:00
fix(theme): keep status-badge token contract green (CI test)
The sweep over-tokenized the neutral status badges in the three status
data modules to bg-muted/border-border, which broke
broadcast-status.test.ts ("each variant has the dark-theme class
triple") — it asserts every badge is bg-*/10 + text-* + border-*/20.
The badge system intentionally uses fixed palette colors at low opacity
(translucent fills are mode-tolerant). Restore the original slate fills
(so dark is identical and the triple contract holds) but keep
text-muted-foreground for the label, so neutral statuses stay legible in
light mode where a solid slate-400 would be too faint on white.
- broadcast-status: draft / recipient pending
- template-status: DRAFT / PENDING_DELETION
- trigger-meta: time_based / fallback
All 400 tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1474657d03
commit
43b842efb6
@ -33,7 +33,7 @@ export const TRIGGER_META: Record<AutomationTriggerType, TriggerMeta> = {
|
||||
},
|
||||
time_based: {
|
||||
label: 'Time-Based',
|
||||
pillClass: 'border-border bg-muted text-muted-foreground',
|
||||
pillClass: 'border-slate-500/30 bg-slate-500/10 text-muted-foreground',
|
||||
},
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ export function triggerMeta(t: AutomationTriggerType | string): TriggerMeta {
|
||||
return (
|
||||
TRIGGER_META[t as AutomationTriggerType] ?? {
|
||||
label: t,
|
||||
pillClass: 'border-border bg-muted text-muted-foreground',
|
||||
pillClass: 'border-slate-500/30 bg-slate-500/10 text-muted-foreground',
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@ -5,7 +5,10 @@
|
||||
* /broadcasts/page.tsx and /broadcasts/[id]/page.tsx with slight
|
||||
* drift risk. One source of truth now.
|
||||
*
|
||||
* Dark-theme only — bg-*-500/10 + text-*-400 + border-*-500/20.
|
||||
* Badge shape: bg-*-500/10 + text-*-400 + border-*-500/20. The
|
||||
* translucent fills sit fine on both light and dark surfaces; neutral
|
||||
* statuses use text-muted-foreground so the label stays legible in
|
||||
* light mode (a solid slate-400 would be too faint on white).
|
||||
*/
|
||||
|
||||
import type { BroadcastStatus, RecipientStatus } from "@/types";
|
||||
@ -23,7 +26,7 @@ export interface StatusDisplay {
|
||||
export const broadcastStatusConfig: Record<BroadcastStatus, StatusDisplay> = {
|
||||
draft: {
|
||||
label: "Draft",
|
||||
classes: "bg-muted text-muted-foreground border-border",
|
||||
classes: "bg-slate-500/10 text-muted-foreground border-slate-500/20",
|
||||
},
|
||||
scheduled: {
|
||||
label: "Scheduled",
|
||||
@ -47,7 +50,7 @@ export const broadcastStatusConfig: Record<BroadcastStatus, StatusDisplay> = {
|
||||
export const recipientStatusConfig: Record<RecipientStatus, StatusDisplay> = {
|
||||
pending: {
|
||||
label: "Pending",
|
||||
classes: "bg-muted text-muted-foreground border-border",
|
||||
classes: "bg-slate-500/10 text-muted-foreground border-slate-500/20",
|
||||
},
|
||||
sent: {
|
||||
label: "Sent",
|
||||
|
||||
@ -20,7 +20,7 @@ export const templateStatusConfig: Record<
|
||||
> = {
|
||||
DRAFT: {
|
||||
label: 'Draft',
|
||||
classes: 'bg-muted text-muted-foreground border-border',
|
||||
classes: 'bg-slate-600/20 text-muted-foreground border-slate-600/30',
|
||||
},
|
||||
PENDING: {
|
||||
label: 'Pending',
|
||||
@ -48,6 +48,6 @@ export const templateStatusConfig: Record<
|
||||
},
|
||||
PENDING_DELETION: {
|
||||
label: 'Pending Deletion',
|
||||
classes: 'bg-muted text-muted-foreground border-border',
|
||||
classes: 'bg-slate-700/30 text-muted-foreground border-slate-700/40',
|
||||
},
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user