feat(web): 双档 UI 模式(性能档 = 现状 / Smooth Corner 华丽档)+ 开关挂载(裁决 16.4.4)
- design/uiMode.ts:档位纯逻辑(localStorage `cyrene.ui-mode` 持久化、跨标签页同步、未知值回落默认档), 只改 <html> 类名与 data 属性 ⇒ 不碰 React 树、不重挂载、几何尺寸不变 - 性能档=**现状**:tokens.css / styles/index.css 的改动**全为新增(0 删除)**,且全部限定在 `:root.ui-mode-fancy` 下;75 元素签名比对证明性能档渲染与改动前逐元素一致 - 华丽档对齐六大核心:连续曲率 corner-shape / 多层 Surface 环境光 / 弹簧动效 / 深色优先(浅色单列补偿)/ 毛玻璃升级 / Liquid Glass(4 折射 + RGB 色差 + 鼠标跟踪 + 双层动态边框) - 开关挂载:main.tsx 在 createRoot 之前 initUiMode(零闪烁);TopBar/Nav/AdminTopBar 三处挂载, 窄屏(<640px)按既有约定收起(实测否则 375px 角色块被压到 27px、面板溢出 73px),移动端由侧栏抽屉覆盖 - 复核:tsc 0 错 + vite build 成功;uiMode 38 项 node 测试 + headless Chrome 真渲染 30 项(真点击/真持久化/ 真指针事件);变异反证(去掉读回 → 持久化往返必红)
This commit is contained in:
1 parent
c1a98d7c01
commit
8d70f6d331
9 files changed
+961
No files matched your search
@@ -3,6 +3,7 @@ import { applyTheme, readTheme, type ThemeMode } from "../lib/theme";
|
||||
import { getAuthToken, getStoredRole, health } from "../lib/api";
|
||||
import { useAppStore } from "../store/useAppStore";
|
||||
import type { WsStatus } from "../lib/types";
|
||||
import { UiModeSwitch } from "../design/UiModeSwitch";
|
||||
import { ADMIN_GROUPS, ADMIN_SECTIONS } from "./sections";
|
||||
import { navigateAdmin, type AdminSectionId } from "./router";
|
||||
import { Button, Tag, type TagTone } from "../components/primitives";
|
||||
@@ -226,6 +227,11 @@ function AdminTopBar({ section, onMenu }: { section: AdminSectionId; onMenu?: ()
|
||||
</Tag>
|
||||
) : null}
|
||||
<BackendStatusTag />
|
||||
{/* 双档 UI 档位(裁决 16.4.4):面板顶栏也吃档位,胶囊形态对齐其余 h-8 按钮。
|
||||
与用户端顶栏同理:窄屏收起(<sm),避免与「返回用户端」等既有控件争宽。 */}
|
||||
<span className="hidden shrink-0 sm:inline-flex">
|
||||
<UiModeSwitch variant="compact" />
|
||||
</span>
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
aria-label="切换主题"
|
||||
|
||||
Reference in new issue
Block a user