fix(webui): clarify compact text hierarchy

Replace 145 scattered 10px and 11px declarations with semantic text roles across the dashboard, configuration, diagnostics, logs, and settings surfaces.

Promote instructions, errors, interactive labels, and empty states to at least 12px, raise security-sensitive and destructive warnings to 14px, and make general-purpose badges readable by default. Keep compact sizing only for dense technical metadata such as timestamps, identifiers, paths, versions, and counters.

Preserve the existing desktop density while improving Chinese text legibility and responsive behavior on narrow mobile layouts.
This commit is contained in:
DrSmoothl committed 2026-07-16 21:46:15 +08:00
1 parent 5e0cbb026b
commit 9bdc6510bd
30 files changed
+151 -151

No files matched your search

@@ -88,7 +88,7 @@ export function AccountSidebar({
>
{q.nickname || q.uin}
</div>
<div className="truncate font-mono text-[10px] text-muted-foreground tabular-nums">
<div className="truncate font-mono text-micro text-muted-foreground tabular-nums">
{q.uin}
</div>
</div>
@@ -101,7 +101,7 @@ export function AccountSidebar({
<TooltipContent side="right" sideOffset={8}>
<div className="flex flex-col leading-tight">
<span className="font-medium">{q.nickname || q.uin}</span>
<span className="font-mono text-[10px] text-muted-foreground tabular-nums">{q.uin}</span>
<span className="font-mono text-micro text-muted-foreground tabular-nums">{q.uin}</span>
</div>
</TooltipContent>
</Tooltip>
@@ -28,7 +28,7 @@ export function GeneralSettingsTab({ config, onChange }: GeneralSettingsTabProps
<Label>
内置状态命令 <code className="font-mono text-xs">#sl</code>
</Label>
<p className="mt-1 text-[11px] leading-relaxed text-muted-foreground">
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
收到纯文本 <code className="font-mono">#sl</code> 时回复 SnowLuma 版本 / 平台 / 运行时长。任何人可触发,关闭后完全不响应。
</p>
</div>
@@ -48,7 +48,7 @@ export function GeneralSettingsTab({ config, onChange }: GeneralSettingsTabProps
maxLength={32}
onChange={(e) => setStatusCommand({ trigger: e.target.value })}
/>
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
自定义触发词,默认 <code className="font-mono">#sl</code>。最长 32 字符,匹配前会去除首尾空格并转为小写。
</p>
</div>
@@ -56,7 +56,7 @@ export function GeneralSettingsTab({ config, onChange }: GeneralSettingsTabProps
<div className="flex items-start justify-between gap-3 border-t pt-3">
<div className="min-w-0">
<Label className={sc.enabled ? undefined : 'text-muted-foreground'}>不转发给下游(swallow)</Label>
<p className="mt-1 text-[11px] leading-relaxed text-muted-foreground">
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
开启后,命中的 <code className="font-mono">#sl</code> 不再投递给已连接的 Bot(仍会回复并本地记录)。默认关闭即透传。
</p>
</div>
@@ -81,7 +81,7 @@ export function GeneralSettingsTab({ config, onChange }: GeneralSettingsTabProps
setStatusCommand({ cooldownSeconds: Number.isFinite(n) && n >= 0 ? n : 0 });
}}
/>
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
同一会话在该秒数内重复 <code className="font-mono">#sl</code> 不再回复,防刷屏。<code className="font-mono">0</code> 表示不限制。
</p>
</div>
@@ -114,7 +114,7 @@ export function NodeEditDialog<K extends NetworkKind>(props: NodeEditDialogProps
>
<div className="min-w-0">
<Label className="text-sm font-medium text-foreground">启用</Label>
<p className="mt-0.5 text-[11px] leading-relaxed text-muted-foreground">
<p className="mt-0.5 text-xs leading-relaxed text-muted-foreground">
关闭后保存即可保留配置但不启动该节点
</p>
</div>
@@ -215,7 +215,7 @@ function Section({ caption, delay, children }: { caption: string; delay: number;
transition={{ duration: 0.3, delay }}
className="flex flex-col gap-1.5"
>
<span className="px-1 text-[11px] font-medium text-muted-foreground">{caption}</span>
<span className="px-1 text-xs font-medium text-muted-foreground">{caption}</span>
<div className="overflow-hidden rounded-2xl border border-border/60 bg-card/40">{children}</div>
</motion.section>
);
@@ -227,7 +227,7 @@ function SettingRow({ label, desc, children }: { label: string; desc?: string; c
<div className="flex items-center justify-between gap-4 px-4 py-3">
<div className="min-w-0">
<Label className="text-[13px] text-foreground">{label}</Label>
{desc && <p className="mt-0.5 text-[11px] leading-relaxed text-muted-foreground">{desc}</p>}
{desc && <p className="mt-0.5 text-xs leading-relaxed text-muted-foreground">{desc}</p>}
</div>
<div className="shrink-0">{children}</div>
</div>
@@ -366,7 +366,7 @@ function Field({ label, value, onChange, placeholder, type = 'text', error }: Fi
placeholder={placeholder}
className={cn(error && 'border-destructive focus-visible:ring-destructive/40')}
/>
{error && <p className="text-[11px] text-destructive">{error}</p>}
{error && <p className="text-xs text-destructive">{error}</p>}
</div>
);
}
@@ -75,7 +75,7 @@ export function NodeSummaryCard<T extends AdapterCommon>({
)}
{liveStatus && (
<span
className={cn('rounded px-1.5 py-0.5 text-[10px] font-medium', LIVE_STYLE[liveStatus.status])}
className={cn('rounded px-1.5 py-0.5 text-micro font-medium', LIVE_STYLE[liveStatus.status])}
title={liveStatus.lastError
? `${liveStatus.detail}\n${liveStatus.lastErrorAt ? new Date(liveStatus.lastErrorAt).toLocaleString() : '时间未知'} · ${liveStatus.lastError}`
: liveStatus.detail}
@@ -85,7 +85,7 @@ export function NodeSummaryCard<T extends AdapterCommon>({
)}
</div>
<div className="mt-0.5 truncate font-mono text-xs text-muted-foreground tabular-nums">{summary}</div>
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-[11px] text-muted-foreground">
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-meta text-muted-foreground">
<span>{item.messageFormat === 'string' ? 'CQ 码' : '数组'}</span>
<span aria-hidden className="text-border">·</span>
<span>{item.reportSelfMessage ? '上报自身' : '不上报自身'}</span>
@@ -110,13 +110,13 @@ export function NotificationOptIn({ selectedIds, onChange }: NotificationOptInPr
<Loader2 className="size-3.5 animate-spin" /> 加载渠道…
</div>
) : total === 0 ? (
<p className="text-[11px] text-muted-foreground">还没有全局渠道——先到「设置 → 通知」添加。</p>
<p className="text-xs text-muted-foreground">还没有全局渠道——先到「设置 → 通知」添加。</p>
) : (
<>
{/* collapsed: selected channels as removable chips */}
{!expanded &&
(selectedCount === 0 ? (
<p className="text-[11px] text-muted-foreground">未选择任何渠道。展开以选择。</p>
<p className="text-xs text-muted-foreground">未选择任何渠道。展开以选择。</p>
) : (
<div className="flex flex-wrap gap-1.5">
{selectedChips.slice(0, CHIP_CAP).map((ch) => (
@@ -136,7 +136,7 @@ export function NotificationOptIn({ selectedIds, onChange }: NotificationOptInPr
<button
type="button"
onClick={() => setExpanded(true)}
className="rounded-full px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:text-foreground"
className="rounded-full px-2 py-0.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground"
>
+{selectedCount - CHIP_CAP} 更多
</button>
@@ -155,7 +155,7 @@ export function NotificationOptIn({ selectedIds, onChange }: NotificationOptInPr
className="overflow-hidden"
>
<div className="flex flex-col gap-3 pt-1">
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
该账号上线 / 下线时向选中的渠道推送通知。渠道在「设置 → 通知」中全局定义。
</p>
@@ -172,21 +172,21 @@ export function NotificationOptIn({ selectedIds, onChange }: NotificationOptInPr
<button
type="button"
onClick={selectAll}
className="rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
className="rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
全选
</button>
<button
type="button"
onClick={clearAll}
className="rounded-md px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
className="rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
>
清空
</button>
</div>
{filtered.length === 0 ? (
<p className="py-4 text-center text-[11px] text-muted-foreground">无匹配渠道</p>
<p className="py-4 text-center text-xs text-muted-foreground">无匹配渠道</p>
) : (
<ScrollArea className="max-h-64 rounded-lg border bg-background/40">
<div className="divide-y divide-border/60">
@@ -199,10 +199,10 @@ export function NotificationOptIn({ selectedIds, onChange }: NotificationOptInPr
<div className="flex items-center gap-1.5">
<span className="truncate text-sm">{ch.name || ch.id}</span>
{!ch.enabled && (
<span className="shrink-0 text-[10px] text-muted-foreground">(已全局禁用)</span>
<span className="shrink-0 text-micro text-muted-foreground">(已全局禁用)</span>
)}
</div>
<p className="truncate text-[11px] text-muted-foreground">{ch.url}</p>
<p className="truncate text-meta text-muted-foreground">{ch.url}</p>
</div>
<ToggleSwitch
// Globally-disabled channel: lock the switch and force it off