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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
fix(erp): document line items overflowed their card by the thumbnail width
sidgaikwad177fa190f93d
diff --git a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSummary.tsx b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSummary.tsxindex 356aa5ed8b..a6519b1fb1 100644--- a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSummary.tsx+++ b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSummary.tsx@@ -104,16 +104,16 @@ const LineItems = ({{line.thumbnailPath ? (<imgalt={itemReadableId ?? ""}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceSummary.tsx b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceSummary.tsxindex 3f0d295771..3ceda1eb88 100644--- a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceSummary.tsx+++ b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceSummary.tsx@@ -112,16 +112,16 @@ const LineItems = ({{line.thumbnailPath ? (<imgalt={itemReadableId ?? ""}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSummary.tsx b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSummary.tsxindex 621a250635..fa3344682c 100644--- a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSummary.tsx+++ b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSummary.tsx@@ -108,16 +108,16 @@ const LineItems = ({{line.thumbnailPath ? (<imgalt={itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteCompareDrawer.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteCompareDrawer.tsxindex cb06bb7bfa..a6cd91392d 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteCompareDrawer.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteCompareDrawer.tsx@@ -690,17 +690,21 @@ const LineSelectionView = ({{line.thumbnailPath ? (<imgalt={line.itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0}>- <Heading>{line.itemReadableId}</Heading>+ {/* flex-1 + min-w-0, not VStack's default w-full: `width: 100%`+ on a flex item resolves against the row's full width and+ ignores the thumbnail beside it, pushing the description past+ the card edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0">+ <Heading className="min-w-0">{line.itemReadableId}</Heading><span className="text-muted-foreground text-base truncate">{line.description}</span>diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteSummary.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteSummary.tsxindex 3ef75c89f9..3eb94cbc83 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteSummary.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteSummary.tsx@@ -112,16 +112,16 @@ const LineItems = ({{line.thumbnailPath ? (<imgalt={itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteToOrderDrawer.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteToOrderDrawer.tsxindex 2ce43ad372..42c453d367 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteToOrderDrawer.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteToOrderDrawer.tsx@@ -211,17 +211,21 @@ const LinePricingForm = ({{line.thumbnailPath ? (<imgalt={lineHeading!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0}>- <Heading>{lineHeading}</Heading>+ {/* flex-1 + min-w-0, not VStack's default w-full: `width: 100%`+ on a flex item resolves against the row's full width and+ ignores the thumbnail beside it, pushing the description past+ the card edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0">+ <Heading className="min-w-0">{lineHeading}</Heading><span className="text-muted-foreground text-base truncate">{isGlAccount? (accounts.find((a) => a.id === line.accountId)?.name ??diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteSummary.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteSummary.tsxindex be11226c4f..bee1210328 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteSummary.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteSummary.tsx@@ -168,16 +168,16 @@ const LineItems = ({{line.thumbnailPath ? (<imgalt={line.itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteToOrderDrawer.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteToOrderDrawer.tsxindex 399895f0e5..7e6b20ae59 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteToOrderDrawer.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteToOrderDrawer.tsx@@ -433,17 +433,21 @@ const LinePricingForm = ({{line.thumbnailPath ? (<imgalt={line.itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0}>- <Heading>{line.itemReadableId}</Heading>+ {/* flex-1 + min-w-0, not VStack's default w-full: `width: 100%`+ on a flex item resolves against the row's full width and+ ignores the thumbnail beside it, pushing the description past+ the card edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0">+ <Heading className="min-w-0">{line.itemReadableId}</Heading><span className="text-muted-foreground text-base truncate">{line.description}</span>diff --git a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderSummary.tsx b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderSummary.tsxindex ea2d87f5fa..b802ceebbf 100644--- a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderSummary.tsx+++ b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderSummary.tsx@@ -391,16 +391,16 @@ function LineItems({{line.thumbnailPath ? (<imgalt={line.itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={getPrivateUrl(line.thumbnailPath)}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ <VStack spacing={0} className="flex-1 min-w-0"><divclassName="flex flex-col cursor-pointer w-full"onClick={() => toggleOpen(line.id!)}diff --git a/apps/erp/app/routes/share+/purchasing-rfq.$id.tsx b/apps/erp/app/routes/share+/purchasing-rfq.$id.tsxindex 77686d63fe..0d0b39f21f 100644--- a/apps/erp/app/routes/share+/purchasing-rfq.$id.tsx+++ b/apps/erp/app/routes/share+/purchasing-rfq.$id.tsx@@ -183,24 +183,32 @@ const LineItems = ({{thumbnails[line.id] ? (<imgalt={line.itemReadableId ?? "Item"}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={thumbnails[line.id] ?? undefined}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ {/* flex-1 + min-w-0, not w-full: `width: 100%` on a flex item+ resolves against the row's full width and ignores the+ thumbnail beside it, pushing the description past the card+ edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0"><div- className="flex flex-col cursor-pointer w-full"+ className="flex flex-col cursor-pointer w-full min-w-0"// @ts-expect-error TS2345 - TODO: fix typeonClick={() => toggleOpen(line.id)}>- <div className="flex items-center gap-x-4 justify-between flex-grow">- <Heading>{line.itemReadableId ?? "Item"}</Heading>- <HStack spacing={4}>+ <div className="flex items-center gap-x-4 justify-between flex-grow min-w-0">+ {/* min-w-0 so a long item id wraps inside the card+ instead of shoving the chevron out of it. */}+ <Heading className="min-w-0">+ {line.itemReadableId ?? "Item"}+ </Heading>+ <HStack spacing={4} className="shrink-0"><motion.divanimate={{rotate: openItems.includes(line.id) ? 90 : 0diff --git a/apps/erp/app/routes/share+/quote.$id.tsx b/apps/erp/app/routes/share+/quote.$id.tsxindex 640d291f09..9ae5848f29 100644--- a/apps/erp/app/routes/share+/quote.$id.tsx+++ b/apps/erp/app/routes/share+/quote.$id.tsx@@ -403,23 +403,29 @@ const LineItems = ({{thumbnails[line.id!] ? (<imgalt={line.itemReadableId!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={thumbnails[line.id!] ?? undefined}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ {/* flex-1 + min-w-0, not w-full: `width: 100%` on a flex item+ resolves against the row's full width and ignores the+ thumbnail beside it, pushing the description and price+ past the card edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0"><div- className="flex flex-col cursor-pointer w-full"+ className="flex flex-col cursor-pointer w-full min-w-0"onClick={() => toggleOpen(line.id!)}>- <div className="flex items-center gap-x-4 justify-between flex-grow">- <Heading>{line.itemReadableId}</Heading>- <HStack spacing={4}>+ <div className="flex items-center gap-x-4 justify-between flex-grow min-w-0">+ {/* min-w-0 so a long item id wraps inside the card+ instead of shoving the price out of it. */}+ <Heading className="min-w-0">{line.itemReadableId}</Heading>+ <HStack spacing={4} className="shrink-0"><MotionMoneyvalue={(selectedLines[line.id!]?.convertedNetUnitPrice ??diff --git a/apps/erp/app/routes/share+/supplier-quote.$id.tsx b/apps/erp/app/routes/share+/supplier-quote.$id.tsxindex 04edfe99e0..266e648aa2 100644--- a/apps/erp/app/routes/share+/supplier-quote.$id.tsx+++ b/apps/erp/app/routes/share+/supplier-quote.$id.tsx@@ -386,23 +386,29 @@ const LineItems = ({{thumbnails[line.id] ? (<imgalt={lineHeading!}- className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"+ className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg"src={thumbnails[line.id] ?? undefined}/>) : (- <div className="w-24 h-24 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4">+ <div className="w-24 h-24 shrink-0 bg-gradient-to-bl from-muted to-muted/40 rounded-lg p-4"><LuImage className="w-16 h-16 text-muted-foreground" /></div>)}- <VStack spacing={0} className="w-full">+ {/* flex-1 + min-w-0, not w-full: `width: 100%` on a flex item+ resolves against the row's full width and ignores the+ thumbnail beside it, pushing the description past the card+ edge. min-w-0 is what lets truncate bite. */}+ <VStack spacing={0} className="flex-1 min-w-0"><div- className="flex flex-col cursor-pointer w-full"+ className="flex flex-col cursor-pointer w-full min-w-0"onClick={() => toggleOpen(line.id!)}>- <div className="flex items-center gap-x-4 justify-between flex-grow">- <Heading>{lineHeading}</Heading>- <HStack spacing={4}>+ <div className="flex items-center gap-x-4 justify-between flex-grow min-w-0">+ {/* min-w-0 so a long item id wraps inside the card+ instead of shoving the chevron out of it. */}+ <Heading className="min-w-0">{lineHeading}</Heading>+ <HStack spacing={4} className="shrink-0"><motion.divanimate={{rotate: openItems.includes(line.id!) ? 90 : 0