Skip to content

Commit 4cc4260

Browse files
committed
fix(dashboard): use theme-aware text colors in bot-config editor
The hosted bot-config editor's descriptions, card headings, status label and the file tabs (snippets.jsonc/.env/locale) rendered invisible because two legacy classes resolve wrong under Tailwind v4: `text-muted` is generated from the real `--color-muted` token (a surface color, ≈ background) instead of the foreground, and `text-white` is hardcoded white (invisible on light theme). Replace them with `text-muted-foreground` and `text-foreground`. `text-dim` already aliases to the muted foreground and is left as-is.
1 parent 56ba70a commit 4cc4260

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

components/BotConfigEditor.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,15 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
439439
<div className="bg-surface border border-borderlt rounded-xl p-6">
440440
<div className="flex items-center gap-2 mb-1">
441441
<Terminal size={18} className="text-accent" />
442-
<h2 className="text-white font-bold text-base">{t.bot_control_title}</h2>
442+
<h2 className="text-foreground font-bold text-base">{t.bot_control_title}</h2>
443443
</div>
444-
<p className="text-muted text-sm mb-5">{t.bot_control_desc}</p>
444+
<p className="text-muted-foreground text-sm mb-5">{t.bot_control_desc}</p>
445445

446446
{/* Status row */}
447447
<div className="flex items-center justify-between bg-surface2 border border-borderlt rounded-lg px-4 py-3 mb-4">
448448
<div className="flex items-center gap-2">
449449
<StatusDot status={botStatus} />
450-
<span className="text-sm text-white font-medium">{botStatus ? STATUS_LABEL[botStatus] : '—'}</span>
450+
<span className="text-sm text-foreground font-medium">{botStatus ? STATUS_LABEL[botStatus] : '—'}</span>
451451
</div>
452452
<div className="flex items-center gap-2">
453453
{botStatus === 'errored' && !showLogs && (
@@ -459,7 +459,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
459459
</button>
460460
)}
461461
<button onClick={() => fetchStatus()} disabled={statusLoading}
462-
className="text-dim hover:text-muted transition-colors p-1 rounded" title={t.bot_status_refresh}
462+
className="text-dim hover:text-muted-foreground transition-colors p-1 rounded" title={t.bot_status_refresh}
463463
>
464464
{statusLoading ? <Loader2 size={14} className="animate-spin" /> : <RefreshCw size={14} />}
465465
</button>
@@ -479,7 +479,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
479479
</div>
480480
<div className="overflow-y-auto max-h-72 p-3 bg-bg">
481481
{logsLoading ? (
482-
<div className="flex items-center gap-2 text-xs text-muted">
482+
<div className="flex items-center gap-2 text-xs text-muted-foreground">
483483
<Loader2 size={13} className="animate-spin" /> {t.bot_log_loading}
484484
</div>
485485
) : logs && logs.length > 0 ? (
@@ -529,8 +529,8 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
529529
{/* Update section */}
530530
<div className="flex items-start justify-between gap-4">
531531
<div>
532-
<p className="text-sm text-white font-medium mb-0.5">{t.bot_update_title}</p>
533-
<p className="text-xs text-muted">{t.bot_update_desc}</p>
532+
<p className="text-sm text-foreground font-medium mb-0.5">{t.bot_update_title}</p>
533+
<p className="text-xs text-muted-foreground">{t.bot_update_desc}</p>
534534
</div>
535535
<button onClick={handleUpdate} disabled={isBusy}
536536
className="msk-btn-ghost shrink-0"
@@ -555,7 +555,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
555555
<div className="flex items-center justify-between mb-1">
556556
<div className="flex items-center gap-2">
557557
<Activity size={18} className="text-accent" />
558-
<h2 className="text-white font-bold text-base">{t.bot_live_logs_title}</h2>
558+
<h2 className="text-foreground font-bold text-base">{t.bot_live_logs_title}</h2>
559559
{liveStatus === 'connected' && (
560560
<span className="flex items-center gap-1.5 text-xs font-semibold text-accent">
561561
<span className="w-1.5 h-1.5 rounded-full bg-accent animate-pulse inline-block" />
@@ -570,7 +570,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
570570
{liveOpen && liveLines.length > 0 && (
571571
<button
572572
onClick={() => setLiveLines([])}
573-
className="text-xs text-dim hover:text-muted transition-colors px-2 py-1"
573+
className="text-xs text-dim hover:text-muted-foreground transition-colors px-2 py-1"
574574
>
575575
{t.bot_live_clear}
576576
</button>
@@ -583,7 +583,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
583583
</button>
584584
</div>
585585
</div>
586-
<p className="text-muted text-sm mb-4">{t.bot_live_logs_desc}</p>
586+
<p className="text-muted-foreground text-sm mb-4">{t.bot_live_logs_desc}</p>
587587

588588
{liveOpen && (
589589
<div
@@ -609,9 +609,9 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
609609
<div className="bg-surface border border-borderlt rounded-xl p-6">
610610
<div className="flex items-center gap-2 mb-1">
611611
<FileText size={18} className="text-accent" />
612-
<h2 className="text-white font-bold text-base">{t.bot_config_title}</h2>
612+
<h2 className="text-foreground font-bold text-base">{t.bot_config_title}</h2>
613613
</div>
614-
<p className="text-muted text-sm mb-5">{t.bot_config_desc}</p>
614+
<p className="text-muted-foreground text-sm mb-5">{t.bot_config_desc}</p>
615615

616616
{/* Tabs */}
617617
<div className="flex gap-1 bg-surface2 border border-borderlt rounded-lg p-1 mb-4 w-fit">
@@ -623,15 +623,15 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
623623
return (
624624
<button key={f} onClick={() => handleTabSwitch(f)}
625625
className={`px-3 py-1.5 rounded text-xs font-mono font-semibold transition-colors ${
626-
f === activeFile ? 'bg-accent text-black' : 'text-muted hover:text-white'
626+
f === activeFile ? 'bg-accent text-black' : 'text-muted-foreground hover:text-foreground'
627627
}`}
628628
>
629629
{label}
630630
</button>
631631
)
632632
})}
633633
<button onClick={() => loadFile(activeFile)} disabled={loadingGet}
634-
className="ml-1 px-2 py-1.5 rounded text-dim hover:text-muted transition-colors" title={t.bot_reload}
634+
className="ml-1 px-2 py-1.5 rounded text-dim hover:text-muted-foreground transition-colors" title={t.bot_reload}
635635
>
636636
{loadingGet ? <Loader2 size={13} className="animate-spin" /> : <RefreshCw size={13} />}
637637
</button>
@@ -671,7 +671,7 @@ export default function BotConfigEditor({ lang, nonce }: { lang: Lang; nonce?: s
671671
<div className="border border-borderlt rounded-lg overflow-hidden mb-4">
672672
{loadingGet ? (
673673
<div className="flex items-center justify-center h-64 bg-bg">
674-
<Loader2 size={20} className="animate-spin text-muted" />
674+
<Loader2 size={20} className="animate-spin text-muted-foreground" />
675675
</div>
676676
) : (
677677
<CodeMirror

0 commit comments

Comments
 (0)