mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-15 06:09:35 +02:00
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
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
* {
|
||||
|
||||
Reference in New Issue
Block a user