From 677faab27382fd189904e72a04de03b76ada4f9f Mon Sep 17 00:00:00 2001 From: fengxiangdebaozi <10845145+fengxiangdebaozi@user.noreply.gitee.com> Date: Tue, 2 Jun 2026 11:50:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend-web/src/pages/WorkspaceRoutes.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/frontend-web/src/pages/WorkspaceRoutes.tsx b/frontend-web/src/pages/WorkspaceRoutes.tsx index f70d42a1..d2c565b1 100644 --- a/frontend-web/src/pages/WorkspaceRoutes.tsx +++ b/frontend-web/src/pages/WorkspaceRoutes.tsx @@ -71,15 +71,27 @@ export function WorkspaceLayout({ return ( From 5c5632967ce0384bed9513a6921448521048e075 Mon Sep 17 00:00:00 2001 From: fengxiangdebaozi <10845145+fengxiangdebaozi@user.noreply.gitee.com> Date: Tue, 2 Jun 2026 15:16:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/workspace/workspace-container.tsx | 5 ++++- frontend-web/src/pages/PageRoutes.tsx | 5 ++++- frontend-web/src/styles/globals.css | 12 ++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend-web/src/components/workspace/workspace-container.tsx b/frontend-web/src/components/workspace/workspace-container.tsx index de73a9f5..d51c149f 100644 --- a/frontend-web/src/components/workspace/workspace-container.tsx +++ b/frontend-web/src/components/workspace/workspace-container.tsx @@ -20,8 +20,11 @@ export function WorkspaceContainer({ children, ...props }: React.ComponentProps<"div">) { + // h-full 而非 h-screen:本容器恒在 WorkspaceRoutes 的 SidebarInset(flex-1,确定高度)下, + // h-full 既跟随容器高度(无界等嵌套不再锁死整屏),又修掉原 h-screen=100vh 比可用区域 + // 高出一个页头高度的溢出。 return ( -
+
{children}
); diff --git a/frontend-web/src/pages/PageRoutes.tsx b/frontend-web/src/pages/PageRoutes.tsx index db4ed060..41f88499 100644 --- a/frontend-web/src/pages/PageRoutes.tsx +++ b/frontend-web/src/pages/PageRoutes.tsx @@ -18,8 +18,11 @@ function PageLayout() { const { theme } = useTheme(); const isDark = theme === "dark"; + // h-full(100%)而非 h-screen(100vh):配合 globals.css 的 html/body/#root height:100% + // 高度链,根布局跟随容器高度。全屏下 100% 解析到视口,与 h-screen 等价;无界等嵌套 + // 下容器不占满整屏时,高度才能正确收缩而非锁死整屏。 return ( -
+
{sidebarEnabled &&
}
{sidebarEnabled && ( diff --git a/frontend-web/src/styles/globals.css b/frontend-web/src/styles/globals.css index 4ab3e054..cb36f5ea 100644 --- a/frontend-web/src/styles/globals.css +++ b/frontend-web/src/styles/globals.css @@ -324,6 +324,18 @@ @apply bg-background text-foreground; } + /* 打通高度链:html/body/#root 取满父级高度,使下游用 h-full(100%) 的根布局 + (PageRoutes 的 PageLayout)跟随容器尺寸而非视口。 + - 全屏:100% 逐级解析到视口,与原先的 h-screen 等价,无视觉变化; + - 无界(wujie)等嵌套:wujie 会把子应用的 html/body 选择器作用到 + 容器,于是高度收缩到容器而非整屏 —— 这正是「高度对齐容器」所需。 + 只设 height、不设 overflow,因此不影响 Landing 等需要自然滚动的页面。 */ + html, + body, + #root { + height: 100%; + } + [data-sidebar="menu-button"][data-active="true"] { box-shadow: inset 3px 0 0 var(--primary); font-weight: 600;