feat(*): 空间界面 - 统一工作台浮层并收敛画布模型选择焦点样式

This commit is contained in:
ddCat committed 2026-07-31 17:16:26 +08:00
1 parent d94f4c6bed
commit 7dd2a5881b
2 files changed
+153 -11

No files matched your search

+8 -1
View File
@@ -1,4 +1,4 @@
import type { ReactNode } from "react";
import { useLayoutEffect, type ReactNode } from "react";
import { useLocation } from "react-router";
import { CanvasDeleteProjectsDialog } from "@/components/canvas/canvas-delete-projects-dialog";
@@ -9,6 +9,13 @@ import { isSpatialWorkbenchPath } from "@/lib/workspace-routes";
export default function UserLayout({ children }: { children: ReactNode }) {
const { pathname } = useLocation();
const spatialWorkbench = isSpatialWorkbenchPath(pathname);
useLayoutEffect(() => {
// Ant Design 浮层挂载在 body,必须用路由级标记隔离用户工作台与画布编辑器、运营后台。
document.body.classList.toggle("app-spatial-overlays", spatialWorkbench);
return () => document.body.classList.remove("app-spatial-overlays");
}, [spatialWorkbench]);
return (
<div className={cn("app-user-workspace h-dvh overflow-hidden text-foreground", spatialWorkbench && "app-spatial-workspace")}>
<AppWorkspaceShell>{children}</AppWorkspaceShell>