Phase 4 of the debug-console expansion — the tester no longer makes you
hand-write JSON. Each param renders the right smart control from its
semantic role: group/friend/member pickers (member linked to the sibling
group_id), FileSource for media, FaceGrid, datetime for timestamps,
switch for bool, select for enum — with the raw-JSON escape hatch kept.
- Read-only actions badge green, side-effecting amber; a name-pattern set
of destructive actions (kick/ban/recall/delete/…) confirms first.
- Stream API actions invoke over /api/debug/invoke-stream and render
frames live, tracked in the app-level task registry with progress; a
clean success requires the terminal response frame, and a failed frame
shows its reason (not just the {type:'error'} marker).
- Every call lands in capped localStorage history with one-click replay;
responses render in a collapsible JsonTree.
- Extracted LiveActivity (filter / search / export) and the Segmented
control into their own components; debug-page is now a thin host.
Adversarially reviewed: stream terminal-frame judging, member/group
linkage, and contract shapes verified; fixed the failed-stream-frame
reason being hidden, a latent required-enum controlled-select trap, stale
member value on group change, and several low UX edges.
Phase 3 of the debug-console expansion — the Apple-HIG foundation the
new tabs build on (reusing the existing ui kit; new controls match its
idiom, no browser-native widgets).
API client + types:
- debug.invokeStream() reads /api/debug/invoke-stream via fetch + a body
reader, parsing data:<json> SSE frames (header auth, cancellable).
- debug.upload() streams a file via XHR for real upload progress.
- DebugActionParam.role, DebugActionDoc.stream/invariants, FieldRole,
DebugStreamFrame, DebugUploadResult.
Primitives:
- Tabs (sliding indicator + roving tabindex), Picker (searchable,
windowed combobox with a raw-value escape hatch), JsonTree (collapsible
response viewer, image-url preview, copy w/ http fallback, node cap),
FileSource (URL / server-path / browser-upload tri-state), FaceGrid.
Infra:
- DebugTaskProvider + TaskBadge: app-level registry of in-flight upload/
stream tasks so they survive in-app tab switches, with a global
progress chip and a beforeunload guard; eviction never drops a running
task. Wired into App.
- use-debug-contacts: lazy friend/group/member data layer, shared module
cache + localStorage (version-stamped, avatars stripped to dodge quota)
+ TTL + request-id race guard, degrading to raw input on error.
Adversarially reviewed (no automated component tests): virtualization
math and SSE framing verified correct; fixed the stale-contacts-on-switch
member-selection hazard, the quota-kills-persistence issue, and several
low UX edges (active-row clamp, filter scroll reset, copy fallback).
The hover-rail flipped its content to a collapsed layout instantly while the
width animated, so on every expand/collapse icons jumped toward the top-left and
labels flashed in, wrapped super-tall, then settled — and the collapsed rail
leaked the first glyph of every label plus hard-clipped highlight bars.
Lay the rail content out at a fixed width and let the aside clip it: nothing
reflows during the width animation. Icons live in a fixed centered column (never
move); labels stay mounted with nowrap and just fade out when collapsed (no
wrap, no leak); the active pill and update banner render their background as an
absolute layer that becomes a centered squircle on the rail instead of a
hard-clipped bar.
Adds the promised pin toggle to the sidebar footer (desktop) — mirrors the
「钉住侧栏展开」 appearance setting: pinned keeps the rail open, unpinned returns
to hover-to-peek.
The flat tab strip mixed three domains — the dashboard itself, the all-accounts
SnowLuma protocol runtime, and the host/platform. Regroup into 3 labelled
sections (macOS System-Settings idiom): section headers show on the desktop
rail; the mobile strip stays a flat wrap via display:contents. Each group is a
role=group + aria-labelledby; the nav gains an aria-label.
This gives '全局配置' (and future global protocol knobs) a principled home and
ends the mixing. Phase 4 (final) of the global-settings split.
Adds a '全局配置' Settings tab that edits config/snowluma.json — the rkey
fallback-server list and the deployment-wide musicSignUrl — backed by a new
bearer-gated GET/POST /api/global-config (load/saveGlobalSettings, then
oneBotManager.reloadGlobalSettings to hot-apply to live instances).
The panel reuses the established settings-panel idiom (Input/Button/Label,
debounced auto-save, flash); rkey servers are an inline add/remove list with
client-side http(s) validation hints. It deliberately does not reconcile inputs
from the server's normalized response (would erase a half-typed URL); a
load-failure shows an error+retry, and the save toast says '无效项已忽略' when
the server would drop an entry.
Removes the now-dead per-UIN musicSignUrl form (moved to global in Phase 2).
Phase 3 of the global-settings split (nav grouping is Phase 4).
The rkey fallback endpoint is deployment infra (one self-hosted server serves
all accounts; fallback rkeys are fungible), so it doesn't belong in per-UIN
onebot_<uin>.json. Introduce config/snowluma.json — a generic home for small
all-accounts SnowLuma settings — and move rkey.fallbackServers there.
- New onebot/global-config.ts: load/save/normalize with section-merge + atomic
write; http(s)+host URL validation; default [] (off). Lives in onebot (not
core) because the onebot manager constructs instances and must not depend on
core.
- OneBotInstance takes globalSettings; manager loads it on session start and
exposes reloadGlobalSettings() to hot-push edits to every live instance via
applyGlobalSettings → RKeyCache.setFallbackServers.
- Remove rkey from per-UIN OneBotConfig + the WebUI per-UIN round-trip (never
released, so no migration). Register snowluma.json in the backup allowlist.
Reworks the per-UIN rkey from 12b0190. Phase 1 of the global-settings split.
On accounts where the native OIDB 0x9067_202 rkey fetch persistently returns
nothing, every image was served as a bare multimedia.nt.qq.com.cn URL the CDN
rejects with invalid rkey — SnowLuma had no fallback, unlike NapCat.
Add config.rkey.fallbackServers (default []: OFF; no third-party server is
contacted unless the operator configures one). When the native fetch leaves the
cache without a usable image rkey, each configured HTTP endpoint is tried in
turn for { group_rkey, private_rkey, expired_time } (NapCat rkey-server format;
an OneBot { retcode, data } wrapper is also accepted), populating the group/
private image rkey types. Values keep any leading &rkey=/?rkey= since
resolveImageUrl strips before re-appending.
WebUI has no form yet but round-trips rkey.fallbackServers verbatim so a hand-
edited value survives an unrelated config save. Part B of #156 (cooldown is A).
The per-account 上下线通知渠道 picker rendered every global channel as a
flat toggle row, so 40+ channels produced an unbounded, messy wall inside
通用设置. Rework it into a collapsible control:
- collapsed: one-line summary — selected count badge + selected channels
as removable chips (cap 8, then "+N 更多")
- expanded: description + name/url search filter + 全选/清空 bulk actions
+ a height-bounded ScrollArea list (max-h-64) so it never blows up
- globally-disabled channels stay locked off; data flow unchanged
Reuses Badge / ScrollArea / ToggleSwitch / Input.
Replace fixed grid-cols-8 per-core bar display with dynamically
computed square grid that fills a fixed-height (80px) container.
- Adds bestGrid() utility that finds optimal (cols,rows) partition
by minimizing empty cells and aspect balance
- Grid uses grid-template-rows: repeat(N, 1fr) for equal row height
- Empty cells filled with hidden divs for stable layout
- Preserves existing color tokens (bg-muted, bg-primary/70, rounded-sm)
- No scrollbar regardless of core count (tested up to 256)
Closes#140
Co-authored-by: SnowLuma Dev <[email protected]>
* feat: make #sl status command trigger configurable (exact match, max 32 char)
The trigger word for the built-in #sl status command is now configurable
via statusCommand.trigger, with exact case-insensitive matching preserved.
* chore: reject control chars in trigger + add sync assertion
Three findings from the adversarial review, all in the WebUI integration:
D: SSE {kind:'dropped'} now triggers a one-shot REST refresh of
qq-list/processes/connections instead of being silently ignored.
Reasoning: when createFramePusher drops frames under backpressure, the
NEXT delivered frame is per-resource (only the resource whose debounce
timer next fires) — NOT a refresh of all 3. If the dropped frame was
the only update for a slow-changing resource (e.g. connections stable
afterwards), the WebUI stays stale until the 30s reconcile. The
refresh is fire-and-forget; each refresh helper already swallows errors.
E: systemInfo gets its own fast useEffect on the user's pollInterval
(default 3s). The earlier commit slowed it to 30s claiming the data was
'daily cadence', but SystemInfo carries live values (uptime,
cpu.loadAvg, memory.usagePercent, runtime.heapUsed) that the overview
widget animates — 30s is a visible regression. The other 3 resources
stay on the 30s SSE-reconcile fallback.
F: connection-diff-loop's setInterval is now .unref()'d (mirrors the
tokenJanitor pattern at server.ts:462). The discarded handle is now
commented as intentional — initWebUI has no shutdown path, so the
handle has no consumer; unref is the right cleanup primitive.
WebUI typecheck clean. 437/437 core suite (no behavior change in core
tests — only the diff-loop file's timer.unref?.() call is new and is
optional-chained so vitest's fake timers don't crash).
Phase 4 of the SSE migration. The dashboard's three live resources now
update the moment the backend sees a change instead of within 0-3000ms of
the next polling tick.
- New api.stateStream({ onEvent, onStatus }) in lib/api/client.ts mirrors
the existing openLogStream / openDebugStream EventSource pattern: token in
the query string (EventSource can't set headers), single onerror →
'reconnecting' status, source.close() on dispose, JSON.parse with skip-
malformed isolation. Browser-native EventSource auto-reconnect covers
transport drops with no manual retry timer.
- StateStreamEvent union covers the three resource frames plus the two
control frames ('ready' on connect, 'dropped' on backpressure). The
resource frames carry typed HookProcessInfo[] / QQInfo[] /
AccountConnections[] payloads.
- AppLayout now subscribes on mount, applies pushed snapshots to the same
setProcessList / setQqList / setConnections React state slots the polling
tick used to drive. The REST polling tick is RETAINED but slowed to
max(pollInterval × 10, 10s) (default 3s → 30s) so it acts as a silent-
drop reconcile rather than the primary update path. systemInfo isn't on
the SSE feed — it stays on the slow REST loop.
Resolves the two reported bugs:
1. new QQ.exe not showing in WebUI until manual refresh → process-
discovered now publishes 'processes' through the StateBus → frame
arrives within 50ms.
2. injection panel stuck at "waiting for connection" after a successful
hook (group messages arriving) → HookSession 'status-changed' now
publishes 'processes' → 'online' status frame arrives within 50ms.
WebUI typecheck clean. No unit tests in packages/webui (consistent with the
existing openLogStream/openDebugStream which also have no client tests).
* Add function to detect operating system distribution
* Add 'distro' property to system types
* Update subtext in StatTile to show distro instead of platform
* Add Linux distribution detection and architecture normalization
* Add archLabel to SystemInfo interface
* Update subtext to use archLabel instead of arch
* Add distro summarization function and update StatTile
* Refactor distro summary to use tooltip for details
* Refactor host system info detection functions
* Enhance Linux distribution detection logic
* Improve Linux distro detection and version parsing
Enhanced Linux distribution detection logic by adding kernel version parsing and improved source handling for OS release information.
* Enhance kernel and distro version detection on Linux
Refactor kernel version extraction and improve distro version parsing logic.
* Enhance RHEL family detection and error handling
* Enhance distro name formatting in overview-page
* Extend RHEL family detection and supported distros
* Add support for additional Linux distributions
* Enhance OS detection for Armbian and DietPi
Added support for detecting Armbian and DietPi distributions from kernel release strings.
* Add support for Raspbian and DietPi in OS name formatting
* Add function to detect operating system distribution
* Add 'distro' property to system types
* Update subtext in StatTile to show distro instead of platform
* Add Linux distribution detection and architecture normalization
* Add archLabel to SystemInfo interface
* Update subtext to use archLabel instead of arch
* Add distro summarization function and update StatTile
* Refactor distro summary to use tooltip for details
* Refactor host system info detection functions
The old default-collapsed pref went inert once the sidebar became a
hover-expand rail with no collapse button. Repurpose it as an explicit
opt-out: when 「钉住侧栏展开」 is on, the sidebar stays permanently expanded
and no longer collapses to the rail or reacts to hover.
Renamed the appearance field sidebarDefaultCollapsed -> sidebarPinned across
the webui types/defaults/settings UI and the core ui-config interface,
defaults and validator (kept in lock-step so persistence round-trips). Wired
into main-layout: effectiveCollapsed = !editing && !sidebarPinned.
Reshape the desktop shell to feel less "boxed-in", keeping the original
visual design — boundaries now read via depth/tone, not hard borders.
- Sidebar rests as a 64px icon rail and auto-expands on hover (or keyboard
focus-visible), pushing the content rather than overlaying it. Removes the
explicit collapse button; resting state is the rail (`effectiveCollapsed =
!editing`), so it always auto-collapses on mouse-leave.
- Drop hard region borders: sidebar border-r and topbar border-b/divider are
gone; the rail blends into a sidebar-toned chrome.
- Sidebar internal cleanup: brand border, the footer Separator, the update
card / edit-item / 完成 button borders removed; active nav indicator is now
a soft pill + sliding 2px primary left bar (layoutId).
- Content is a nested canvas with a rounded top-left corner at the
sidebar/topbar junction, lifted via a soft shadow; the corner slides with
the rail since the canvas is its flex sibling.
Note: the 「侧栏默认折叠」 appearance toggle (settings-page) is now inert for
the main nav sidebar — to be repurposed as "pin open" or removed in a follow-up.
The 16px faint-bordered box + muted label read as nearly invisible. Make it a
full-width bordered row: a larger (20px) border-2 checkbox with a white unchecked
fill, a checked primary tint on the whole row, and the primary label in
foreground weight (English subtitle stays muted).
ConsentPage shown after login, before the forced password change: tabbed
EULA/PRIVACY rendered by an in-house, dependency-free markdown renderer
(React elements only, XSS-safe; single-pass bounded-class inline parser to
avoid ReDoS on large docs). App gate order is login -> consent -> password ->
app; api client gains agreements.get / recordConsent with a 409 stale-version
re-prompt that refetches the new text.
Switch from open-source to a NapCat-style source-available, NON-commercial
license so the free software cannot be resold / paid-deployed — which an OSI
license (AGPL included) cannot prevent. Source stays public for study and
non-commercial self-hosting; commercial use and public release of modifications
require written permission; the native addon (snowluma-*.node) is carved out as
proprietary. Explicitly NOT OSI open source.
- LICENSE: SnowLuma Source-Available Non-Commercial License v1.0 (bilingual)
- all 14 package.json: "license": "SEE LICENSE IN LICENSE"
- README license section; CONTRIBUTING contribution-licensing note + a grant
letting the project relicense contributions under commercial terms
(contributors keep copyright)
- Change DEFAULT_BODY_TEMPLATE from plaintext to Server酱-style JSON
- Add JSON-safe escaping in renderTemplate for backslashes and quotes
- Update frontend DEFAULT_TEMPLATE to match backend
- Add tests for JSON escaping behavior
Fixes#106 (targets dev branch)
Adversarial pass (MINOR): the new Segmented/IconBtn regressed a11y vs the
project's existing Segmented. Add role=radiogroup/radio + aria-checked to the
segmented control, type="button" to all buttons (segmented, icon, execute,
row toggle), aria-label to icon buttons, aria-expanded to the row toggle.
Move the debug console out of the Settings 调试 subtab into a dedicated
top-level /debug page (sidebar nav + route + AppPath), and redesign it in an
Apple-HIG flavour: translucent sticky header with title block + connection
pill, soft layered cards (rounded-2xl, hairline borders, blurred backdrop),
an iOS-style segmented control with a sliding active pill (params form/JSON,
stream all/event/action filter), refined timeline rows + empty state, calm
type hierarchy with tabular-nums. Logic (tester + live SSE) carried over
verbatim. Remove the old settings/debug-panel + the Settings 'debug' subtab.
New Settings → 调试 tab (DebugPanel): an action tester (account picker +
schema-driven form from /api/debug/actions, with a raw-JSON escape hatch for
legacy actions, real-side-effect warning) and a live merged SSE view of OneBot
events + action calls (pause / clear / kind filter, expandable JSON, drop
marker). Typed debug API client domain (actions/invoke/stream over EventSource
with ?token=). View layer — verified by tsc + vite build.
A '配置备份 / 恢复' card in the 服务 tab: export downloads the JSON bundle
(with an 包含登录凭据 toggle + red warning), restore picks a .json file and
calls importBackup with a 一并恢复登录凭据 toggle (default off). Shows
restored/skipped counts + restart-to-apply. Typed systemSettings.exportBackup/
importBackup client methods. View layer — verified by tsc + vite build.
Add reusable Select (styled native select + chevron) and Textarea components
matching Input's design language, and replace every native <select>/<textarea>
across the app (system-panel, node-edit-dialog, notification-channel-dialog,
settings customCss, widget note) with them.
TLS cert UX: once a cert is installed, the sensitive PEM is no longer rendered
on revisit — show an '已安装(未改变)' summary with 更改/删除 buttons; 更改
reveals the inputs again (with a 取消). Private key is never sent back to the
client. Verified by tsc + vite build.
New Settings → 服务 tab (SystemPanel) over the /api/system/settings + TLS cert
API: edit port / bind host / trust-proxy, paste cert+key PEM to enable HTTPS,
delete cert. Flags env-overridden fields ('被环境变量覆盖') and shows a
restart-to-apply banner (no self-restart). Typed systemSettings API client
domain. View layer — verified by tsc + vite build (webui has no component-test
infra).
Settings → 通知 now mirrors the node-config UX: info-only channel cards
(name / id / url / template + an inline enable toggle), create + edit via a
dialog, and all changes debounced-auto-save (no save button). The save path
is generation-guarded so a superseded in-flight save can't clobber a newer
edit; the test action flushes the pending save first so it never hits an
unsaved channel. The channel id is locked while editing to keep per-account
channelIds references from orphaning.
Per-account opt-in: a globally-disabled channel's toggle is now locked +
forced off (it can never fire). The id is kept in channelIds — the backend
already filters disabled channels — so re-enabling globally restores the
prior selection.
New: notification-channel-dialog.tsx. webui typecheck + build green.
Adversarial review: 0 blockers / 0 should-fix (2 nits applied).
- API client: notifications surface (getConfig/saveConfig/recent/test) + types.
- Settings → 通知 tab: global channel CRUD (id/name/url/body-template/enabled) +
global debounce window, per-channel test-send, dirty-tracked save; invalid
channels (bad slug / non-http URL) are dropped server-side and surfaced.
- Per-account 通用设置: opt-in toggles bound to notifications.channelIds, riding
the ConfigPage's existing debounced autosave; stale opt-ins preserved.
- Overview: opt-in 最近投递 widget (polls /api/notifications/recent, read-only).
Hidden-by-default set is now DERIVED from the catalogue (defaultVisible) and
shared by desktop + mobile reconcile — replaces the hardcoded STATIC_WIDGET_IDS
so a new opt-in widget can't reappear unbidden on existing mobile dashboards.
Typecheck + build green. Adversarial review: 1 should-fix (mobile hidden-set) +
2 nits found, fixed/triaged, and re-verified clean.
Reworks the desktop overview edit UX from per-card show/hide toggles to an
Apple-widgets model:
- The grid shows only the widgets that are on it; hidden ones live in a new
right-side 部件库 ("store") panel that slides in during edit mode.
- Add: drag a gallery tile onto the canvas (HTML5 DnD) — dropped at the cursor
cell, driven entirely through React state.
- Remove ("hide"): drag a card back onto the gallery (gridstack `removable`).
Move/resize/remove all funnel through one onChange writer that derives removal
from a block's absence in the grid snapshot — no separate handler, no state
race.
- Card affordance: the big top "notch" bar is gone. Edit mode now shows two
small square corner icons — a subtle semi-transparent drag hint (top-left, the
whole card stays draggable) and the settings gear (top-right, configurable
widgets only). The eye toggle is removed.
Mobile is unchanged (single-column reorder panel) — the gallery drag UX is
desktop-only by design.
- 导出当前视图: a toolbar button dumps the current (filtered) log view to a
client-side `.log` text file — no server endpoint, respects the active level
filter + search.
- 视图预设: 开发 / 运维 / 精简 presets bundle the existing display prefs
(visibleLevels / maxLines / autoScroll / wrap); a new `UiLogsPrefs.preset`
field stores the active id. Any hand edit to those prefs drops to 自定义.
The client owns the preset→prefs bundles; the server just stores + validates
the id (oneOf, defaults custom). No non-chronological reordering, per plan.
A session-sticky kiosk mode for showing the dashboard on a wall display:
- Entry: `?kiosk=1` URL param (stripped after read) or a top-bar button
(toggleable via topbarItems 'kiosk').
- Hides the sidebar + top bar (MainLayout) and any in-content edit entry marked
data-kiosk-hide (the overview 编辑布局 toolbar) via an html[data-kiosk] CSS rule.
- Exit: Esc key or a dim corner button.
Purely cosmetic — never touches auth and issues no token. A new KioskProvider
(sessionStorage-backed, mounted under LayoutProvider) owns the state.
Completes the B2 dashboard/components batch.
Three opt-in static widgets join the GRID_WIDGETS catalogue (hidden by default
— enabled from the layout editor), with content stored in block.config:
- 便签 (note): pre-wrap plain text, capped at 4000 chars (under the server's
4096-byte config cap). No Markdown.
- 链接卡 (link): label + http(s)-only url (javascript:/data: rejected) + an
icon from a curated lucide set; renders as a clickable card.
- 账号快捷卡 (account): a specified uin's avatar/nickname/online dot, with a
datalist of connected accounts in the config form.
GridWidgetSpec gains `defaultVisible`, honored by defaultOverviewGrid/Mobile and
migrateOverviewBlocks; reconcileLayoutItems gains a `hiddenByDefault` set so the
mobile catalogue appends these hidden too. parse* validators keep config total
over corrupt input.
Adds the gear config form to two more overview widgets (stat tiles stay
form-less, per plan):
- 主机资源 (host): toggle which resource panels show (CPU / 内存 / 运行进程);
the grid column count tracks the visible panel count, and an all-off config
falls back to all-on (no empty card).
- OneBot 连接 (connections): filter by account nickname/uin, an "仅显示异常端点"
toggle (drops healthy adapters and emptied accounts), and sort by 默认 /
名称 / 异常优先 (worst status first).
Both register in CONFIGURABLE_WIDGETS with parse* validators, render via the
existing dialog, and surface on mobile through the same per-widget config map.
The top-bar's optional right-side elements (connection-status badge, theme
toggle) are now toggleable via `topbarItems`. Essential controls — the
menu/collapse button, page title, and logout — always render and aren't listed.
- A TOPBAR_CATALOGUE (id+label) drives both the render gating and the settings
toggles; TopBar reconciles `topbarItems` against it so a new element defaults
to shown.
- A 顶栏 group in settings → 外观 exposes one switch per catalogue element.
Phones now render the overview from the dedicated `overviewMobile` ordering
instead of deriving a 1-column view from the desktop grid — the two layouts are
fully disjoint, so reordering on a phone never touches grid coords and vice
versa.
- View mode reuses DashboardGrid (drag disabled, cols=1), stacking each widget
at its catalogue height via a pure prefix-sum, so cards keep their cell
sizing. Per-widget config is shared with the desktop blocks.
- Edit mode surfaces a motion `Reorder` drag-sort panel (grip + show/hide eye +
config gear for configurable widgets) — no 2D drag on mobile, per plan.
- The 编辑布局 toggle now appears on mobile too, with a mobile-specific hint.
Order/visibility reconciles against the live widget catalogue, so a widget
added later just appears on phones as well.
Schema foundation for the B2 dashboard batch, mirroring the navItems shape:
- `overviewMobile: UiLayoutItem[]` — a separate single-column (id+visible)
ordering for phones, kept fully disjoint from the desktop 2D `overviewBlocks`
grid so mobile ordering never pollutes grid coords.
- `topbarItems: UiLayoutItem[]` — show/hide list for toggleable top-bar
elements (status badge, theme toggle, kiosk button); essential elements stay
pinned in the consumer.
Server `normalizeLayout` round-trips both (idOr + dedup, total over corrupt
input); defaults seed first run. `LayoutContext` exposes them with
setOverviewMobile/setTopbarItems setters and reconcile-on-consume semantics, so
adding a widget/element later just appears. Old configs lacking the fields fall
back to defaults on load.
Consumers (mobile render, topbar render + config, drag-sort panel) land in
follow-up B2 commits.
Keyboard-a11y polish to match the codebase's standard
`focus-visible:ring-[3px] focus-visible:ring-ring/40` treatment:
- ToggleSwitch (role=switch, used across every settings/config surface) had
no focus-visible ring — keyboard users got no focus indicator.
- Sheet's close button used a bare `focus:outline-none`; now mirrors the
Dialog close button's ring.
Slider, Button, Input, Select, Tabs, Checkbox, Switch already carry the ring.
- Custom-CSS editor stays a plain <textarea> (native Cmd/Ctrl+Z undo) but
gains insert-at-cursor template buttons (string-constant snippets) and a
best-effort on-blur validation that warns on unbalanced braces or CSS that
parses to zero rules. Never blocks saving; ?safe-mode=1 remains the escape.
- Accent picker: choosing a custom colour whose contrast against the canvas
falls below WCAG 3:1 surfaces a one-time (per-session) advisory offering to
revert. Pure-advisory — applies immediately, no persistent banner, no nag.
Adds two appearance customizations from the WebUI plan's B1 batch:
- Custom fonts: new `fontSansCustom`/`fontMonoCustom` free-form family
fields (mirroring accent's preset/custom dual-field). A "自定义" segment
reveals a text input; on Chromium it gets a native <datalist> of installed
fonts via `queryLocalFonts()`, feature-detected with a silent fallback to
a plain text box on Firefox/Safari/mobile. No font-file uploads.
- Theme-variable panel: new `cssVars` map lets the operator override
individual theme tokens (background/foreground/primary/…) with colour
pickers, layered last over palette+accent. Both keys (token whitelist) and
values (hex/named/functional colour) are validated, so — unlike customCss —
this stays safe to serve to the unauthenticated login page.
Server `normalizeAppearance` gains `fontFamilyOr` (rejects control
chars/injection) and `normalizeCssVars` (whitelist keys + colour-only values,
total over corrupt input). Client `ThemeContext` re-validates defensively
(the localStorage cache is locally tamperable) before injecting into CSS.
Tests for the new normalizers land with the B4 batch.
- Grid row height 80→108px so a 1-row stat tile's icon + 3 text lines clear
the padding with real breathing room (the previous fix still clipped ~8px);
stat tile gets an airier layout (size-10 icon, text-lg value, py-3.5).
- Carry the app's Apple language across the homepage: inner surfaces and
empty-state containers round to xl, empty-state icons calm to size-8/opacity,
edit hint + first-run nudge rounded consistently.