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.

fix(mes): make Job Operation files reachable on mobile (#1351)

Sankalp Thakur5d9cca67b8a3
diff --git a/.claude/rules/mes-job-operation-ui.md b/.claude/rules/mes-job-operation-ui.md
index 99c6e9f5da..8b63734029 100644
--- a/.claude/rules/mes-job-operation-ui.md
+++ b/.claude/rules/mes-job-operation-ui.md
@@ -127,13 +127,20 @@ per-entity (`sourceDocument="Entity"`, `trackedEntityLabel*`). See
## Responsive / CSS gotchas
-- CSS vars: **`--controls-width: 240px`** (fixed, in `apps/mes/app/styles/tailwind.css`),
+- CSS vars: **`--controls-width: 220px`** (260px at xl, in `apps/mes/app/styles/tailwind.css`),
`--controls-height` set inline from a computed `controlsHeight` memo, `--header-height`
- from `@carbon/react`. The Details `ScrollArea` reserves right space with
- `md:pr-[calc(var(--controls-width))]` and height
- `calc(100dvh - var(--header-height)*2 - var(--controls-height) - 2rem)`.
-- Header detail metadata is `hidden md:flex` (so `Controls` shows it on mobile instead);
- Materials "Source" column is `hidden lg:table-cell`; Procedure tab is `hidden lg:block`;
- the `Controls` panel is inline on mobile, `md:absolute` top-right on desktop.
+ from `@carbon/react`. Details scrollport classes live **inline on the details
+ container in `JobOperation.tsx`** (no separate helper):
+ - **Below `lg`:** `h-auto` + page scroll — Controls/Times stack inline under content so
+ Files / Serial Numbers stay reachable (do **not** put a viewport-filling fixed height
+ here; that nested-scroll trap was #959).
+ - **`lg+`:** fixed height
+ `calc(100dvh - var(--header-height)*2 - var(--controls-height) - 2rem)` with
+ `lg:pr-[var(--controls-gutter)]` so absolute Controls/Times dock without overlap.
+- Root Tabs is `min-h-screen h-auto lg:h-screen` for the same reason.
+- Header detail metadata is `hidden lg:flex` (so `Controls` shows it on mobile instead);
+ Materials "Source" column is `hidden lg:table-cell`; Procedure steps list is
+ `hidden lg:block`; the `Controls` panel is inline on mobile, `lg:absolute` top-right
+ on desktop.
<!-- UNVERIFIED: exact column set of jobOperation (status/duration fields) not fully audited here; check the live schema or 20240909194622_jobs.sql + later alters when relying on specific fields. -->
diff --git a/apps/mes/app/components/JobOperation/JobOperation.tsx b/apps/mes/app/components/JobOperation/JobOperation.tsx
index 94da4e51dd..74bf91ea0b 100644
--- a/apps/mes/app/components/JobOperation/JobOperation.tsx
+++ b/apps/mes/app/components/JobOperation/JobOperation.tsx
@@ -485,7 +485,9 @@ export const JobOperation = ({
key={`operation-${operation.id}`}
value={activeTab}
onValueChange={setActiveTab}
- className="w-full min-w-0 h-screen bg-card relative"
+ // Below lg the page scrolls (Controls stacks inline). A fixed h-screen
+ // box would clip that overflow; grow with content on small viewports.
+ className="w-full min-w-0 min-h-screen h-auto lg:h-screen bg-card relative"
style={
{
"--controls-height": `${controlsHeight}px`,
@@ -641,7 +643,13 @@ export const JobOperation = ({
<Separator />
<TabsContent value="details" className="flex flex-col">
- <ScrollArea className="w-full min-w-0 lg:pr-[var(--controls-gutter)] h-[calc(100dvh-var(--header-height)*2-var(--controls-height)-2rem)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent">
+ {/*
+ Native scrollport (not Radix ScrollArea): below lg height is auto so
+ Files/Serials participate in page scroll with the stacked Controls.
+ At lg+ a fixed height + overflow-y-auto docks beside absolute Controls.
+ (#959)
+ */}
+ <div className="w-full min-w-0 lg:pr-[var(--controls-gutter)] h-auto lg:h-[calc(100dvh-var(--header-height)*2-var(--controls-height)-2rem)] overflow-y-visible lg:overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent">
<div className="flex items-start justify-between gap-4 p-4 lg:p-6">
<HStack className="min-w-0">
{thumbnailPath && (
@@ -1836,7 +1844,7 @@ export const JobOperation = ({
</div>
</>
)}
- </ScrollArea>
+ </div>
</TabsContent>
<TabsContent value="model">
<div className="relative w-full min-w-0 lg:pr-[var(--controls-gutter)] h-[calc(100dvh-var(--header-height)*2-var(--controls-height)-2rem)] p-0">