Compare commits

...

1 Commits

Author SHA1 Message Date
Jiang Bohan
0c021f36ff fix(web): resolve CSS token import and WorkspaceIdProvider crash after monorepo extraction
- globals.css: use relative path for @multica/ui/styles/tokens.css
  since Tailwind v4's @import resolver doesn't follow pnpm workspace
  symlinks + package.json#exports
- globals.css: widen @source globs from *.tsx to *.{ts,tsx} so
  Tailwind scans .ts config files — fixes bg-info being purged
  (Done badge invisible in light mode)
- layout.tsx: hoist WorkspaceIdProvider above SidebarProvider so
  AppSidebar (which now calls useWorkspaceId via useMyRuntimesNeedUpdate
  from #533) doesn't throw on mount
2026-04-09 14:47:08 +08:00
2 changed files with 26 additions and 20 deletions

View File

@@ -43,22 +43,28 @@ export default function DashboardLayout({
if (!user) return null;
// AppSidebar (and other dashboard children) call hooks that depend on the
// workspace id via useWorkspaceId(), so the entire dashboard tree must
// mount inside WorkspaceIdProvider. Show a fullscreen loader while the
// workspace is still being resolved.
if (!workspace) {
return (
<div className="flex h-svh items-center justify-center">
<MulticaIcon className="size-6 animate-pulse" />
</div>
);
}
return (
<SidebarProvider className="h-svh">
<AppSidebar />
<SidebarInset className="overflow-hidden">
{workspace ? (
<WorkspaceIdProvider wsId={workspace.id}>
{children}
<ModalRegistry />
</WorkspaceIdProvider>
) : (
<div className="flex flex-1 items-center justify-center">
<MulticaIcon className="size-6 animate-pulse" />
</div>
)}
</SidebarInset>
<SearchCommand />
</SidebarProvider>
<WorkspaceIdProvider wsId={workspace.id}>
<SidebarProvider className="h-svh">
<AppSidebar />
<SidebarInset className="overflow-hidden">
{children}
<ModalRegistry />
</SidebarInset>
<SearchCommand />
</SidebarProvider>
</WorkspaceIdProvider>
);
}

View File

@@ -1,14 +1,14 @@
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
@import "@multica/ui/styles/tokens.css";
@import "../../../packages/ui/styles/tokens.css";
@import "./custom.css";
@custom-variant dark (&:is(.dark *));
@source "../../../packages/ui/**/*.tsx";
@source "../../../packages/core/**/*.tsx";
@source "../../../packages/views/**/*.tsx";
@source "../../../packages/ui/**/*.{ts,tsx}";
@source "../../../packages/core/**/*.{ts,tsx}";
@source "../../../packages/views/**/*.{ts,tsx}";
@layer base {
* {