Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat(ui): inset floating app-shell layout for ERP and MES (#1551)

Brad Barbin3237d6a6397d
diff --git a/apps/erp/app/components/Layout/Topbar/Topbar.tsx b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
index 584cd2286b..00297206e1 100644
--- a/apps/erp/app/components/Layout/Topbar/Topbar.tsx
+++ b/apps/erp/app/components/Layout/Topbar/Topbar.tsx
@@ -20,7 +20,7 @@ const Topbar = () => {
const toggleSidebar = useUIStore((s) => s.toggleSidebar);
return (
- <div className="h-[var(--topbar-height)] grid grid-cols-[1fr_auto] bg-background text-foreground px-4 top-0 sticky z-10 items-center">
+ <div className="h-[var(--topbar-height)] grid grid-cols-[1fr_auto] bg-card border-b border-border text-foreground px-4 top-0 sticky z-10 items-center">
<div className="flex-1 hidden md:block">
<Breadcrumbs />
</div>
diff --git a/apps/erp/app/modules/workflows/ui/Builder/NodePalette.tsx b/apps/erp/app/modules/workflows/ui/Builder/NodePalette.tsx
index 1d151ce8fe..9078ba70da 100644
--- a/apps/erp/app/modules/workflows/ui/Builder/NodePalette.tsx
+++ b/apps/erp/app/modules/workflows/ui/Builder/NodePalette.tsx
@@ -6,7 +6,7 @@ export function NodePalette() {
const addNode = useBuilderStore((state) => state.addNode);
return (
- <aside className="flex h-full flex-col gap-1 overflow-y-auto border-r bg-background p-2">
+ <aside className="flex h-full flex-col gap-1 overflow-y-auto border-r bg-card p-2">
{NODE_KIND_ORDER.map((type) => {
const meta = NODE_KIND_META[type];
diff --git a/apps/erp/app/routes/x+/_layout.tsx b/apps/erp/app/routes/x+/_layout.tsx
index 8d4714395e..f4ec9d685d 100644
--- a/apps/erp/app/routes/x+/_layout.tsx
+++ b/apps/erp/app/routes/x+/_layout.tsx
@@ -470,11 +470,11 @@ export default function AuthenticatedRoute() {
>
<RealtimeDataProvider>
<TooltipProvider>
- <div className="flex flex-col h-screen">
- <Topbar />
- <div className="flex flex-1 h-[calc(100vh-var(--topbar-height))] relative">
- <PrimaryNavigation />
- <main className="flex-1 overflow-y-auto scrollbar-hide border-l border-t bg-card sm:rounded-tl-2xl relative z-10">
+ <div className="flex h-screen">
+ <PrimaryNavigation />
+ <div className="flex flex-1 flex-col min-w-0 overflow-hidden bg-card md:mt-2 md:mr-2 md:mb-2 md:rounded-2xl md:border md:border-border relative z-10">
+ <Topbar />
+ <main className="flex-1 overflow-y-auto scrollbar-hide relative">
<Outlet />
</main>
</div>
diff --git a/apps/mes/app/components/AppSidebar.tsx b/apps/mes/app/components/AppSidebar.tsx
index 41303e240b..991493a209 100644
--- a/apps/mes/app/components/AppSidebar.tsx
+++ b/apps/mes/app/components/AppSidebar.tsx
@@ -99,7 +99,11 @@ export function AppSidebar({
}> | null;
}) {
return (
- <Sidebar collapsible="icon" {...props}>
+ <Sidebar
+ collapsible="icon"
+ className="[&_[data-sidebar=sidebar]]:bg-background group-data-[side=left]:border-r-0"
+ {...props}
+ >
<SidebarHeader>
<TeamSwitcher company={company} />
</SidebarHeader>
diff --git a/apps/mes/app/routes/x+/_layout.tsx b/apps/mes/app/routes/x+/_layout.tsx
index 026bbaa699..c28b4a33b8 100644
--- a/apps/mes/app/routes/x+/_layout.tsx
+++ b/apps/mes/app/routes/x+/_layout.tsx
@@ -478,7 +478,9 @@ export default function AuthenticatedRoute() {
pinnedInUser={pinnedInUser}
timeCardEnabled={timeCardEnabled}
/>
- <Outlet />
+ <div className="flex flex-1 flex-col min-w-0 overflow-hidden bg-card md:mt-2 md:mr-2 md:mb-2 md:rounded-2xl md:border md:border-border">
+ <Outlet />
+ </div>
{timeCardEnabled && (
<Suspense fallback={null}>
<Await resolve={openClockEntry}>
diff --git a/apps/mes/app/routes/x+/active.tsx b/apps/mes/app/routes/x+/active.tsx
index e04a8c0c5a..739f3e14e6 100644
--- a/apps/mes/app/routes/x+/active.tsx
+++ b/apps/mes/app/routes/x+/active.tsx
@@ -62,7 +62,7 @@ export default function ActiveRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -71,7 +71,7 @@ export default function ActiveRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
<div className="w-full p-4 h-[var(--header-height)]">
<div className="relative">
<div className="flex justify-between gap-4">
diff --git a/apps/mes/app/routes/x+/assigned.tsx b/apps/mes/app/routes/x+/assigned.tsx
index c47f8a2cd0..b79ee11ed2 100644
--- a/apps/mes/app/routes/x+/assigned.tsx
+++ b/apps/mes/app/routes/x+/assigned.tsx
@@ -217,7 +217,7 @@ export default function AssignedRoute() {
return (
<div className="flex flex-col flex-1 min-w-0">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] overflow-y-scroll scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] overflow-y-scroll scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -226,7 +226,7 @@ export default function AssignedRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
<div className="w-full px-4 h-[var(--header-height)] flex items-center">
<div className="relative w-full">
<div className="flex justify-between gap-4">
diff --git a/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx b/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
index 7722d3b47c..b583d39792 100644
--- a/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
+++ b/apps/mes/app/routes/x+/dispatch.$dispatchId.tsx
@@ -230,7 +230,7 @@ export default function MaintenanceDetailRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2 w-full justify-between">
<HStack>
<SidebarTrigger />
@@ -250,7 +250,7 @@ export default function MaintenanceDetailRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent p-4">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent p-4">
<VStack spacing={4} className="max-w-2xl mx-auto">
{/* Work Center & OEE Impact */}
<Card className="w-full">
diff --git a/apps/mes/app/routes/x+/job.$jobId.tsx b/apps/mes/app/routes/x+/job.$jobId.tsx
index 197f9271b4..060bdbcae0 100644
--- a/apps/mes/app/routes/x+/job.$jobId.tsx
+++ b/apps/mes/app/routes/x+/job.$jobId.tsx
@@ -37,7 +37,7 @@ export default function JobDagRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Link
diff --git a/apps/mes/app/routes/x+/jobs.tsx b/apps/mes/app/routes/x+/jobs.tsx
index d053f44bf1..5ab155649a 100644
--- a/apps/mes/app/routes/x+/jobs.tsx
+++ b/apps/mes/app/routes/x+/jobs.tsx
@@ -113,7 +113,7 @@ export default function JobsRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
diff --git a/apps/mes/app/routes/x+/maintenance.tsx b/apps/mes/app/routes/x+/maintenance.tsx
index 88477d821d..b53c04711c 100644
--- a/apps/mes/app/routes/x+/maintenance.tsx
+++ b/apps/mes/app/routes/x+/maintenance.tsx
@@ -397,7 +397,7 @@ export default function MaintenanceRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -406,7 +406,7 @@ export default function MaintenanceRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
<div className="w-full p-4">
<VStack spacing={4}>
<div className="w-full">
diff --git a/apps/mes/app/routes/x+/operations.tsx b/apps/mes/app/routes/x+/operations.tsx
index f21cb59e81..e3332f3c56 100644
--- a/apps/mes/app/routes/x+/operations.tsx
+++ b/apps/mes/app/routes/x+/operations.tsx
@@ -466,8 +466,8 @@ function KanbanSchedule() {
}, [processes, workCenters, availableTags, people, t]);
return (
- <div className="flex flex-col h-screen w-[calc(100dvw-var(--sidebar-width-icon))]">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <div className="flex flex-col flex-1 min-h-0 w-full">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -475,7 +475,7 @@ function KanbanSchedule() {
</Heading>
</div>
</header>
- <div className="flex flex-col h-full max-h-full overflow-auto relative">
+ <div className="flex flex-col flex-1 min-h-0 overflow-auto relative">
<HStack className="px-4 py-2 justify-between bg-card border-b border-border">
<HStack>
<SearchFilter param="search" size="sm" placeholder={t`Search`} />
diff --git a/apps/mes/app/routes/x+/picking.$pickingListId.tsx b/apps/mes/app/routes/x+/picking.$pickingListId.tsx
index bad3697362..bce9d5b85a 100644
--- a/apps/mes/app/routes/x+/picking.$pickingListId.tsx
+++ b/apps/mes/app/routes/x+/picking.$pickingListId.tsx
@@ -136,7 +136,7 @@ export default function PickingExecutionRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center justify-between gap-2 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center justify-between gap-2 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">{pickingList.pickingListId}</Heading>
@@ -153,7 +153,7 @@ export default function PickingExecutionRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent p-4">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent p-4">
<div className="w-full max-w-5xl mx-auto pb-16">
<VStack spacing={4} className="w-full">
{kits.map((kit) => (
diff --git a/apps/mes/app/routes/x+/picking._index.tsx b/apps/mes/app/routes/x+/picking._index.tsx
index 71c6c3f572..fc15cf6265 100644
--- a/apps/mes/app/routes/x+/picking._index.tsx
+++ b/apps/mes/app/routes/x+/picking._index.tsx
@@ -35,7 +35,7 @@ export default function PickingIndexRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -44,7 +44,7 @@ export default function PickingIndexRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
{pickingLists.length > 0 ? (
<div className="grid grid-cols-[repeat(auto-fill,minmax(min(100%,330px),1fr))] p-4 gap-4">
{pickingLists.map((pl) => {
diff --git a/apps/mes/app/routes/x+/recent.tsx b/apps/mes/app/routes/x+/recent.tsx
index 6f91645cb2..d1578a1d63 100644
--- a/apps/mes/app/routes/x+/recent.tsx
+++ b/apps/mes/app/routes/x+/recent.tsx
@@ -62,7 +62,7 @@ export default function ActiveRoute() {
return (
<div className="flex flex-col flex-1">
- <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-background">
+ <header className="sticky top-0 z-10 flex h-[var(--header-height)] shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-card">
<div className="flex items-center gap-2 px-2">
<SidebarTrigger />
<Heading size="h4">
@@ -71,7 +71,7 @@ export default function ActiveRoute() {
</div>
</header>
- <main className="h-[calc(100dvh-var(--header-height))] w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
+ <main className="flex-1 min-h-0 w-full overflow-y-auto scrollbar-thin scrollbar-thumb-accent scrollbar-track-transparent">
<div className="w-full p-4 h-[var(--header-height)]">
<div className="relative">
<div className="flex justify-between gap-4">
diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.ts
index 0131d3d238..65f0b1cb89 100644
--- a/packages/database/src/swagger-docs-schema.ts
+++ b/packages/database/src/swagger-docs-schema.ts
@@ -106285,7 +106285,7 @@ export default {
properties: {
id: {
description:
- "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string"
},
@@ -106334,7 +106334,7 @@ export default {
},
supplierLocationId: {
description:
- "Note:\nThis is a Primary Key.<pk/>\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
+ "Note:\nThis is a Foreign Key to `supplierLocation.id`.<fk table='supplierLocation' column='id'/>",
format: "text",
type: "string"
},
diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts
index 35ee8d9b49..3694122401 100644
--- a/packages/database/src/types.ts
+++ b/packages/database/src/types.ts
@@ -68308,14 +68308,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -73397,21 +73397,21 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["shipmentCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["shipmentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
diff --git a/packages/database/supabase/functions/lib/types.ts b/packages/database/supabase/functions/lib/types.ts
index 35ee8d9b49..3694122401 100644
--- a/packages/database/supabase/functions/lib/types.ts
+++ b/packages/database/supabase/functions/lib/types.ts
@@ -68308,14 +68308,14 @@ export type Database = {
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["id"]
+ columns: ["supplierLocationId"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
},
{
foreignKeyName: "partner_id_fkey"
- columns: ["supplierLocationId"]
+ columns: ["id"]
isOneToOne: false
referencedRelation: "supplierLocation"
referencedColumns: ["id"]
@@ -73397,21 +73397,21 @@ export type Database = {
Relationships: [
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["shipmentCountryCode"]
+ columns: ["invoiceCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["invoiceCountryCode"]
+ columns: ["customerCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]
},
{
foreignKeyName: "address_countryCode_fkey"
- columns: ["customerCountryCode"]
+ columns: ["shipmentCountryCode"]
isOneToOne: false
referencedRelation: "country"
referencedColumns: ["alpha2"]