style(webui): optically align directional icons
Introduce reusable one-pixel optical offsets for asymmetric forward and back glyphs without changing control boxes, spacing, or pointer hit areas. Apply the correction consistently to navigation arrows, play controls, send actions, and the account sidebar so directional symbols appear centered across shared controls. No interaction or navigation behavior changes.
This commit is contained in:
@@ -50,7 +50,9 @@ export function AccountSidebar({
|
||||
aria-label={collapsed ? '展开账号列表' : '收起账号列表'}
|
||||
className="text-muted-foreground"
|
||||
>
|
||||
{collapsed ? <ChevronRight className="size-4" /> : <ChevronLeft className="size-4" />}
|
||||
{collapsed
|
||||
? <ChevronRight className="optical-forward size-4" />
|
||||
: <ChevronLeft className="optical-back size-4" />}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ export function ActionTester({ accounts, docs, presetAction }: { accounts: QQInf
|
||||
<div className="flex gap-2">
|
||||
<button type="button" onClick={onExecute} disabled={invoking} data-press-scale=""
|
||||
className="inline-flex h-11 flex-1 items-center justify-center gap-2 rounded-xl bg-primary text-[15px] font-medium text-primary-foreground shadow-sm transition-[background-color,opacity,scale] duration-150 ease-out hover:bg-primary/90 active:not-disabled:scale-[0.96] motion-reduce:active:scale-100 disabled:opacity-50">
|
||||
{invoking ? <Loader2 className="h-4 w-4 animate-spin" /> : isStream ? <Zap className="h-4 w-4" /> : <Play className="h-4 w-4" />}
|
||||
{invoking ? <Loader2 className="h-4 w-4 animate-spin" /> : isStream ? <Zap className="h-4 w-4" /> : <Play className="optical-forward h-4 w-4" />}
|
||||
{invoking ? '执行中…' : isStream ? '流式执行' : '执行'}
|
||||
</button>
|
||||
{invoking && isStream && streamAbort.current && (
|
||||
|
||||
@@ -161,7 +161,7 @@ export function LiveActivity() {
|
||||
<div className="flex items-center gap-2">
|
||||
<Segmented value={kindFilter} onChange={setKindFilter}
|
||||
options={[{ value: 'all', label: '全部' }, { value: 'event', label: '事件' }, { value: 'action', label: '调用' }]} />
|
||||
<IconBtn onClick={() => setPaused((v) => !v)} title={paused ? '继续' : '暂停'}>{paused ? <Play className="h-4 w-4" /> : <Pause className="h-4 w-4" />}</IconBtn>
|
||||
<IconBtn onClick={() => setPaused((v) => !v)} title={paused ? '继续' : '暂停'}>{paused ? <Play className="optical-forward h-4 w-4" /> : <Pause className="h-4 w-4" />}</IconBtn>
|
||||
<IconBtn onClick={exportJson} title="导出 JSON"><Download className="h-4 w-4" /></IconBtn>
|
||||
<IconBtn onClick={() => setRows([])} title="清空"><Trash2 className="h-4 w-4" /></IconBtn>
|
||||
</div>
|
||||
|
||||
@@ -119,7 +119,7 @@ export function MessageComposer({ accounts }: { accounts: QQInfo[] }) {
|
||||
|
||||
<button type="button" onClick={send} disabled={sending} data-press-scale=""
|
||||
className="inline-flex h-11 items-center justify-center gap-2 rounded-xl bg-primary text-[15px] font-medium text-primary-foreground shadow-sm transition-[background-color,opacity,scale] duration-150 ease-out hover:bg-primary/90 active:not-disabled:scale-[0.96] motion-reduce:active:scale-100 disabled:opacity-50">
|
||||
{sending ? <Loader2 className="h-4 w-4 animate-spin" /> : <Send className="h-4 w-4" />} 发送{hasNodes(segs) ? '(合并转发)' : ''}
|
||||
{sending ? <Loader2 className="h-4 w-4 animate-spin" /> : <Send className="optical-forward h-4 w-4" />} 发送{hasNodes(segs) ? '(合并转发)' : ''}
|
||||
</button>
|
||||
</motion.section>
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ export function LoginPage({ onLogin }: LoginPageProps) {
|
||||
<Button type="submit" disabled={loading || !password} className="h-12 rounded-xl text-[15px]">
|
||||
{loading ? '验证中…' : (
|
||||
<>
|
||||
进入控制台 <ArrowRight className="size-4" />
|
||||
进入控制台 <ArrowRight className="optical-forward size-4" />
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
@@ -163,7 +163,7 @@ export function OverviewPage() {
|
||||
前往「进程注入」加载 QQ,登录后会自动接入 OneBot 流程。
|
||||
</p>
|
||||
</div>
|
||||
<ArrowRight className="size-4 shrink-0 text-primary" />
|
||||
<ArrowRight className="optical-forward size-4 shrink-0 text-primary" />
|
||||
</Link>
|
||||
</motion.div>
|
||||
)}
|
||||
@@ -500,7 +500,7 @@ function StatTile({
|
||||
) : (
|
||||
<div className="min-w-0 flex-1">{copy}</div>
|
||||
)}
|
||||
{to && <ArrowRight className="size-4 shrink-0 text-muted-foreground/60" />}
|
||||
{to && <ArrowRight className="optical-forward size-4 shrink-0 text-muted-foreground/60" />}
|
||||
</CardContent>
|
||||
);
|
||||
if (to) {
|
||||
@@ -1038,7 +1038,7 @@ function RecentAlertsCard({ config }: { config: AlertsConfig }) {
|
||||
<CardDescription>最近 {count} 条 · {config.levels.map((l) => l.toUpperCase()).join(' / ')}</CardDescription>
|
||||
</div>
|
||||
<Link to="/logs" className="inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground hover:text-foreground">
|
||||
查看日志 <ArrowRight className="size-3" />
|
||||
查看日志 <ArrowRight className="optical-forward size-3" />
|
||||
</Link>
|
||||
</CardHeader>
|
||||
<CardContent className="min-h-0 flex-1 overflow-auto">
|
||||
|
||||
@@ -250,7 +250,7 @@ function ChannelCard({ channel, testing, onToggle, onTest, onEdit, onDelete }: C
|
||||
aria-label="测试发送"
|
||||
className="text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
{testing ? <Loader2 className="size-4 animate-spin" /> : <Send className="size-4" />}
|
||||
{testing ? <Loader2 className="size-4 animate-spin" /> : <Send className="optical-forward size-4" />}
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
|
||||
@@ -219,6 +219,17 @@
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
/* Triangles and forward-pointing glyphs carry more visual mass on the left.
|
||||
A one-pixel optical correction centers them without changing hit areas. */
|
||||
.optical-forward {
|
||||
position: relative;
|
||||
left: 1px;
|
||||
}
|
||||
|
||||
.optical-back {
|
||||
position: relative;
|
||||
right: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ──────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user