ORBCAFE Layout + Navigation
Workflow
- 先对照
skills/orbcafe-ui-component-usage/references/module-contracts.md,确认这是Hook-first模块。 - 执行安装与基础壳层接入。
- 用
references/patterns.md选择 full shell 或 nav-only。 - 用
references/guardrails.md逐条检查 locale、hydration、菜单动作和动效。 - 以官方 examples 的 layout/providers/page 骨架产出代码。
Installation and Bootstrapping (Mandatory)
npm install orbcafe-ui @mui/material @mui/icons-material @mui/x-date-pickers @emotion/react @emotion/styled dayjs
本仓库联调:
npm run build
cd examples
npm install
npm run dev
参考实现:
examples/app/layout.tsxexamples/app/providers.tsxexamples/app/_components/HomeDemoClient.tsxexamples/app/_components/StdReportExampleClient.tsx
Output Contract
Mode:Hook-first.Layout decision: full shell vs nav-only.Code snippet: app frame with minimal props.Runtime safety: locale、hydration、route 高亮安全策略。Verify: 菜单跳转、locale 切换、用户菜单动作、过渡动画。Troubleshooting: 至少包含 3 条“页面看起来没反应”排查项。
Examples-Based Experience Summary
- 在 App Router 下优先采用
Server page -> Client page分层,不在 client 首屏直接消费 Promise 语义路由参数。 usePathname高亮逻辑使用mounted防抖策略,避免 SSR/CSR 首帧不一致。CAppPageLayout内部负责壳层,业务页只注入 menu/user/logo/children,避免重复造壳。CPageTransition持续使用160-260ms,仅用 transform/opacity 变换,性能更稳。Providers层集中挂载ThemeProvider + LocalizationProvider + GlobalMessage,避免每页重复配置。
