From 852c327360a21ba12404f5c52d06c83e1173e840 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 4 Oct 2026 14:01:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor(web):=20=E9=9A=8F=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=BC=8F=E5=85=A5=E5=8F=A3=E6=B8=85=E7=90=86=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E7=9A=84=E7=AE=A1=E7=90=86=E9=93=BE=E6=8E=A5=EF=BC=88=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=EF=BC=9A=E7=94=A8=E6=88=B7=E7=AB=AF=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E7=AE=A1=E7=90=86=E5=85=A5=E5=8F=A3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TopBar / Nav 的 hash 形式管理入口(#/admin、#/admin/system)**删除**(design/07 §0.2:用户端不提供任何 管理入口、bundle 不含该路径串);面板只经 ADMIN_PATH 路径直入 - AdminApp 三处 window.location.hash = "" 改调 router 导出的 navigateUserShell() - 复核:tsc 0 错 + vite build 成功;用户端源码 grep "#/admin" 0 命中(仅在 channels/useAdapterNav.ts 尚有模块内闭环的 hash 字面量,属另一决策,仅报告未改) - 局限:无 playwright/puppeteer 且不许加依赖 ⇒ 「布局未塌」为结构+静态样式依赖推断(无子元素数量相关样式) --- frontend/web/src/admin/AdminApp.tsx | 8 ++++---- frontend/web/src/components/Nav.tsx | 18 +----------------- frontend/web/src/components/TopBar.tsx | 8 -------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/frontend/web/src/admin/AdminApp.tsx b/frontend/web/src/admin/AdminApp.tsx index b81f401..514183e 100644 --- a/frontend/web/src/admin/AdminApp.tsx +++ b/frontend/web/src/admin/AdminApp.tsx @@ -5,7 +5,7 @@ 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 { navigateAdmin, navigateUserShell, type AdminSectionId } from "./router"; import { Button, Tag, type TagTone } from "../components/primitives"; import { Icon } from "../components/Icon"; import { DashboardModule } from "./modules/Dashboard"; @@ -239,7 +239,7 @@ function AdminTopBar({ section, onMenu }: { section: AdminSectionId; onMenu?: () > - @@ -256,7 +256,7 @@ function LoginGate(): React.ReactNode {

管理面板需持有 JWT。请先在用户端 登录页 完成登录后,再返回本页。

- + ); } @@ -273,7 +273,7 @@ function Forbidden403(): React.ReactNode { 当前角色 {role ?? "?"}(viewer 只读)。管理面板需 owner 或 admin 角色;管理端写操作仅 owner。

- +
); diff --git a/frontend/web/src/components/Nav.tsx b/frontend/web/src/components/Nav.tsx index b835e02..66edc2a 100644 --- a/frontend/web/src/components/Nav.tsx +++ b/frontend/web/src/components/Nav.tsx @@ -16,7 +16,7 @@ import { Tag } from "./primitives"; * at runtime by the agent / user, and rendered per message). This is a small * navigation rail: brand + connection status + the conversation list * (`SessionRail`, which also owns per-session role picking, design/22 §4.6) + - * theme + admin/settings entry. + * 主题切换 + UI 档位开关(双档,裁决 16.4.4)。 * * Two surface variants share the same NavContent: * - Sidebar (desktop): fixed rail, `hidden md:flex`. @@ -76,22 +76,6 @@ function NavContent({ onNavigate }: { onNavigate: () => void }): React.ReactNode {hasToken ? : null}
- { - window.location.hash = "#/admin/system"; - onNavigate(); - }} - /> - { - window.location.hash = "#/admin"; - onNavigate(); - }} - /> void }): React.ReactNode { {meta.label} - {/* 双档 UI 档位(裁决 16.4.4):胶囊形态,尺寸对齐本栏其余 h-8 按钮。 窄屏(