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
@@ -92,11 +92,11 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf
() => accounts.length === 0
? [{ value: '', label: '(无在线账号)' }]
: accounts.map((a) => ({
value: a.uin,
label: a.nickname || a.uin,
sub: a.nickname ? a.uin : undefined,
avatar: qqAvatarUrl(a.uin),
})),
value: a.uin,
label: a.nickname || a.uin,
sub: a.nickname ? a.uin : undefined,
avatar: qqAvatarUrl(a.uin),
})),
[accounts],
);
@@ -244,10 +244,10 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf
{doc && (
<div className="-mt-1 flex flex-wrap items-center gap-2 text-[12px] text-muted-foreground">
{doc.readOnly
? <span className="inline-flex items-center gap-1 rounded-md bg-emerald-500/12 px-1.5 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300"><ShieldCheck className="h-3 w-3" /> 只读·安全</span>
: <span className="inline-flex items-center gap-1 rounded-md bg-amber-500/12 px-1.5 py-0.5 text-[11px] font-medium text-amber-700 dark:text-amber-300"><AlertTriangle className="h-3 w-3" /> 有副作用</span>}
{isStream && <span className="inline-flex items-center gap-1 rounded-md bg-primary/12 px-1.5 py-0.5 text-[11px] font-medium text-primary"><Zap className="h-3 w-3" /> 流式</span>}
<span>{doc.summary}{doc.returns ? <> · 返回 <code className="font-mono text-[11px]">{doc.returns}</code></> : null}</span>
? <span className="inline-flex items-center gap-1 rounded-md bg-emerald-500/12 px-1.5 py-0.5 text-xs font-medium text-emerald-700 dark:text-emerald-300"><ShieldCheck className="h-3 w-3" /> 只读·安全</span>
: <span className="inline-flex items-center gap-1 rounded-md bg-amber-500/12 px-2 py-0.5 text-sm font-semibold text-amber-700 dark:text-amber-300"><AlertTriangle className="h-3.5 w-3.5" /> 有副作用</span>}
{isStream && <span className="inline-flex items-center gap-1 rounded-md bg-primary/12 px-1.5 py-0.5 text-xs font-medium text-primary"><Zap className="h-3 w-3" /> 流式</span>}
<span>{doc.summary}{doc.returns ? <> · 返回 <code className="font-mono text-meta">{doc.returns}</code></> : null}</span>
</div>
)}
@@ -273,11 +273,11 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf
if (p.role === 'group_id' && doc) for (const mp of doc.params) if (mp.role === 'member_id') next[mp.name] = '';
return next;
})} />
{p.desc && <span className="text-[11px] text-muted-foreground/70">{p.desc}</span>}
{p.desc && <span className="text-xs text-muted-foreground/70">{p.desc}</span>}
</Field>
))}
{doc!.invariants && doc!.invariants.length > 0 && (
<p className="text-[11px] text-muted-foreground/70">约束:{doc!.invariants.join(';')}</p>
<p className="text-xs text-muted-foreground/70">约束:{doc!.invariants.join(';')}</p>
)}
</div>
)}
@@ -317,7 +317,7 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf
className="group flex items-center gap-2 rounded-lg px-2.5 py-2 text-left text-[13px] hover:bg-muted/50">
<span className={cn('h-1.5 w-1.5 shrink-0 rounded-full', rec.ok ? 'bg-emerald-500' : 'bg-destructive')} />
<span className="min-w-0 flex-1 truncate font-mono">{rec.action}</span>
<span className="shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums">{rec.uin}</span>
<span className="shrink-0 font-mono text-meta text-muted-foreground tabular-nums">{rec.uin}</span>
<span className="shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"><RotateCcw className="h-3.5 w-3.5" /></span>
</button>
))}
@@ -86,7 +86,7 @@ export function FileSource({ value, onChange, role, placeholder }: {
{mode === 'server' && (
<div className="flex flex-col gap-1">
<Input value={value} onChange={(e) => onChange(e.target.value)} placeholder="/path/on/server/file.jpg" />
<span className="text-[11px] text-muted-foreground">这是 <strong>运行 bot 的服务器</strong> 上的路径,不是你本机的。</span>
<span className="text-xs text-muted-foreground">这是 <strong>运行 bot 的服务器</strong> 上的路径,不是你本机的。</span>
</div>
)}
@@ -108,13 +108,13 @@ export function FileSource({ value, onChange, role, placeholder }: {
{uploading ? <><Loader2 className="h-4 w-4 animate-spin" /> 上传中…</> : <><FileUp className="h-4 w-4" /> 选择文件上传到服务器</>}
</button>
{value && uploadName && !uploading && (
<div className="flex items-center gap-2 rounded-lg bg-muted/40 px-2.5 py-1.5 text-[11px]">
<div className="flex items-center gap-2 rounded-lg bg-muted/40 px-2.5 py-1.5 text-meta">
<span className="truncate text-muted-foreground">已上传:{uploadName}</span>
<code className="ml-auto max-w-[55%] truncate font-mono text-muted-foreground/80" title={value}>{value}</code>
<button type="button" onClick={() => { onChange(''); setUploadName(null); }} className="shrink-0 text-muted-foreground hover:text-destructive"><X className="h-3.5 w-3.5" /></button>
</div>
)}
{uploadErr && <span className="text-[11px] text-destructive">{uploadErr}</span>}
{uploadErr && <span className="text-xs text-destructive">{uploadErr}</span>}
</div>
)}
</div>
@@ -65,7 +65,7 @@ function StreamRowItem({ row }: { row: StreamRow }) {
const time = new Date(row.at).toLocaleTimeString('zh-CN', { hour12: false });
if (msg.kind === 'dropped') {
return <div className="px-2 py-1.5 text-[11px] text-amber-600 dark:text-amber-400">因客户端过慢丢弃了 {msg.count} 条</div>;
return <div className="px-2 py-1.5 text-xs text-amber-600 dark:text-amber-400">因客户端过慢丢弃了 {msg.count} 条</div>;
}
const { label, detail, isAction, ok } = rowLabel(msg);
@@ -73,14 +73,14 @@ function StreamRowItem({ row }: { row: StreamRow }) {
<div className="group rounded-xl transition-colors hover:bg-muted/40">
<button type="button" aria-expanded={open} className="flex w-full items-center gap-2.5 px-2.5 py-2 text-left text-[13px]" onClick={() => setOpen((v) => !v)}>
<ChevronRight className={cn('h-3.5 w-3.5 shrink-0 text-muted-foreground/60 transition-transform', open && 'rotate-90')} />
<span className="shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums">{time}</span>
<span className={cn('shrink-0 rounded-md px-1.5 py-0.5 text-[10px] font-semibold', isAction ? 'bg-primary/12 text-primary' : 'bg-muted text-muted-foreground')}>
<span className="shrink-0 font-mono text-meta text-muted-foreground tabular-nums">{time}</span>
<span className={cn('shrink-0 rounded-md px-1.5 py-0.5 text-micro font-semibold', isAction ? 'bg-primary/12 text-primary' : 'bg-muted text-muted-foreground')}>
{isAction ? '调用' : '事件'}
</span>
<span className="shrink-0 font-mono text-[11px] text-muted-foreground/80">{msg.uin}</span>
<span className="shrink-0 font-mono text-meta text-muted-foreground/80">{msg.uin}</span>
<span className="min-w-0 flex-1 truncate font-mono text-foreground/90">{label}</span>
{msg.kind === 'action' && (
<span className={cn('shrink-0 text-[11px] tabular-nums', ok ? 'text-success' : 'text-destructive')}>
<span className={cn('shrink-0 text-meta tabular-nums', ok ? 'text-success' : 'text-destructive')}>
{ok ? 'ok' : 'failed'} · {msg.ms}ms
</span>
)}
@@ -162,7 +162,7 @@ export function MessageBuilder({ segments, onChange, uin, groupId, depth = 0 }:
>
<GripVertical className="h-3.5 w-3.5" />
</span>
<span className="truncate text-[11px] font-semibold text-muted-foreground">{LABELS[s.k]}</span>
<span className="truncate text-xs font-semibold text-muted-foreground">{LABELS[s.k]}</span>
</span>
<div className="flex shrink-0 items-center gap-0.5">
<button type="button" onClick={() => move(i, i - 1)} disabled={i === 0} className="rounded px-1 text-muted-foreground hover:bg-muted disabled:opacity-30" title="上移">↑</button>
@@ -184,17 +184,17 @@ export function MessageBuilder({ segments, onChange, uin, groupId, depth = 0 }:
<div className="grid grid-cols-4 gap-1">
{COMMON.map((c) => (
<button key={c.k} type="button" onClick={() => add(c.k)}
className="flex flex-col items-center gap-1 rounded-lg p-2 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground">
className="flex flex-col items-center gap-1 rounded-lg p-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground">
{c.icon}{c.label}
</button>
))}
</div>
<details className="mt-1.5">
<summary className="cursor-pointer list-none px-1 text-[11px] text-muted-foreground hover:text-foreground"><span className="inline-flex items-center gap-1"><ChevronDown className="h-3 w-3" /> 进阶段</span></summary>
<summary className="cursor-pointer list-none px-1 text-xs text-muted-foreground hover:text-foreground"><span className="inline-flex items-center gap-1"><ChevronDown className="h-3 w-3" /> 进阶段</span></summary>
<div className="mt-1 grid grid-cols-4 gap-1">
{ADVANCED.map((c) => (
<button key={c.k} type="button" onClick={() => add(c.k)}
className="flex flex-col items-center gap-1 rounded-lg p-2 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground">
className="flex flex-col items-center gap-1 rounded-lg p-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground">
{c.icon}{c.label}
</button>
))}
@@ -257,11 +257,11 @@ function SegmentEditor({ seg, onChange, uin, groupId, depth }: { seg: Seg; onCha
<Input value={seg.nickname} onChange={(e) => onChange({ ...seg, nickname: e.target.value })} placeholder="发送者昵称" className="text-xs" />
</div>
<div>
<span className="mb-1 block text-[11px] text-muted-foreground">节点内容(可再嵌套)</span>
<span className="mb-1 block text-xs text-muted-foreground">节点内容(可再嵌套)</span>
{depth < 3 ? (
<MessageBuilder segments={seg.content} onChange={(c) => onChange({ ...seg, content: c })} uin={uin} groupId={groupId} depth={depth + 1} />
) : (
<p className="text-[11px] text-destructive">嵌套层级过深</p>
<p className="text-xs text-destructive">嵌套层级过深</p>
)}
</div>
</div>
@@ -35,7 +35,7 @@ function Row({ task, onDismiss }: { task: DebugTask; onDismiss: () => void }) {
</div>
)}
{task.detail && task.status !== 'running' && (
<span className="truncate text-[10px] text-muted-foreground" title={task.detail}>{task.detail}</span>
<span className="truncate text-xs text-muted-foreground" title={task.detail}>{task.detail}</span>
)}
</div>
);
@@ -64,7 +64,7 @@ export function TaskBadge() {
<div className="flex items-center justify-between border-b border-border/60 px-3 py-2">
<span className="text-xs font-semibold">调试任务</span>
{tasks.some((t) => t.status !== 'running') && (
<button type="button" onClick={clearFinished} className="text-[11px] text-muted-foreground hover:text-foreground">清除已完成</button>
<button type="button" onClick={clearFinished} className="text-xs text-muted-foreground hover:text-foreground">清除已完成</button>
)}
</div>
<div className="max-h-72 overflow-auto p-1.5">
@@ -74,9 +74,9 @@ export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
<div className={cn('min-w-0 flex-1 overflow-hidden pr-2 transition-opacity duration-200', collapsed ? 'opacity-0' : 'opacity-100')}>
<div className="flex items-baseline gap-1.5 whitespace-nowrap">
<span className="text-sm font-bold tracking-tight">{APP_NAME}</span>
<span className="text-[10px] font-medium text-muted-foreground tabular-nums">v{APP_VERSION}</span>
<span className="text-micro font-medium text-muted-foreground tabular-nums">v{APP_VERSION}</span>
</div>
<span className="block whitespace-nowrap text-[10px] text-muted-foreground">OneBot v11 控制台</span>
<span className="block whitespace-nowrap text-xs text-muted-foreground">OneBot v11 控制台</span>
</div>
</div>
@@ -85,11 +85,11 @@ export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
{editing ? (
<div className="flex flex-col gap-2 p-2">
<div className="flex items-center justify-between px-1">
<span className="text-[11px] font-medium text-muted-foreground">编辑导航</span>
<span className="text-xs font-medium text-muted-foreground">编辑导航</span>
<button
type="button"
onClick={() => setEditing(false)}
className="inline-flex items-center gap-1 rounded-md bg-primary/15 px-2 py-0.5 text-[11px] text-primary transition-colors hover:bg-primary/20 cursor-pointer"
className="inline-flex items-center gap-1 rounded-md bg-primary/15 px-2 py-0.5 text-xs text-primary transition-colors hover:bg-primary/20 cursor-pointer"
>
<Check className="size-3" /> 完成
</button>
@@ -178,7 +178,7 @@ export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
</span>
<span className={cn('relative z-10 flex min-w-0 flex-1 flex-col items-start overflow-hidden pr-3 transition-opacity duration-200', collapsed ? 'opacity-0' : 'opacity-100')}>
<span className="w-full truncate whitespace-nowrap leading-tight">{label}</span>
<span className="w-full truncate whitespace-nowrap text-[10px] font-normal text-muted-foreground">{description}</span>
<span className="w-full truncate whitespace-nowrap text-xs font-normal text-muted-foreground">{description}</span>
</span>
</Link>
);
@@ -208,7 +208,7 @@ export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
<span className="relative z-10 grid w-12 shrink-0 place-items-center"><Sparkles className="size-4 text-primary" /></span>
<span className={cn('relative z-10 flex min-w-0 flex-1 flex-col overflow-hidden pr-3 transition-opacity duration-200', collapsed ? 'opacity-0' : 'opacity-100')}>
<span className="truncate whitespace-nowrap text-xs font-medium leading-tight text-foreground">有新版本可用</span>
<span className="truncate whitespace-nowrap text-[10px] text-muted-foreground">v{updateInfo.latest} · 点击查看</span>
<span className="truncate whitespace-nowrap text-xs text-muted-foreground">v{updateInfo.latest} · 点击查看</span>
</span>
</Link>
</div>
@@ -218,7 +218,7 @@ export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
expanded; unpinning returns it to the hover-to-peek rail. Mirrors the
「钉住侧栏展开」 appearance setting. */}
<div className={cn('flex shrink-0 items-center gap-2 py-3 pl-4 pr-2.5 transition-opacity duration-200', collapsed ? 'opacity-0' : 'opacity-100')}>
<span className="min-w-0 flex-1 truncate whitespace-nowrap text-[10px] text-muted-foreground">
<span className="min-w-0 flex-1 truncate whitespace-nowrap text-micro text-muted-foreground">
© {new Date().getFullYear()} SnowLuma
</span>
{isDesktop && (
@@ -63,7 +63,7 @@ export function DeliveriesWidget() {
<p className="text-sm">暂无投递记录</p>
</div>
) : (
<div className="flex flex-col gap-1 text-[11px]">
<div className="flex flex-col gap-1 text-meta">
{records.map((r, i) => (
<div key={i} className="flex items-center gap-2 rounded px-2 py-1 hover:bg-accent/30">
{r.ok ? (
@@ -83,7 +83,7 @@ export function DeliveriesWidget() {
<span className="shrink-0 font-mono">{r.uin}</span>
<span className="ml-auto min-w-0 truncate text-muted-foreground" title={r.error ?? r.channelId}>
{r.channelId}
{!r.ok && r.error ? ` · ${r.error}` : ''}
{!r.ok && r.error && <span className="text-xs text-destructive"> · {r.error}</span>}
</span>
</div>
))}
@@ -170,7 +170,7 @@ export function ChangePasswordForm({
className="h-10 text-sm"
/>
{confirmPassword.length > 0 && !confirmMatches && (
<span className="text-[11px] text-destructive">两次输入的密码不一致</span>
<span className="text-xs text-destructive">两次输入的密码不一致</span>
)}
</div>
@@ -288,7 +288,7 @@ function HeaderBar({ selectedUin, dirty, saveStatus, saveStatusTone, onSave, act
</div>
<div className="flex flex-wrap items-center gap-3">
{(saveStatus || dirty) && (
<span className="inline-flex items-center gap-1.5 text-[11px] font-medium">
<span className="inline-flex items-center gap-1.5 text-xs font-medium">
{saveStatusTone === 'saving' ? (
<><Loader2 className="size-3.5 animate-spin text-muted-foreground" /><span className="text-muted-foreground">保存中</span></>
) : saveStatusTone === 'success' ? (
@@ -379,7 +379,7 @@ function TabStrip({ activeTab, onChange, counts }: TabStripProps) {
{count != null && (
<Badge
variant={active ? 'default' : 'secondary'}
className="h-4 px-1.5 font-mono text-[10px] tabular-nums"
className="h-4 px-1.5 font-mono text-micro tabular-nums"
>
{count}
</Badge>
@@ -111,7 +111,7 @@ export function ConsentPage({ documents, version, onAccept, onDecline }: Consent
</div>
{active && (active.declaredVersion || active.effectiveDate) && (
<p className="mt-2 text-[11px] text-muted-foreground">
<p className="mt-2 text-meta text-muted-foreground">
{active.declaredVersion && `版本 / Version ${active.declaredVersion}`}
{active.declaredVersion && active.effectiveDate && ' · '}
{active.effectiveDate && `生效 / Effective ${active.effectiveDate}`}
@@ -172,7 +172,7 @@ export function ConsentPage({ documents, version, onAccept, onDecline }: Consent
</div>
</CardContent>
</Card>
<p className="mt-3 text-center text-[10px] text-muted-foreground/70">agreements {version.slice(0, 8)}</p>
<p className="mt-3 text-center text-micro text-muted-foreground/70">agreements {version.slice(0, 8)}</p>
</motion.div>
</div>
);
@@ -103,7 +103,7 @@ export function LoginPage({ onLogin }: LoginPageProps) {
<div>
<div className="flex items-center justify-center gap-2">
<span className="text-2xl font-semibold tracking-tight">{APP_NAME}</span>
<span className="rounded-full bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary tabular-nums">v{APP_VERSION}</span>
<span className="rounded-full bg-primary/10 px-1.5 py-0.5 font-mono text-micro text-primary tabular-nums">v{APP_VERSION}</span>
</div>
<p className="mt-1 text-xs text-muted-foreground">OneBot v11 协议网关 · 安全登录</p>
</div>
@@ -155,7 +155,7 @@ export function LoginPage({ onLogin }: LoginPageProps) {
</Button>
</form>
<p className="mt-7 text-center text-[11px] text-muted-foreground">
<p className="mt-7 text-center text-meta text-muted-foreground">
© {new Date().getFullYear()} SnowLuma. All rights reserved.
</p>
</CardContent>
@@ -187,12 +187,12 @@ export function LoginPage({ onLogin }: LoginPageProps) {
<div className="flex items-center justify-between gap-4 rounded-xl border bg-muted/30 px-4 py-3">
<div className="min-w-0">
<p className="text-sm font-medium">登录页动态背景</p>
<p className="mt-0.5 text-[11px] text-muted-foreground">{fxOn ? '已开启 · 关闭后背景为静态' : '已关闭 · 背景为静态'}</p>
<p className="mt-0.5 text-xs text-muted-foreground">{fxOn ? '已开启 · 关闭后背景为静态' : '已关闭 · 背景为静态'}</p>
</div>
<ToggleSwitch value={fxOn} onChange={toggleFx} ariaLabel="登录页动态背景" />
</div>
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
登录后,你还可以在「系统设置 → 无障碍」里进一步「减弱动效」或「关闭全部动效」。
</p>
</DialogContent>
@@ -443,7 +443,7 @@ export function LogsPage() {
onClick={() => toggleLevel(lv)}
aria-pressed={active}
className={cn(
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer',
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer',
active
? cn('bg-card shadow-sm ring-1 ring-border/60', levelClass[lv])
: 'text-muted-foreground/55 hover:text-foreground',
@@ -474,7 +474,7 @@ export function LogsPage() {
<div className="mb-2 flex flex-wrap items-center gap-x-1.5 gap-y-0.5">
<SlidersHorizontal className="size-3.5 text-muted-foreground" />
<span className="text-xs font-medium text-foreground">视图预设</span>
<span className="text-[10px] text-muted-foreground">· 一键套用级别 / 行数 / 换行;手动调整后变为「自定义」</span>
<span className="text-xs text-muted-foreground">· 一键套用级别 / 行数 / 换行;手动调整后变为「自定义」</span>
</div>
<div className="inline-flex flex-wrap gap-1 rounded-lg bg-muted/60 p-1">
{LOG_PRESETS.map((p) => {
@@ -487,7 +487,7 @@ export function LogsPage() {
aria-pressed={active}
title={p.hint}
className={cn(
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40',
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40',
active ? 'bg-card text-foreground shadow-sm ring-1 ring-border/60' : 'text-muted-foreground/70 hover:text-foreground',
)}
>
@@ -497,7 +497,7 @@ export function LogsPage() {
})}
<span
className={cn(
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium',
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium',
prefs.preset === 'custom' ? 'bg-card text-foreground shadow-sm ring-1 ring-border/60' : 'text-muted-foreground/40',
)}
>
@@ -510,7 +510,7 @@ export function LogsPage() {
<div>
<div className="mb-2 flex flex-wrap items-center gap-x-1.5 gap-y-0.5">
<span className="text-xs font-medium text-foreground">服务端日志级别</span>
<span className="text-[10px] text-muted-foreground">· 仅影响控制台 / 实时流,文件始终落盘 debug</span>
<span className="text-xs text-muted-foreground">· 仅影响控制台 / 实时流,文件始终落盘 debug</span>
</div>
<div className="inline-flex flex-wrap gap-1 rounded-lg bg-muted/60 p-1">
{LEVELS.map((lv) => {
@@ -523,7 +523,7 @@ export function LogsPage() {
disabled={levelBusy || serverLevel === null}
aria-pressed={active}
className={cn(
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[11px] font-medium transition-[background-color,color,box-shadow,opacity] duration-150 ease-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50',
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-[background-color,color,box-shadow,opacity] duration-150 ease-out cursor-pointer disabled:cursor-not-allowed disabled:opacity-50',
active
? cn('bg-card shadow-sm ring-1 ring-border/60', levelClass[lv])
: 'text-muted-foreground/70 hover:text-foreground',
@@ -542,7 +542,7 @@ export function LogsPage() {
<div className="mb-2 flex flex-wrap items-center gap-x-1.5 gap-y-0.5">
<Highlighter className="size-3.5 text-muted-foreground" />
<span className="text-xs font-medium text-foreground">高亮规则</span>
<span className="text-[10px] text-muted-foreground">· 命中关键词的行会被着色</span>
<span className="text-xs text-muted-foreground">· 命中关键词的行会被着色</span>
</div>
<div className="flex flex-wrap items-center gap-2">
<Input
@@ -578,7 +578,7 @@ export function LogsPage() {
{prefs.highlightRules.length > 0 && (
<div className="mt-2.5 flex flex-wrap gap-1.5">
{prefs.highlightRules.map((r, i) => (
<span key={i} className="inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]" style={{ borderColor: colorSwatch(r.color) }}>
<span key={i} className="inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-meta" style={{ borderColor: colorSwatch(r.color) }}>
<span className="size-2 rounded-full" style={{ backgroundColor: colorSwatch(r.color) }} />
{r.keyword}
<button type="button" onClick={() => removeHighlight(i)} className="text-muted-foreground hover:text-destructive cursor-pointer" aria-label={`移除高亮规则 ${r.keyword}`}>
@@ -600,7 +600,7 @@ export function LogsPage() {
{/* Column header lives OUTSIDE the scroll viewport so the virtualizer's
scroll element contains only the rows (no sticky-offset math). */}
{filtered.length > 0 && (
<div className="hidden items-center gap-3 border-b border-border/60 bg-card/60 px-3 py-2 font-mono text-[10px] font-medium uppercase tracking-wider text-muted-foreground/70 sm:flex">
<div className="hidden items-center gap-3 border-b border-border/60 bg-card/60 px-3 py-2 font-mono text-micro font-medium uppercase tracking-wider text-muted-foreground/70 sm:flex">
<span className="w-[104px] shrink-0">时间</span>
<span className="w-[76px] shrink-0">级别</span>
<span className="w-28 shrink-0">模块</span>
@@ -665,7 +665,7 @@ export function LogsPage() {
title={prefs.wrap ? undefined : log.message}
>
{log.req !== undefined && (
<span className="mr-1.5 rounded bg-primary/10 px-1 text-[10px] text-primary tabular-nums" title="请求关联号">#{log.req}</span>
<span className="mr-1.5 rounded bg-primary/10 px-1 text-micro text-primary tabular-nums" title="请求关联号">#{log.req}</span>
)}
{log.message}
</span>
@@ -138,7 +138,7 @@ export function OverviewPage() {
</div>
{editing && (
<p className="rounded-xl border border-primary/20 bg-primary/5 px-3.5 py-2.5 text-[11px] leading-relaxed text-muted-foreground">
<p className="rounded-xl border border-primary/20 bg-primary/5 px-3.5 py-2.5 text-xs leading-relaxed text-muted-foreground">
{isWide
? '拖动卡片移动位置、拖右下角缩放,右上齿轮改设置;把卡片拖回右侧「部件库」即可移除,从部件库拖到画布即可添加。左侧导航也可在编辑态拖动排序。'
: '拖动手柄调整卡片顺序,眼睛图标显隐,齿轮改设置。手机为单列布局,与桌面网格各自独立。'}
@@ -159,7 +159,7 @@ export function OverviewPage() {
<p className="text-sm font-medium">
{loadableProcs > 0 ? `检测到 ${loadableProcs} 个可加载 QQ 进程` : '尚未接入任何账号'}
</p>
<p className="text-[11px] text-muted-foreground">
<p className="text-xs text-muted-foreground">
前往「进程注入」加载 QQ,登录后会自动接入 OneBot 流程。
</p>
</div>
@@ -329,11 +329,11 @@ function WidgetGallery({ hidden }: { hidden: UiLayoutItem[] }) {
<LayoutGrid className="size-3.5 text-primary" />
<span className="text-xs font-semibold">部件库</span>
</div>
<p className="mb-3 px-1 text-[11px] leading-snug text-muted-foreground">
<p className="mb-3 px-1 text-xs leading-snug text-muted-foreground">
拖到左侧画布添加;把卡片拖回此处即可移除。
</p>
{hidden.length === 0 ? (
<div className="rounded-lg border border-dashed px-2 py-8 text-center text-[11px] text-muted-foreground">
<div className="rounded-lg border border-dashed px-2 py-8 text-center text-xs text-muted-foreground">
全部部件已添加
</div>
) : (
@@ -480,9 +480,9 @@ function StatTile({
}) {
const copy = (
<>
<p className="truncate text-[11px] font-medium uppercase leading-tight tracking-wider text-muted-foreground">{label}</p>
<p className="truncate text-xs font-medium uppercase leading-tight tracking-wider text-muted-foreground">{label}</p>
<div className="mt-1 truncate text-lg font-semibold leading-tight tabular-nums">{value}</div>
{subtext && <p className="mt-1 truncate text-[11px] leading-tight text-muted-foreground">{subtext}</p>}
{subtext && <p className="mt-1 truncate text-xs leading-tight text-muted-foreground">{subtext}</p>}
</>
);
const body = (
@@ -617,7 +617,7 @@ function HostBlock({ config }: { config: HostConfig }) {
<Cpu className="size-4 text-primary" />
<span className="text-sm font-semibold">CPU 使用率</span>
{systemInfo && (
<span className="text-[11px] text-muted-foreground tabular-nums">{systemInfo.cpu.perCore.length} 核</span>
<span className="text-meta text-muted-foreground tabular-nums">{systemInfo.cpu.perCore.length} 核</span>
)}
</div>
<span className="text-sm font-semibold tabular-nums text-primary">
@@ -625,7 +625,7 @@ function HostBlock({ config }: { config: HostConfig }) {
</span>
</div>
<Progress value={systemInfo?.cpu.average ?? 0} />
<p className="mt-2 text-[11px] text-muted-foreground tabular-nums">
<p className="mt-2 text-meta text-muted-foreground tabular-nums">
负载: {systemInfo ? systemInfo.cpu.loadAvg.map((v) => v.toFixed(2)).join(' / ') : '—'}
</p>
{systemInfo && systemInfo.cpu.perCore.length > 0 && (
@@ -643,7 +643,7 @@ function HostBlock({ config }: { config: HostConfig }) {
}}
>
<span
className="text-[10px] leading-none tabular-nums"
className="text-micro leading-none tabular-nums"
style={{ color: 'color-mix(in oklab, var(--foreground) 55%, transparent)' }}
>
{i}
@@ -687,7 +687,7 @@ function HostBlock({ config }: { config: HostConfig }) {
/>
))}
</div>
<div className="mt-3 flex flex-wrap gap-x-3.5 gap-y-1 text-[11px] text-muted-foreground">
<div className="mt-3 flex flex-wrap gap-x-3.5 gap-y-1 text-meta text-muted-foreground">
{segs.map((seg) => (
<span key={seg.key} className="inline-flex items-center gap-1.5">
<i className="size-2 rounded-[2px]" style={{ background: seg.color }} />
@@ -791,7 +791,7 @@ function SessionsBlock({ config }: { config: SessionsConfig }) {
</Avatar>
<div className="min-w-0 flex-1">
<div className="truncate text-sm font-semibold">{q.nickname}</div>
<div className="truncate font-mono text-[11px] text-muted-foreground tabular-nums">{q.uin}</div>
<div className="truncate font-mono text-meta text-muted-foreground tabular-nums">{q.uin}</div>
</div>
<span className="size-2 shrink-0 animate-pulse rounded-full bg-success shadow-[0_0_8px_color-mix(in_oklab,var(--success)_60%,transparent)]" />
</motion.div>
@@ -873,25 +873,25 @@ function ConnectionsBlock({ config }: { config: ConnectionsConfig }) {
<div key={acc.uin} className="flex flex-col gap-2">
<div className="flex items-baseline gap-2">
<span className="text-sm font-semibold">{acc.nickname || acc.uin}</span>
<span className="font-mono text-[11px] text-muted-foreground tabular-nums">{acc.uin}</span>
<span className="font-mono text-meta text-muted-foreground tabular-nums">{acc.uin}</span>
</div>
{acc.adapters.length === 0 ? (
<p className="rounded-md border border-dashed px-3 py-2 text-[11px] text-muted-foreground">未配置任何协议端点</p>
<p className="rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground">未配置任何协议端点</p>
) : (
<div className="flex flex-col gap-1.5">
{acc.adapters.map((adp) => (
<div key={adp.name} className="flex items-center gap-2 rounded-xl border bg-card/40 px-3 py-2">
<span className={cn('shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium', CONN_STATUS_STYLE[adp.status])}>
<span className={cn('shrink-0 rounded px-1.5 py-0.5 text-micro font-medium', CONN_STATUS_STYLE[adp.status])}>
{CONN_STATUS_LABEL[adp.status]}
</span>
<div className="min-w-0 flex-1">
<div className="flex items-center gap-1.5">
<span className="truncate text-sm font-medium">{adp.name}</span>
<span className="shrink-0 text-[10px] text-muted-foreground">{ADAPTER_KIND_LABEL[adp.kind]}</span>
<span className="shrink-0 text-micro text-muted-foreground">{ADAPTER_KIND_LABEL[adp.kind]}</span>
</div>
<div className="truncate text-[11px] text-muted-foreground">{adp.detail}</div>
<div className="truncate text-meta text-muted-foreground">{adp.detail}</div>
{adp.lastError && adp.lastErrorAt && (
<div className="truncate text-[10px] text-destructive/80">
<div className="truncate text-xs text-destructive/80">
{new Date(adp.lastErrorAt).toLocaleString()} · {adp.lastError}
</div>
)}
@@ -946,7 +946,7 @@ function LinkWidget({ config }: { config: LinkConfig }) {
</div>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-semibold">{config.label || config.url}</p>
<p className="truncate text-[11px] text-muted-foreground">{config.url}</p>
<p className="truncate text-meta text-muted-foreground">{config.url}</p>
</div>
<ExternalLink className="size-4 shrink-0 text-muted-foreground/60" />
</CardContent>
@@ -977,7 +977,7 @@ function AccountWidget({ config }: { config: AccountConfig }) {
</Avatar>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-semibold">{acct?.nickname || '未接入账号'}</p>
<p className="truncate font-mono text-[11px] text-muted-foreground tabular-nums">{config.uin}</p>
<p className="truncate font-mono text-meta text-muted-foreground tabular-nums">{config.uin}</p>
</div>
<span
title={acct ? '在线' : '未接入'}
@@ -1037,7 +1037,7 @@ function RecentAlertsCard({ config }: { config: AlertsConfig }) {
</CardTitle>
<CardDescription>最近 {count} 条 · {config.levels.map((l) => l.toUpperCase()).join(' / ')}</CardDescription>
</div>
<Link to="/logs" className="inline-flex shrink-0 items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground">
<Link to="/logs" className="inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground">
查看日志 <ArrowRight className="size-3" />
</Link>
</CardHeader>
@@ -1048,7 +1048,7 @@ function RecentAlertsCard({ config }: { config: AlertsConfig }) {
<p className="text-sm">暂无告警</p>
</div>
) : (
<div className="flex flex-col gap-1 font-mono text-[11px]">
<div className="flex flex-col gap-1 font-mono text-meta">
{alerts.map((a) => (
<div key={a.id} className="flex gap-2 rounded px-2 py-1 hover:bg-accent/30">
<span className="shrink-0 text-muted-foreground tabular-nums">{formatClock(a.time)}</span>
@@ -85,7 +85,7 @@ export function ProcessesPage() {
aria-checked={active}
onClick={() => setPages({ processesSort: o.id })}
className={cn(
'rounded-md px-2.5 py-1 text-[11px] font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40',
'rounded-md px-2.5 py-1 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 ease-out cursor-pointer outline-none focus-visible:ring-[3px] focus-visible:ring-ring/40',
active ? 'bg-card font-semibold text-foreground shadow-sm ring-1 ring-border' : 'text-muted-foreground hover:text-foreground',
)}
>
@@ -115,7 +115,7 @@ export function ProcessesPage() {
<div className="flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed py-16 text-muted-foreground">
<Cpu className="size-8 opacity-40" strokeWidth={1.5} />
<p className="text-sm">未检测到可加载 QQ 主进程</p>
<p className="text-[11px] text-muted-foreground/80">请确认 QQ 已启动后点击右上角刷新</p>
<p className="text-xs text-muted-foreground/80">请确认 QQ 已启动后点击右上角刷新</p>
</div>
) : (
<div className="grid grid-cols-1 gap-3 xl:grid-cols-2 2xl:grid-cols-3">
@@ -167,17 +167,17 @@ export function ProcessesPage() {
{processStatusLabel[proc.status]}
</Badge>
</div>
<div className="mt-0.5 truncate font-mono text-[11px] text-muted-foreground tabular-nums">
<div className="mt-0.5 truncate font-mono text-meta text-muted-foreground tabular-nums">
PID {proc.pid}
{proc.uin && proc.uin !== '0' ? ` · UIN ${proc.uin}` : ''}
</div>
{proc.path && (
<div className="truncate text-[11px] text-muted-foreground/80" title={proc.path}>
<div className="truncate text-meta text-muted-foreground/80" title={proc.path}>
{proc.path}
</div>
)}
{proc.error && (
<div className="mt-0.5 truncate text-[11px] text-destructive" title={proc.error}>
<div className="mt-0.5 truncate text-xs text-destructive" title={proc.error}>
{proc.error}
</div>
)}
@@ -137,7 +137,7 @@ function SettingsNav({ tab, onChange }: { tab: SettingsTab; onChange: (t: Settin
<p
id={`settings-nav-group-${gi}`}
className={cn(
'hidden select-none px-3 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60 lg:block',
'hidden select-none px-3 pb-0.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 lg:block',
gi === 0 ? 'lg:pt-1' : 'lg:pt-3',
)}
>
@@ -404,7 +404,7 @@ function AppearancePanel() {
))}
</span>
</span>
<span className="text-[11px] font-medium">{p.label}</span>
<span className="text-xs font-medium">{p.label}</span>
</button>
);
})}
@@ -499,7 +499,7 @@ function AppearancePanel() {
</SettingRow>
<SettingRow label={`界面缩放(${Math.round(a.uiScale * 100)}%)`} hint="整体放大或缩小界面,适合高分屏或视力需要。" layout="stack">
<div className="flex items-center gap-3">
<span className="text-[11px] text-muted-foreground tabular-nums">{Math.round(UI_SCALE.min * 100)}%</span>
<span className="text-meta text-muted-foreground tabular-nums">{Math.round(UI_SCALE.min * 100)}%</span>
<Slider
min={UI_SCALE.min}
max={UI_SCALE.max}
@@ -509,7 +509,7 @@ function AppearancePanel() {
className="flex-1"
aria-label="界面缩放"
/>
<span className="text-[11px] text-muted-foreground tabular-nums">{Math.round(UI_SCALE.max * 100)}%</span>
<span className="text-meta text-muted-foreground tabular-nums">{Math.round(UI_SCALE.max * 100)}%</span>
</div>
</SettingRow>
<SettingRow label="显示密度">
@@ -755,7 +755,7 @@ function FontField({
{fonts.map((f) => <option key={f} value={f} />)}
</datalist>
)}
<p className="text-[11px] leading-snug text-muted-foreground">
<p className="text-xs leading-snug text-muted-foreground">
{canQuery
? '可输入字体名称,或聚焦后从已安装字体中选择;找不到时回退到系统字体。'
: '输入已安装的字体名称(可写多个,用逗号分隔);找不到时回退到系统字体。'}
@@ -804,12 +804,12 @@ function ThemeVarsPanel({
{CSS_VAR_FIELDS.map((f) => {
const override = cssVars[f.token];
return (
<SettingRow key={f.token} label={f.label} hint={<code className="font-mono text-[11px]">{f.token}</code>} layout="inline">
<SettingRow key={f.token} label={f.label} hint={<code className="font-mono text-meta">{f.token}</code>} layout="inline">
<div className="flex items-center gap-2.5">
{override ? (
<span className="font-mono text-[11px] text-muted-foreground tabular-nums">{override}</span>
<span className="font-mono text-meta text-muted-foreground tabular-nums">{override}</span>
) : (
<span className="text-[11px] text-muted-foreground">默认</span>
<span className="text-meta text-muted-foreground">默认</span>
)}
<label
title="选择颜色"
@@ -839,7 +839,7 @@ function ThemeVarsPanel({
})}
{count > 0 && (
<div className="flex items-center justify-between gap-4 px-5 py-3">
<span className="text-[11px] text-muted-foreground">已覆盖 {count} 个变量</span>
<span className="text-meta text-muted-foreground">已覆盖 {count} 个变量</span>
<Button variant="ghost" size="sm" onClick={() => onChange({})} className="text-destructive hover:text-destructive">
<RotateCcw className="size-4" /> 全部恢复默认
</Button>
@@ -1009,18 +1009,18 @@ function AdvancedPanel() {
<CardTitle className="flex items-center gap-2 text-[15px]"><Code2 className="size-4 text-primary" /> 自定义 CSS</CardTitle>
<CardDescription className="text-[12px] leading-relaxed">
高级用户可注入自定义样式,登录后全局生效(登录页不受影响)。
若改坏了界面,在地址后加 <code className="rounded bg-muted px-1 py-0.5 font-mono text-[11px]">?safe-mode=1</code> 可临时禁用自定义 CSS 进来修复。
若改坏了界面,在地址后加 <code className="rounded bg-muted px-1 py-0.5 font-mono text-meta">?safe-mode=1</code> 可临时禁用自定义 CSS 进来修复。
</CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-3">
<div className="flex flex-wrap items-center gap-1.5">
<span className="mr-1 text-[11px] text-muted-foreground">插入模板:</span>
<span className="mr-1 text-xs text-muted-foreground">插入模板:</span>
{CSS_SNIPPETS.map((s) => (
<button
key={s.label}
type="button"
onClick={() => insertSnippet(s.css)}
className="inline-flex items-center gap-1 rounded-md border bg-muted/40 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors cursor-pointer outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/40"
className="inline-flex items-center gap-1 rounded-md border bg-muted/40 px-2 py-1 text-xs font-medium text-muted-foreground transition-colors cursor-pointer outline-none hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/40"
>
<Plus className="size-3" /> {s.label}
</button>
@@ -1037,12 +1037,12 @@ function AdvancedPanel() {
className="h-64 resize-y rounded-lg bg-card/40 p-3 font-mono text-[12px] leading-relaxed"
/>
{cssWarn && (
<p className="flex items-start gap-1.5 text-[11px] text-warning">
<p className="flex items-start gap-1.5 text-xs text-warning">
<AlertTriangle className="mt-px size-3.5 shrink-0" /> {cssWarn}
</p>
)}
<div className="flex items-center justify-between gap-2">
<span className="text-[11px] text-muted-foreground">{appearance.customCss.length} / 50000 字符</span>
<span className="text-meta text-muted-foreground">{appearance.customCss.length} / 50000 字符</span>
<Button
variant="ghost"
size="sm"
@@ -1075,7 +1075,7 @@ function AdvancedPanel() {
</Button>
</div>
{msg && (
<span className={cn('text-[11px]', msg.kind === 'ok' ? 'text-success' : 'text-destructive')}>{msg.text}</span>
<span className={cn('text-xs', msg.kind === 'ok' ? 'text-success' : 'text-destructive')}>{msg.text}</span>
)}
</CardContent>
</Card>
@@ -1172,19 +1172,19 @@ function UpdateGroup() {
<Sparkles className="size-4 text-primary" />
<span className="text-sm font-medium">v{latest}</span>
{updateInfo.publishedAt && (
<span className="ml-auto text-[11px] tabular-nums text-muted-foreground">
<span className="ml-auto text-meta tabular-nums text-muted-foreground">
{new Date(updateInfo.publishedAt).toLocaleDateString()}
</span>
)}
</div>
<p className="mt-1 text-[11px] text-muted-foreground">当前 v{updateInfo.current} → 最新 v{latest}</p>
<p className="mt-1 text-xs text-muted-foreground">当前 v{updateInfo.current} → 最新 v{latest}</p>
{updateInfo.notes && (
<pre className="mt-3 max-h-40 overflow-auto whitespace-pre-wrap rounded-lg bg-muted/50 p-3 text-[11px] leading-relaxed text-muted-foreground">
<pre className="mt-3 max-h-40 overflow-auto whitespace-pre-wrap rounded-lg bg-muted/50 p-3 text-xs leading-relaxed text-muted-foreground">
{updateInfo.notes}
</pre>
)}
{hint && (
<p className="mt-3 text-[11px] text-muted-foreground">
<p className="mt-3 text-xs text-muted-foreground">
适合你的平台:<code className="rounded bg-muted px-1 py-0.5 font-mono">{hint}</code>(在下载页选择)
</p>
)}
@@ -1238,7 +1238,7 @@ function AboutPanel() {
</div>
<div className="flex items-center gap-2">
<span className="text-2xl font-semibold tracking-tight">SnowLuma</span>
<span className="rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-[11px] text-primary tabular-nums">
<span className="rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-meta text-primary tabular-nums">
v{__APP_VERSION__}
</span>
</div>
@@ -1259,7 +1259,7 @@ function AboutPanel() {
<Star className="size-7 fill-primary/15 text-primary" />
<div className="flex flex-col items-center gap-1">
<p className="text-sm font-medium">喜欢 SnowLuma?给个 Star 支持一下</p>
<p className="max-w-xs text-[11px] leading-relaxed text-muted-foreground">
<p className="max-w-xs text-xs leading-relaxed text-muted-foreground">
开源不易,你的 ⭐ 是我们持续维护的最大动力。
</p>
</div>
@@ -86,7 +86,7 @@ export function ErrorPage({ error, reset }: { error?: Error; reset?: () => void
<Home className="size-4" /> 返回首页
</Button>
{message && (
<pre className="mt-3 max-h-32 w-full overflow-auto rounded-md border bg-muted/40 px-3 py-2 text-left text-[11px] leading-relaxed text-muted-foreground whitespace-pre-wrap">
<pre className="mt-3 max-h-32 w-full overflow-auto rounded-md border bg-muted/40 px-3 py-2 text-left text-meta leading-relaxed text-muted-foreground whitespace-pre-wrap">
{message}
</pre>
)}
@@ -181,7 +181,7 @@ export function NoteConfigForm({ config, onChange }: FormProps) {
placeholder="写点备注、待办或快捷信息…"
className="h-40 resize-y rounded-lg bg-card/40 p-3 text-sm leading-relaxed"
/>
<span className="text-right text-[11px] text-muted-foreground">{c.text.length} / {NOTE_MAX}</span>
<span className="text-right text-meta text-muted-foreground">{c.text.length} / {NOTE_MAX}</span>
</div>
);
}
@@ -204,7 +204,7 @@ export function LinkConfigForm({ config, onChange }: FormProps) {
onChange={(e) => onChange({ url: e.target.value })}
className={cn('h-8', urlInvalid && 'border-destructive')}
/>
{urlInvalid && <span className="text-[11px] text-destructive">仅支持 http:// 或 https:// 链接</span>}
{urlInvalid && <span className="text-xs text-destructive">仅支持 http:// 或 https:// 链接</span>}
</label>
<div className="flex flex-col gap-1.5">
<span className="text-sm text-muted-foreground">图标</span>
@@ -259,7 +259,7 @@ export function AccountConfigForm({ config, onChange }: FormProps) {
<datalist id={listId}>
{qqList.map((q) => <option key={q.uin} value={q.uin}>{q.nickname || q.uin}</option>)}
</datalist>
<span className="text-[11px] text-muted-foreground">可从已接入账号中选择,或手动输入。</span>
<span className="text-xs text-muted-foreground">可从已接入账号中选择,或手动输入。</span>
</div>
);
}
@@ -110,7 +110,7 @@ export function GlobalConfigPanel() {
<div className="flex flex-col gap-4">
{/* rkey fallback servers */}
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
<KeyRound className="mt-0.5 size-3.5 shrink-0" />
<p>
图片 / 文件下载链接需要服务器签发的 <code className="font-mono">rkey</code>。SnowLuma 默认走内核获取;
@@ -160,7 +160,7 @@ export function GlobalConfigPanel() {
</div>
);
})}
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
端点需返回 <code className="font-mono">{'{ group_rkey, private_rkey, expired_time }'}</code>
(兼容 NapCat rkey 服务格式)。非 http(s) 链接会被忽略。
</p>
@@ -171,7 +171,7 @@ export function GlobalConfigPanel() {
{/* music sign URL */}
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
<Music className="mt-0.5 size-3.5 shrink-0" />
<p>音乐分享卡片的签名服务,对所有账号统一生效。留空则使用内置默认服务。</p>
</div>
@@ -191,7 +191,7 @@ export function GlobalConfigPanel() {
)}
onChange={(e) => commit({ ...config, musicSignUrl: 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">{MUSIC_SIGN_DEFAULT}</code>
</p>
</div>
@@ -108,7 +108,7 @@ export function NotificationChannelDialog(props: NotificationChannelDialogProps)
onChange={(e) => patch({ bodyTemplate: e.target.value })}
className="font-mono text-xs leading-relaxed"
/>
<p className="text-[11px] leading-relaxed text-muted-foreground">
<p className="text-xs leading-relaxed text-muted-foreground">
变量:<code className="font-mono">{'{uin}'}</code> <code className="font-mono">{'{nickname}'}</code>{' '}
<code className="font-mono">{'{event}'}</code>(offline/online) <code className="font-mono">{'{time}'}</code>
</p>
@@ -117,7 +117,7 @@ export function NotificationChannelDialog(props: NotificationChannelDialogProps)
<div className="flex items-center justify-between rounded-lg border bg-card/40 p-3">
<div className="min-w-0">
<Label className="text-sm">启用</Label>
<p className="mt-1 text-[11px] leading-relaxed text-muted-foreground">
<p className="mt-1 text-xs leading-relaxed text-muted-foreground">
关闭后保留配置但不推送;账号侧对应开关会被锁定并关闭。
</p>
</div>
@@ -168,9 +168,9 @@ function Field({ label, value, onChange, placeholder, type = 'text', error, hint
className={cn(error && 'border-destructive focus-visible:ring-destructive/40', disabled && 'opacity-60')}
/>
{error ? (
<p className="text-[11px] text-destructive">{error}</p>
<p className="text-xs text-destructive">{error}</p>
) : hint ? (
<p className="text-[11px] text-muted-foreground">{hint}</p>
<p className="text-xs text-muted-foreground">{hint}</p>
) : null}
</div>
);
@@ -131,7 +131,7 @@ export function NotificationsPanel() {
<div className="flex flex-col gap-4">
{/* Global settings */}
<div className="flex flex-col gap-4 rounded-xl border bg-card/40 p-4">
<div className="flex items-start gap-2 text-[11px] leading-relaxed text-muted-foreground">
<div className="flex items-start gap-2 text-xs leading-relaxed text-muted-foreground">
<Bell className="mt-0.5 size-3.5 shrink-0" />
<p>
账号上线 / 下线时向启用的渠道 POST 一条通知(机械转发,仅去抖防刷屏)。渠道在此全局定义,每个账号在其「配置」页勾选启用哪些。
@@ -150,7 +150,7 @@ export function NotificationsPanel() {
commit({ ...config, debounceSeconds: Number.isFinite(n) ? Math.min(3600, Math.max(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">0</code> = 立即发、不去抖。
</p>
</div>
@@ -237,7 +237,7 @@ function ChannelCard({ channel, testing, onToggle, onTest, onEdit, onDelete }: C
{!channel.enabled && <Badge variant="secondary" className="font-normal">已停用</Badge>}
</div>
<div className="mt-0.5 truncate font-mono text-xs text-muted-foreground">{channel.url}</div>
<div className="mt-1 truncate font-mono text-[11px] text-muted-foreground/80">{channel.bodyTemplate}</div>
<div className="mt-1 truncate font-mono text-meta text-muted-foreground/80">{channel.bodyTemplate}</div>
</div>
<div className="flex items-center gap-1.5 sm:justify-end">
@@ -163,7 +163,7 @@ export function SystemPanel() {
const EnvBadge = ({ field }: { field: string }) =>
overridden(field)
? <Badge variant="secondary" className="ml-2 gap-1 text-[10px]"><Lock className="h-3 w-3" /> 被环境变量覆盖</Badge>
? <Badge variant="secondary" className="ml-2 gap-1 text-micro"><Lock className="h-3 w-3" /> 被环境变量覆盖</Badge>
: null;
return (
@@ -200,7 +200,7 @@ export function SystemPanel() {
<div className="flex flex-col gap-1.5">
<Label className="flex items-center">信任代理 (trust-proxy)<EnvBadge field="trustProxy" /></Label>
<Input value={trustProxy} onChange={(e) => setTrustProxy(e.target.value)} placeholder="留空=只信任 socket 对端;1=信任反代头" />
<p className="text-[11px] text-muted-foreground">仅在 WebUI 位于受信任反向代理之后时才设为 1 / loopback / IP 列表。</p>
<p className="text-xs text-muted-foreground">仅在 WebUI 位于受信任反向代理之后时才设为 1 / loopback / IP 列表。</p>
</div>
<div>
<Button onClick={saveSettings} disabled={saving} className="gap-1.5">
@@ -262,7 +262,7 @@ export function SystemPanel() {
</Button>
)}
</div>
<p className="text-[11px] text-muted-foreground">
<p className="text-xs text-muted-foreground">
私钥仅写入服务器 config/key.pem(0600 权限),不会回显。证书无效时保存会被拒绝;若启用了 TLS 但证书加载失败,启动时会自动回退到 HTTP。
</p>
</>
@@ -282,7 +282,7 @@ export function SystemPanel() {
<ToggleSwitch value={exportCreds} onChange={setExportCreds} ariaLabel="导出包含敏感配置" />
</div>
{exportCreds && (
<p className="text-[11px] text-red-600 dark:text-red-400">⚠ 将额外包含 WebUI 登录状态、TLS 私钥,以及带访问令牌的 OneBot 配置,请妥善保管。</p>
<p className="text-sm leading-relaxed text-red-600 dark:text-red-400">⚠ 将额外包含 WebUI 登录状态、TLS 私钥,以及带访问令牌的 OneBot 配置,请妥善保管。</p>
)}
<div>
<Button onClick={exportBackup} disabled={saving} className="gap-1.5">
@@ -299,7 +299,7 @@ export function SystemPanel() {
<ToggleSwitch value={restoreCreds} onChange={setRestoreCreds} ariaLabel="恢复包含敏感配置" />
</div>
{restoreCreds && (
<p className="text-[11px] text-red-600 dark:text-red-400">⚠ 将覆盖当前 WebUI 登录状态、TLS 私钥与 OneBot 配置(含访问令牌);若备份口令未知可能登不进。</p>
<p className="text-sm leading-relaxed text-red-600 dark:text-red-400">⚠ 将覆盖当前 WebUI 登录状态、TLS 私钥与 OneBot 配置(含访问令牌);若备份口令未知可能登不进。</p>
)}
<input
ref={fileRef}
@@ -313,7 +313,7 @@ export function SystemPanel() {
{saving ? <Loader2 className="h-4 w-4 animate-spin" /> : <Upload className="h-4 w-4" />} 选择备份文件并恢复
</Button>
</div>
<p className="text-[11px] text-muted-foreground">恢复前会校验本次要恢复的配置;写入过程中出错会自动回滚,成功后临时快照会删除。恢复后需重启生效。</p>
<p className="text-xs leading-relaxed text-muted-foreground">恢复前会校验本次要恢复的配置;写入过程中出错会自动回滚,成功后临时快照会删除。恢复后需重启生效。</p>
</div>
</CardContent>
</Card>
+1 -1
View File
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const badgeVariants = cva(
'inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium transition-colors',
'inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium transition-colors',
{
variants: {
variant: {
@@ -33,7 +33,7 @@ function Leaf({ value }: { value: string | number | boolean | null }) {
<button
type="button"
onClick={() => setShowImg((v) => !v)}
className="ml-1.5 inline-flex items-center gap-0.5 rounded-md bg-muted/70 px-1 py-0.5 align-middle text-[10px] text-muted-foreground hover:text-foreground"
className="ml-1.5 inline-flex items-center gap-0.5 rounded-md bg-muted/70 px-1 py-0.5 align-middle text-xs text-muted-foreground hover:text-foreground"
>
<ImageIcon className="h-3 w-3" /> {showImg ? '隐藏' : '预览'}
</button>
@@ -101,7 +101,7 @@ function Node({ k, value, depth, defaultOpen }: { k?: string; value: unknown; de
<button
type="button"
onClick={() => setLimit((l) => l + 500)}
className="py-0.5 text-[11px] text-primary hover:underline"
className="py-0.5 text-xs text-primary hover:underline"
style={{ paddingLeft: `${depth * 0.9 + 1.1}rem` }}
>
还有 {count - shown} 项,点击展开…
@@ -147,7 +147,7 @@ export function JsonTree({ data, className, maxHeight = '20rem' }: { data: unkno
type="button"
onClick={copy}
title="复制 JSON"
className="absolute right-2 top-2 z-10 inline-flex items-center gap-1 rounded-md bg-card/80 px-1.5 py-1 text-[11px] text-muted-foreground shadow-sm ring-1 ring-border/50 backdrop-blur hover:text-foreground"
className="absolute right-2 top-2 z-10 inline-flex items-center gap-1 rounded-md bg-card/80 px-1.5 py-1 text-xs text-muted-foreground shadow-sm ring-1 ring-border/50 backdrop-blur hover:text-foreground"
>
{copied ? <Check className="h-3 w-3 text-success" /> : <Copy className="h-3 w-3" />}
{copied ? '已复制' : '复制'}
+1 -1
View File
@@ -220,7 +220,7 @@ export function Picker({
? <img src={opt.avatar} alt="" className="h-7 w-7 shrink-0 rounded-full" />
: <span className="h-7 w-7 shrink-0 rounded-full bg-muted" />}
<span className="min-w-0 flex-1 truncate text-sm">{opt.label}</span>
{opt.sub && <span className="shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums">{opt.sub}</span>}
{opt.sub && <span className="shrink-0 font-mono text-meta text-muted-foreground tabular-nums">{opt.sub}</span>}
</>
) : (
<span className="text-sm">使用 <span className="font-mono text-primary">{rawRow}</span></span>
+1 -1
View File
@@ -208,7 +208,7 @@ export function Tabs<T extends string>({ value, onChange, items, className, ...r
{it.icon}
<span>{it.label}</span>
{it.badge != null && (
<span className={cn('rounded-full px-1.5 text-[11px] tabular-nums',
<span className={cn('rounded-full px-1.5 text-meta tabular-nums',
active ? 'bg-primary/12 text-primary' : 'bg-muted text-muted-foreground')}>
{it.badge}
</span>