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
feat: standardized Subheading + flush full-screen document editors (#1564)
Brad Barbin6409f4bc4ece
diff --git a/.ai/lessons.md b/.ai/lessons.mdindex 26a66c4b68..a048472675 100644--- a/.ai/lessons.md+++ b/.ai/lessons.md@@ -1287,6 +1287,29 @@ as the breakdown. Name the two so they cannot be confused (`violations` vs(`findExportScopeViolationsDetailed`, `computeScopeExclusions`, `totalExcludedRows`),`Manifest.excludedRowsByTable`, and any future "N things are wrong" surface.+## Full-screen height calcs must subtract the app-shell inset++**Context:** The ERP app shell (`apps/erp/app/routes/x+/_layout.tsx`, PR #1551) moved+content into an inset floating panel with `md:mt-2 md:mb-2` (8px top + 8px bottom+gutters). ~81 full-screen pages/explorers sized themselves with+`calc(100dvh - var(--topbar-height) [- var(--header-height)])`, which assumes the+content spans the full viewport.++**Problem:** Those containers are 16px taller than the panel at md+, so bottom-pinned+content is pushed below the panel's clipped edge. The Procedures "Add Step" footer was+sheared in half; the overflow was invisible on pages whose content merely scrolls.++**Rule:** `vh`/`dvh` ignore the panel inset by nature, so any full-height calc inside the+content panel must subtract `var(--content-inset)` (defined in `styles/tailwind.css`: 0+below md, 1rem at md+), e.g. `h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]`.+Prefer `h-full`/flex height inheritance from `<main>` for new pages so the inset never+has to be tracked by hand. Do NOT add the inset to viewport-fixed/body-portaled elements+(dialogs, drawers) or to `PrimaryNavigation`, which live outside the panel.++**Applies to:** every `calc(100dvh-var(--topbar-height)...)` in `apps/erp/app`, the shared+`components/Layout/Panels.tsx` + `Navigation/CollapsibleSidebar.tsx`, and any new+full-screen ERP route.+## The backups schema baseline on main can carry phantom tables from a dirty local DB**Context:** `pnpm db:check:backups` blocked the currency-refactor commit on `onshapeSyncRun`/`onshapeItemSyncState` — tables with NO migration anywhere in the repo.diff --git a/.ai/plans/2026-09-03-full-screen-editor-title.md b/.ai/plans/2026-09-03-full-screen-editor-title.mdnew file mode 100644index 0000000000..d38c64a60f--- /dev/null+++ b/.ai/plans/2026-09-03-full-screen-editor-title.md@@ -0,0 +1,83 @@+# Full-screen editor: locked title block + flush toolbar++## Scope+The two full-screen document editors only: **quality-document** (`QualityDocumentEditor.tsx`)+and **procedure** (inline `ProcedureEditor` in `procedure+/$id.tsx`). Everything else that+uses `@carbon/react/Editor` (notes, issue, chat, ~30 sites) must be **unchanged**.++## Goals (from the screenshot + request)+1. Remove padding so the formatting toolbar is **flush to the top and sides**.+2. Add **spacing between the toolbar and the content**.+3. **Move the title into the editor** as the locked first block, always an **H1**, and+ **sync it with the header title bar** — full-screen only.++## Approach — single editor, title = locked first H1 block+Plane uses two Yjs-bound editors; Carbon has no Yjs and stores `name`/`content` separately,+and we need the order **toolbar → title → body** (toolbar is the body editor's `slotBefore`).+A single editor whose node 0 is a locked H1 gives that order with the least surgery and+matches the request ("first block locked to be the title"). We borrow Plane's schema trick+(`Document.extend`) + Enter/Backspace keymap glue, in one editor.++**Backward-compatible data:** `content` stays title-free. The Editor composes the initial+doc as `[H1(title.value), ...initialValue.content]` and, on change, emits the **body without+node 0** back to `onChange` (unchanged `content` shape) plus the title text separately. No+migration; `name` and `content` keep their current storage.++### A. `packages/react/src/Editor/Editor.tsx` — opt-in `title` prop (default off)+```ts+title?: { value: string; onChange: (title: string) => void; placeholder?: string };+```+When set:+- Swap StarterKit's Document for `Document.extend({ content: "heading block+" })` and add a+ new **DocumentTitle** extension (below). When unset, extensions are exactly as today.+- Compose initial doc = `{ type:"doc", content:[ heading1(value), ...(initialValue?.content ?? [paragraph]) ] }`.+- `onUpdate`: split node 0 → `title.onChange(text)`; nodes 1.. → `onChange({type:"doc",content: rest})`.+- Apply content padding + toolbar→content gap **only in title mode** (see C).++### B. `packages/tiptap/src/extensions/document-title.ts` (new) — the lock+- Force node 0 heading `level = 1` (`appendTransaction`).+- Keymap: `Backspace` at doc start = no-op (can't delete/merge title); `Enter` in the title+ inserts a paragraph as node 1 and moves the cursor into it (Plane's behavior).+- Placeholder: title node → `title.placeholder ?? "Untitled"`; other empty nodes keep the+ existing "Press '/' for commands".+- Style hook: first-child H1 renders big (`text-3xl md:text-... font-semibold tracking-tight`)+ via `theme.css` (`.ProseMirror > h1:first-child`) so it reads like the old title.++### C. Flush toolbar + spacing+- Drop `p-6`/`gap-6` from the two editor wrappers → wrapper becomes `flex flex-col w-full h-full`.+ Toolbar (`sticky top-0 w-full ... p-2`) is then flush top + full-width.+- In title mode, pad the **ProseMirror content** (not the toolbar): add `px-6 pt-6` (or a+ `contentClassName`) so title+body have side gutters and a gap below the flush toolbar.++### D. Consumers (`QualityDocumentEditor.tsx`, inline `ProcedureEditor`)+- Delete the separate `<Input>` title.+- Pass `title={{ value: documentName, onChange: (t)=>{ setDocumentName(t); debouncedUpdateName(t); }, placeholder: t\`Untitled\` }}`.+- Keep content save (`updateContent` debounce) and name save (`updateName` fetcher) exactly as+ today — they just get fed from the split.+- Read-only (non-draft) fallback: render name as an `<h1>` above the `prose` body.++### E. Header live-sync ("sync with the title bar on top")+- Add a nanostore atom `documentTitleStore` (`~/stores`), set by the editor's `title.onChange`,+ read by `QualityDocumentHeader`/`ProcedureHeader` (prefer live value over `routeData.name`).+ Cleared/reset on id change. Persist + revalidate still go through `updateName` (source of truth).+- Reverse (header/form edits name → editor) already works via the route `key` re-seeding on+ revalidate; no extra wiring.++## Files+- `packages/react/src/Editor/Editor.tsx` (+ maybe `extensions.ts`)+- `packages/tiptap/src/extensions/document-title.ts` (new) + barrel+- `packages/config/tailwind/theme.css` (title first-child styling)+- `apps/erp/app/modules/quality/ui/Documents/QualityDocumentEditor.tsx`+- `apps/erp/app/routes/x+/procedure+/$id.tsx` (inline `ProcedureEditor`)+- `apps/erp/app/stores/*` (new title store) + `QualityDocumentHeader.tsx` + `ProcedureHeader.tsx`++## Risks+- Shared Editor contract — gated behind opt-in `title` prop; default path byte-identical. Verify+ notes/issue render unchanged.+- Enter/Backspace edge cases at the title↔body boundary.+- Title placeholder vs the existing heading placeholder must not collide.++## Verification+- `pnpm --filter @carbon/react typecheck`; scoped erp typecheck; biome.+- Browser: quality-document + procedure — locked H1 title, flush toolbar, gap, live header+ update, name+content persist; notes/issue unchanged.diff --git a/apps/erp/app/components/AttachmentsList.tsx b/apps/erp/app/components/AttachmentsList.tsxindex baf2dcb7f0..92e0868643 100644--- a/apps/erp/app/components/AttachmentsList.tsx+++ b/apps/erp/app/components/AttachmentsList.tsx@@ -4,6 +4,7 @@ import {HStack,IconButton,Spinner,+ Subheading,toast,VStack} from "@carbon/react";@@ -126,9 +127,9 @@ export default function AttachmentsList({return (<VStack spacing={2} className="w-full">- <div className="text-[11px] font-semibold uppercase text-muted-foreground">+ <Subheading variant="heavy" className="block"><Trans>Attachments</Trans>- </div>+ </Subheading><VStack spacing={1} className="w-full">{pinned.map((p) => (diff --git a/apps/erp/app/components/DocumentTemplateEditor/SectionFormModal.tsx b/apps/erp/app/components/DocumentTemplateEditor/SectionFormModal.tsxindex 887a2aaf6d..fd9cef556c 100644--- a/apps/erp/app/components/DocumentTemplateEditor/SectionFormModal.tsx+++ b/apps/erp/app/components/DocumentTemplateEditor/SectionFormModal.tsx@@ -34,6 +34,7 @@ import {SelectItem,SelectTrigger,SelectValue,+ Subheading,Switch,VStack} from "@carbon/react";@@ -177,9 +178,9 @@ export function SectionFormModal({{isHeader && (<div className="flex w-full flex-col gap-3 rounded-md border bg-muted/30 p-3">- <p className="text-xs font-medium uppercase tracking-wide text-muted-foreground">+ <Subheading variant="heavy" className="block">Header layout- </p>+ </Subheading><p className="text-xs text-muted-foreground">Set the logo from the Logo item under Header.</p>diff --git a/apps/erp/app/components/DocumentTemplateEditor/index.tsx b/apps/erp/app/components/DocumentTemplateEditor/index.tsxindex 16a1b69555..2729eac173 100644--- a/apps/erp/app/components/DocumentTemplateEditor/index.tsx+++ b/apps/erp/app/components/DocumentTemplateEditor/index.tsx@@ -19,6 +19,7 @@ import {SelectItem,SelectTrigger,SelectValue,+ Subheading,Tabs,TabsContent,TabsList,@@ -132,7 +133,9 @@ export function DocumentTemplateEditor({><ScrollArea className="h-full bg-card"><div className="flex flex-col gap-1.5 p-3">- <h2 className={RAIL_HEADING}>Configure</h2>+ <Subheading as="h2" variant="heavy" className="block">+ Configure+ </Subheading><BlockConfig /></div></ScrollArea>@@ -143,16 +146,9 @@ export function DocumentTemplateEditor({);}-const RAIL_HEADING =- "text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";-/** Sentinel option for the preview picker — falls back to sample data. */const SAMPLE_DATA_VALUE = "__sample__";-/** Tiny caption above a toolbar picker. */-const PICKER_LABEL =- "text-[10px] font-medium uppercase tracking-wide text-muted-foreground";-/*** Left rail: block layers (incl. the Header block + Footer row) and a tab group* for document-wide Style (typography) and Colors. The contextual Configure@@ -170,7 +166,9 @@ function ControlRail() {<div className="flex h-full flex-col bg-card">{/* Fixed Blocks header with the inline add-block button. */}<div className="flex shrink-0 items-center justify-between px-3 pt-3 pb-1">- <h2 className={RAIL_HEADING}>Blocks</h2>+ <Subheading as="h2" variant="heavy" className="block">+ Blocks+ </Subheading><AddBlockMenu /></div>@@ -204,7 +202,9 @@ function ControlRail() {<ScrollArea className="max-h-[45vh]"><TabsContent value="style" className="flex flex-col gap-5 p-3 pt-4"><section className="flex flex-col gap-3">- <h3 className={RAIL_HEADING}>Typography</h3>+ <Subheading as="h3" variant="heavy" className="block">+ Typography+ </Subheading><FontConfig /></section></TabsContent>@@ -214,7 +214,9 @@ function ControlRail() {className="flex flex-col gap-5 p-3 pt-4"><section className="flex flex-col gap-2">- <h3 className={RAIL_HEADING}>Theme colors</h3>+ <Subheading as="h3" variant="heavy" className="block">+ Theme colors+ </Subheading><ThemeConfig /></section></TabsContent>@@ -313,7 +315,7 @@ function EditorToolbar({</div>{previewEntities.length > 0 && (<div className="flex min-w-0 max-w-[280px] flex-1 flex-col items-center gap-0.5 self-end">- <span className={PICKER_LABEL}>Preview data</span>+ <Subheading variant="heavy">Preview data</Subheading><Selectvalue={previewId ?? SAMPLE_DATA_VALUE}onValueChange={(value) =>@@ -374,7 +376,7 @@ function LabelSizePicker() {return (<div className="flex flex-col items-start gap-0.5">- <span className={PICKER_LABEL}>Preview size</span>+ <Subheading variant="heavy">Preview size</Subheading><Select value={labelSizeId} onValueChange={setLabelSizeId}><SelectTrigger size="sm" className="w-[160px]"><SelectValue placeholder="Label size" />diff --git a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsxindex 5c1f0e77ff..cb230ffc6d 100644--- a/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx+++ b/apps/erp/app/components/Layout/Navigation/CollapsibleSidebar.tsx@@ -172,7 +172,7 @@ export const CollapsibleSidebar = ({}}variants={variants}- className="relative flex h-[calc(100dvh-var(--topbar-height))]"+ className="relative flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><div className="h-full w-full overflow-hidden bg-card border-r border-border">{isOpen ? children : null}diff --git a/apps/erp/app/components/Layout/Navigation/GroupedContentSidebar.tsx b/apps/erp/app/components/Layout/Navigation/GroupedContentSidebar.tsxindex 5902fdf769..b19c5df159 100644--- a/apps/erp/app/components/Layout/Navigation/GroupedContentSidebar.tsx+++ b/apps/erp/app/components/Layout/Navigation/GroupedContentSidebar.tsx@@ -7,6 +7,7 @@ import {DropdownMenuItem,DropdownMenuTrigger,IconButton,+ Subheading,useDebounce,VStack} from "@carbon/react";@@ -78,9 +79,9 @@ const GroupedContentSidebar = ({key={group.name}className="border-b border-border p-2 pb-4 space-y-0.5">- <h4 className="text-xxs text-foreground/70 uppercase font-light tracking-wide pl-4 py-1">+ <Subheading as="h4" variant="light" className="pl-4 py-1">{group.name}- </h4>+ </Subheading>{group.routes.map((route) => {const isActive = route.isActive? route.isActive(location.pathname)diff --git a/apps/erp/app/components/Layout/Panels.tsx b/apps/erp/app/components/Layout/Panels.tsxindex de139dd692..f783fb9acd 100644--- a/apps/erp/app/components/Layout/Panels.tsx+++ b/apps/erp/app/components/Layout/Panels.tsx@@ -128,7 +128,7 @@ export function ResizablePanels({// full-width and float the explorer / properties as overlay drawers instead.if (isMobile) {return (- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] w-full overflow-hidden">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] w-full overflow-hidden">{content}{explorer && (<Drawer@@ -189,7 +189,7 @@ export function ResizablePanels({</ResizablePanel><ResizableHandle withHandle /><ResizablePanel order={2} className="z-1 relative">- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full">{content}{!isPropertiesCollapsed && properties}</div>diff --git a/apps/erp/app/components/Layout/Topbar/Search.tsx b/apps/erp/app/components/Layout/Topbar/Search.tsxindex 2e5733820c..fedd8a943f 100644--- a/apps/erp/app/components/Layout/Topbar/Search.tsx+++ b/apps/erp/app/components/Layout/Topbar/Search.tsx@@ -9,6 +9,7 @@ import {cn,Modal,ModalContent,+ Subheading,useDebounce,VStack} from "@carbon/react";@@ -259,10 +260,13 @@ export const SearchModal = () => {<><CommandGroupheading={- <span className="flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ <Subheading+ variant="heavy"+ className="flex items-center gap-1.5"+ ><LuClock className="w-3 h-3" /><Trans>Recent</Trans>- </span>+ </Subheading>}key="recent">@@ -322,9 +326,9 @@ export const SearchModal = () => {{searchResults.length > 0 && (<CommandGroupheading={- <span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ <Subheading variant="heavy"><Trans>Results</Trans>- </span>+ </Subheading>}key="search">@@ -375,9 +379,7 @@ export const SearchModal = () => {<div key={`static-${module}`}><CommandGroupheading={- <span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">- {module}- </span>+ <Subheading variant="heavy">{module}</Subheading>}>{filteredSubmodules.map((submodule, index) => {diff --git a/apps/erp/app/components/SettingsSectionHeader.tsx b/apps/erp/app/components/SettingsSectionHeader.tsxindex 2745167ef4..158f1fd153 100644--- a/apps/erp/app/components/SettingsSectionHeader.tsx+++ b/apps/erp/app/components/SettingsSectionHeader.tsx@@ -1,4 +1,4 @@-import { cn } from "@carbon/react";+import { cn, Subheading } from "@carbon/react";import type { ReactNode } from "react";type Props = {@@ -10,16 +10,14 @@ type Props = {* Small uppercase label that groups related settings cards into a section.* Use it above a run of `<Card>`s on a settings page so related settings read* as one group (see the purchasing settings page for the reference layout).+ *+ * Thin wrapper around the standardized `Subheading` (light) that keeps the+ * settings-specific top margin.*/export default function SettingsSectionHeader({ children, className }: Props) {return (- <p- className={cn(- "mt-4 text-foreground/70 uppercase font-light tracking-wide font-mono text-xs",- className- )}- >+ <Subheading variant="light" className={cn("mt-4", className)}>{children}- </p>+ </Subheading>);}diff --git a/apps/erp/app/components/UpgradeOverlay/UpgradeOverlay.tsx b/apps/erp/app/components/UpgradeOverlay/UpgradeOverlay.tsxindex bbba765389..7558a68d3a 100644--- a/apps/erp/app/components/UpgradeOverlay/UpgradeOverlay.tsx+++ b/apps/erp/app/components/UpgradeOverlay/UpgradeOverlay.tsx@@ -18,7 +18,7 @@ function UpgradeOverlayRoot({ children, className }: WithChildren) {return (<divclassName={cn(- "relative w-full h-full min-h-[calc(100dvh-var(--topbar-height))]",+ "relative w-full h-full min-h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]",className)}>diff --git a/apps/erp/app/modules/inventory/ui/Traceability/ContainmentList.tsx b/apps/erp/app/modules/inventory/ui/Traceability/ContainmentList.tsxindex 7adce3432e..45800851dc 100644--- a/apps/erp/app/modules/inventory/ui/Traceability/ContainmentList.tsx+++ b/apps/erp/app/modules/inventory/ui/Traceability/ContainmentList.tsx@@ -1,4 +1,4 @@-import { cn } from "@carbon/react";+import { cn, Subheading } from "@carbon/react";import { LuExternalLink } from "react-icons/lu";import { Link } from "react-router";import { path } from "~/utils/path";@@ -42,9 +42,7 @@ export function ContainmentList({ items }: Props) {</div><div className="flex items-center gap-1.5 shrink-0">{item.priority && (- <span className="text-[10px] uppercase tracking-wide text-muted-foreground">- {item.priority}- </span>+ <Subheading variant="heavy">{item.priority}</Subheading>)}<LuExternalLink className="size-3 text-muted-foreground/60 group-hover:text-foreground transition-colors" /></div>diff --git a/apps/erp/app/modules/inventory/ui/Traceability/ExpiryTracePopover.tsx b/apps/erp/app/modules/inventory/ui/Traceability/ExpiryTracePopover.tsxindex 65652cde15..7d69beaf04 100644--- a/apps/erp/app/modules/inventory/ui/Traceability/ExpiryTracePopover.tsx+++ b/apps/erp/app/modules/inventory/ui/Traceability/ExpiryTracePopover.tsx@@ -1,4 +1,9 @@-import { Popover, PopoverContent, PopoverTrigger } from "@carbon/react";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+ Subheading+} from "@carbon/react";import {getLocalTimeZone,parseAbsolute,@@ -150,9 +155,7 @@ export function ExpiryTracePopover({{/* Content */}<div className={"min-w-0 " + (isLast ? "pb-0" : "pb-3")}><div className="flex items-center gap-1.5">- <span className="text-[10px] uppercase tracking-wide font-medium text-muted-foreground">- {step.step}- </span>+ <Subheading variant="heavy">{step.step}</Subheading></div>{step.href ? (<Linkdiff --git a/apps/erp/app/modules/inventory/ui/Traceability/GraphLegend.tsx b/apps/erp/app/modules/inventory/ui/Traceability/GraphLegend.tsxindex 8903f2569b..3de9902b58 100644--- a/apps/erp/app/modules/inventory/ui/Traceability/GraphLegend.tsx+++ b/apps/erp/app/modules/inventory/ui/Traceability/GraphLegend.tsx@@ -4,6 +4,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ Subheading,VStack} from "@carbon/react";import type { IconType } from "react-icons";@@ -88,9 +89,9 @@ export function GraphLegend() {<Section title="Activities" entries={ACTIVITY_ENTRIES} /></HStack><div className="border-t border-border p-4">- <span className="block text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2">+ <Subheading variant="heavy" className="block mb-2">Lines- </span>+ </Subheading><VStack spacing={2}><LineRowlabel="Normal flow"@@ -128,9 +129,9 @@ export function GraphLegend() {function Section({ title, entries }: { title: string; entries: Entry[] }) {return (<VStack spacing={3} className="p-4 flex-1 min-w-0">- <span className="text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-1">+ <Subheading variant="heavy" className="mb-1">{title}- </span>+ </Subheading>{entries.map((entry) => (<Row key={entry.label} entry={entry} />))}diff --git a/apps/erp/app/modules/inventory/ui/Traceability/GraphToolbar.tsx b/apps/erp/app/modules/inventory/ui/Traceability/GraphToolbar.tsxindex 0a8753f839..d251e226d8 100644--- a/apps/erp/app/modules/inventory/ui/Traceability/GraphToolbar.tsx+++ b/apps/erp/app/modules/inventory/ui/Traceability/GraphToolbar.tsx@@ -7,6 +7,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ Subheading,VStack} from "@carbon/react";import { useReactFlow } from "@xyflow/react";@@ -413,9 +414,7 @@ function SpacingSlider({className="w-auto p-3"><VStack spacing={2} className="items-center">- <span className="text-[10px] uppercase tracking-wider text-muted-foreground font-semibold">- Spacing- </span>+ <Subheading variant="heavy">Spacing</Subheading><span className="text-base font-medium tabular-nums text-foreground">{value}</span>diff --git a/apps/erp/app/modules/inventory/ui/Traceability/TraceabilitySidebar.tsx b/apps/erp/app/modules/inventory/ui/Traceability/TraceabilitySidebar.tsxindex 8906f2a8bd..e84f1f5a63 100644--- a/apps/erp/app/modules/inventory/ui/Traceability/TraceabilitySidebar.tsx+++ b/apps/erp/app/modules/inventory/ui/Traceability/TraceabilitySidebar.tsx@@ -3,6 +3,7 @@ import {Button,cn,Skeleton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger@@ -613,14 +614,17 @@ function Section({return (<section className="px-3 py-3">{title && (- <header className="flex items-center justify-between text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2">+ <Subheading+ variant="heavy"+ className="flex items-center justify-between mb-2"+ ><span>{title}</span>{typeof count === "number" && (<span className="tabular-nums text-muted-foreground/60">{count}</span>)}- </header>+ </Subheading>)}{children}</section>diff --git a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceExplorer.tsx b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceExplorer.tsxindex 899ae8843d..9d4f79ffbb 100644--- a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceExplorer.tsx+++ b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceExplorer.tsx@@ -122,7 +122,7 @@ export default function PurchaseInvoiceExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceProperties.tsx b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceProperties.tsxindex 2d422d3947..93016ddffb 100644--- a/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceProperties.tsx+++ b/apps/erp/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceProperties.tsx@@ -4,6 +4,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -118,9 +119,9 @@ const PurchaseInvoiceProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceExplorer.tsx b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceExplorer.tsxindex 32667d2a4f..01380db712 100644--- a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceExplorer.tsx+++ b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceExplorer.tsx@@ -117,7 +117,7 @@ export default function SalesInvoiceExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceProperties.tsx b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceProperties.tsxindex 7659ab94d4..2083585fc5 100644--- a/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceProperties.tsx+++ b/apps/erp/app/modules/invoicing/ui/SalesInvoice/SalesInvoiceProperties.tsx@@ -4,6 +4,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -112,9 +113,9 @@ const SalesInvoiceProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsxindex 84f2add370..3391b7657b 100644--- a/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeDiffViewer.tsx@@ -6,6 +6,7 @@ import {cn,HStack,LabelWithHelp,+ Subheading,VStack} from "@carbon/react";import { getItemReadableId } from "@carbon/utils";@@ -583,9 +584,9 @@ function OperationEntry({ entry }: { entry: OperationDiffEntry }) {<EntryBody entry={entry} skip={OPERATION_LABEL_FIELDS} />{buckets.map(({ bucket, changed }) => (<div key={bucket.key} className="w-full">- <div className="text-[0.65rem] font-medium uppercase text-muted-foreground pb-0.5">+ <Subheading variant="heavy" className="block pb-0.5">{bucket.title}- </div>+ </Subheading><TreeChildren>{changed.map((child, i) => (<TreeNode@@ -731,9 +732,9 @@ export default function ChangeNoticeDiffViewer({<div className="w-full rounded-lg border border-border p-3"><div className="pb-2"><LabelWithHelp termId="change-order" variant="inline">- <span className="text-xs font-medium uppercase text-muted-foreground">+ <Subheading variant="heavy"><Trans>Changes</Trans>- </span>+ </Subheading></LabelWithHelp></div>{body}diff --git a/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsxindex 7b5c02e5a9..a7871bec5d 100644--- a/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx+++ b/apps/erp/app/modules/items/ui/ChangeNotice/ChangeNoticeProperties.tsx@@ -8,6 +8,7 @@ import {Button,HStack,Separator,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -49,9 +50,9 @@ function PropertiesSection({return (<VStack spacing={2} className="w-full"><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light">{title}- </h3>+ </Subheading>{accessory}</HStack>{children}@@ -150,9 +151,9 @@ const ChangeNoticeProperties = () => {<VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><Tooltip><TooltipTrigger asChild><Buttondiff --git a/apps/erp/app/modules/items/ui/Consumables/ConsumableProperties.tsx b/apps/erp/app/modules/items/ui/Consumables/ConsumableProperties.tsxindex 8a59121d7f..72deb35856 100644--- a/apps/erp/app/modules/items/ui/Consumables/ConsumableProperties.tsx+++ b/apps/erp/app/modules/items/ui/Consumables/ConsumableProperties.tsx@@ -4,6 +4,7 @@ import {Badge,Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -197,9 +198,9 @@ const ConsumableProperties = ({ data }: ConsumablePropertiesProps) => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsxindex 0ff90b6f4e..e6ad47ba3e 100644--- a/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx+++ b/apps/erp/app/modules/items/ui/Item/BillOfProcess.tsx@@ -24,6 +24,7 @@ import {IconButton,Label,Loading,+ Subheading,ToggleGroup,ToggleGroupItem,Tooltip,@@ -3639,9 +3640,9 @@ function OperationPreview({) : null}<div className="flex flex-col gap-1 border-t pt-3">- <span className="text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ <Subheading variant="heavy"><Trans>Tools</Trans>- </span>+ </Subheading>{stepTools.length > 0 ? (stepTools.map((tl, i) => {const tool = allTools.find((x) => x.id === tl.toolId);diff --git a/apps/erp/app/modules/items/ui/Materials/MaterialProperties.tsx b/apps/erp/app/modules/items/ui/Materials/MaterialProperties.tsxindex 1519391886..579e38e1f5 100644--- a/apps/erp/app/modules/items/ui/Materials/MaterialProperties.tsx+++ b/apps/erp/app/modules/items/ui/Materials/MaterialProperties.tsx@@ -12,6 +12,7 @@ import {ModalFooter,ModalHeader,ModalTitle,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -300,9 +301,9 @@ const MaterialProperties = ({ data }: MaterialPropertiesProps) => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx b/apps/erp/app/modules/items/ui/Parts/PartProperties.tsxindex 213e634287..f6e0b9c276 100644--- a/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx+++ b/apps/erp/app/modules/items/ui/Parts/PartProperties.tsx@@ -5,6 +5,7 @@ import {Button,cn,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -382,9 +383,9 @@ const PartProperties = ({copy affordances there. Part page (non-embedded) is unchanged. */}{!embedded && (<HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/items/ui/Services/ServiceProperties.tsx b/apps/erp/app/modules/items/ui/Services/ServiceProperties.tsxindex 5d8ac66d66..a200fb88ef 100644--- a/apps/erp/app/modules/items/ui/Services/ServiceProperties.tsx+++ b/apps/erp/app/modules/items/ui/Services/ServiceProperties.tsx@@ -4,6 +4,7 @@ import {Badge,Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -159,9 +160,9 @@ const ServiceProperties = ({ data }: ServicePropertiesProps) => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/items/ui/Tools/ToolProperties.tsx b/apps/erp/app/modules/items/ui/Tools/ToolProperties.tsxindex 41b144a26c..7e824a2b97 100644--- a/apps/erp/app/modules/items/ui/Tools/ToolProperties.tsx+++ b/apps/erp/app/modules/items/ui/Tools/ToolProperties.tsx@@ -4,6 +4,7 @@ import {Badge,Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -210,9 +211,9 @@ const ToolProperties = ({ data }: ToolPropertiesProps) => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsx b/apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsxindex b9af34ba48..75b29dde7f 100644--- a/apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsx+++ b/apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsx@@ -19,6 +19,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -613,9 +614,9 @@ export default function AssemblyBomTree({onWheel={(e) => e.stopPropagation()}onTouchMove={(e) => e.stopPropagation()}>- <p className="px-2 py-1.5 text-xxs font-medium uppercase tracking-wide text-muted-foreground">+ <Subheading variant="heavy" className="block px-2 py-1.5">Add {selectedNodeIds.length} to step- </p>+ </Subheading><ul className="max-h-64 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent">{stepList.map((entry) => (<li key={entry.id}>diff --git a/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsx b/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsxindex 1a0a446e84..33c35a39c7 100644--- a/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsx+++ b/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsx@@ -527,7 +527,7 @@ function AssemblyInstructionExplorer({<Tabsvalue={tab}onValueChange={(value) => setTab(value as "steps" | "components")}- className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] w-full flex-col"+ className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] w-full flex-col"><TabsList className="w-auto flex-none gap-1 mx-3 mt-3"><TabsTrigger className="flex-1" value="steps">diff --git a/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx b/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsxindex b6167dbd7d..15021c7cd3 100644--- a/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx+++ b/apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx@@ -17,6 +17,7 @@ import {HStack,IconButton,Label,+ Subheading,Tabs,TabsContent,TabsList,@@ -153,11 +154,11 @@ const AssemblyInstructionProperties = ({{step ? (<VStack spacing={1} className="w-full min-w-0"><HStack className="w-full min-w-0 items-center justify-between gap-2">- <span className="shrink-0 text-xxs font-medium uppercase tracking-wide text-muted-foreground tabular-nums">+ <Subheading variant="heavy" className="shrink-0 tabular-nums">{stepIndex != null? `Step ${stepIndex + 1} of ${stepCount}`: "Step"}- </span>+ </Subheading><StepStatusPill status={normalizeStatus(step.status)} /></HStack><h3 className="w-full min-w-0 truncate text-sm font-medium text-foreground">@@ -180,9 +181,7 @@ const AssemblyInstructionProperties = ({</HStack></VStack>) : (- <span className="text-xxs font-medium uppercase tracking-wide text-muted-foreground">- Step- </span>+ <Subheading variant="heavy">Step</Subheading>)}</div>{step ? (@@ -522,9 +521,9 @@ function StepForm({description="Operators must record this step to complete the operation"/>- <h4 className="w-full pt-1 text-xxs font-medium uppercase tracking-wide text-muted-foreground">+ <Subheading as="h4" variant="heavy" className="block w-full pt-1">Playback & components- </h4>+ </Subheading><VStackspacing={2}className="w-full rounded-lg border border-border bg-muted/40 p-3"diff --git a/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepMaterials.tsx b/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepMaterials.tsxindex 9cf2daa487..33946d1cff 100644--- a/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepMaterials.tsx+++ b/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepMaterials.tsx@@ -1,5 +1,5 @@import { Combobox, Hidden, Number, Submit, ValidatedForm } from "@carbon/form";-import { Badge, HStack, IconButton, VStack } from "@carbon/react";+import { Badge, HStack, IconButton, Subheading, VStack } from "@carbon/react";import { useEffect, useMemo, useState } from "react";import { LuCirclePlus, LuTrash } from "react-icons/lu";import { useFetcher } from "react-router";@@ -75,9 +75,9 @@ export default function AssemblyStepMaterials({return (<VStack spacing={2} className="w-full">- <h4 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h4" variant="light">Materials- </h4>+ </Subheading>{materials.length === 0 ? (<p className="text-xs text-muted-foreground">No materials to display</p>) : (diff --git a/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepTools.tsx b/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepTools.tsxindex c450d52c2e..a641004cce 100644--- a/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepTools.tsx+++ b/apps/erp/app/modules/production/ui/Assemblies/AssemblyStepTools.tsx@@ -1,5 +1,5 @@import { Hidden, Number, Submit, ValidatedForm } from "@carbon/form";-import { Badge, HStack, IconButton, VStack } from "@carbon/react";+import { Badge, HStack, IconButton, Subheading, VStack } from "@carbon/react";import { useEffect, useState } from "react";import { LuCirclePlus, LuTrash } from "react-icons/lu";import { useFetcher } from "react-router";@@ -39,9 +39,9 @@ export default function AssemblyStepTools({return (<VStack spacing={2} className="w-full">- <h4 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h4" variant="light">Tools- </h4>+ </Subheading>{tools.length === 0 ? (<p className="text-xs text-muted-foreground">No tools to display</p>) : (diff --git a/apps/erp/app/modules/production/ui/Jobs/JobDag.tsx b/apps/erp/app/modules/production/ui/Jobs/JobDag.tsxindex c1c79df149..7e4514572a 100644--- a/apps/erp/app/modules/production/ui/Jobs/JobDag.tsx+++ b/apps/erp/app/modules/production/ui/Jobs/JobDag.tsx@@ -4,6 +4,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ Subheading,VStack} from "@carbon/react";import Dagre from "@dagrejs/dagre";@@ -255,9 +256,9 @@ function DagLegend() {align="start"className="w-auto p-3 border-border">- <span className="block text-[10px] uppercase tracking-wider text-muted-foreground font-semibold mb-2">+ <Subheading variant="heavy" className="block mb-2">Operation Status- </span>+ </Subheading><VStack spacing={2}>{entries.map((entry) => (<HStack key={entry.label} spacing={3} className="items-center">diff --git a/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx b/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsxindex b7bd04317b..8c36ee859a 100644--- a/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx+++ b/apps/erp/app/modules/production/ui/Jobs/JobProperties.tsx@@ -17,6 +17,7 @@ import {ModalHeader,ModalOverlay,ModalTitle,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -190,9 +191,9 @@ const JobProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsx b/apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsxindex a23c4efc2b..a1fde02323 100644--- a/apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsx+++ b/apps/erp/app/modules/production/ui/Procedures/ProcedureExplorer.tsx@@ -246,7 +246,7 @@ export default function ProcedureExplorer() {);return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><TabsdefaultValue="attributes"className="w-full flex-1 h-full flex flex-col"diff --git a/apps/erp/app/modules/production/ui/Procedures/ProcedureHeader.tsx b/apps/erp/app/modules/production/ui/Procedures/ProcedureHeader.tsxindex 161f421c84..a3118889ec 100644--- a/apps/erp/app/modules/production/ui/Procedures/ProcedureHeader.tsx+++ b/apps/erp/app/modules/production/ui/Procedures/ProcedureHeader.tsx@@ -26,6 +26,7 @@ import { VersionMenu } from "~/components";import { usePanels } from "~/components/Layout";import ConfirmDelete from "~/components/Modals/ConfirmDelete";import { usePermissions, useRouteData } from "~/hooks";+import { useDocumentStore } from "~/stores";import { path } from "~/utils/path";import type { Procedure } from "../../types";import ProcedureForm from "./ProcedureForm";@@ -43,6 +44,9 @@ const ProcedureHeader = () => {const permissions = usePermissions();const { toggleExplorer, toggleProperties } = usePanels();+ // Live title from the editor's locked title block (updates before revalidate).+ const liveTitle = useDocumentStore((s) => s.liveTitle);+ const displayName = liveTitle ?? routeData?.procedure?.name ?? "";const newVersionDisclosure = useDisclosure();const deleteDisclosure = useDisclosure();@@ -62,7 +66,7 @@ const ProcedureHeader = () => {variant="ghost"/><Heading size="h4" className="flex items-center gap-2">- <span>{routeData?.procedure?.name}</span>+ <span>{displayName}</span><Badge variant="outline">V{routeData?.procedure?.version}</Badge><ProcedureStatus status={routeData?.procedure?.status} /></Heading>diff --git a/apps/erp/app/modules/production/ui/Procedures/ProcedureProperties.tsx b/apps/erp/app/modules/production/ui/Procedures/ProcedureProperties.tsxindex 4634f4c796..66d503faa8 100644--- a/apps/erp/app/modules/production/ui/Procedures/ProcedureProperties.tsx+++ b/apps/erp/app/modules/production/ui/Procedures/ProcedureProperties.tsx@@ -2,6 +2,7 @@ import { Select, ValidatedForm } from "@carbon/form";import {Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -79,9 +80,9 @@ const ProcedureProperties = () => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/production/ui/Schedule/TimelineDetail.tsx b/apps/erp/app/modules/production/ui/Schedule/TimelineDetail.tsxindex dc9b136559..ed90f4f2ee 100644--- a/apps/erp/app/modules/production/ui/Schedule/TimelineDetail.tsx+++ b/apps/erp/app/modules/production/ui/Schedule/TimelineDetail.tsx@@ -1,4 +1,4 @@-import { Button, cn, Heading, IconButton } from "@carbon/react";+import { Button, cn, Heading, IconButton, Subheading } from "@carbon/react";import {formatDateTimeInZone,formatDurationMilliseconds,@@ -216,9 +216,7 @@ export function TimelineDetail({{/* Header */}<div className="flex items-start justify-between gap-3 border-b border-border p-4"><div className="flex min-w-0 flex-col gap-1.5">- <span className="font-mono text-[0.6875rem] font-medium uppercase tracking-wide text-muted-foreground">- {kindLabel[detail.kind]}- </span>+ <Subheading variant="heavy">{kindLabel[detail.kind]}</Subheading><Heading size="h3" className="truncate">{detail.title}</Heading>@@ -291,10 +289,10 @@ export function TimelineDetail({key={stat.label}className="flex flex-1 flex-col gap-1 px-3 py-2.5">- <span className="flex items-center gap-1 font-mono text-[0.625rem] font-medium uppercase tracking-wide text-muted-foreground">+ <Subheading variant="heavy" className="flex items-center gap-1">{stat.icon}{stat.label}- </span>+ </Subheading><span className="text-lg font-semibold tabular-nums leading-none text-foreground">{stat.value}</span>diff --git a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderExplorer.tsx b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderExplorer.tsxindex c1ede69673..9a75965325 100644--- a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderExplorer.tsx+++ b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderExplorer.tsx@@ -124,7 +124,7 @@ export default function PurchaseOrderExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderProperties.tsx b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderProperties.tsxindex 6f57ed0bfd..4f981ab65d 100644--- a/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderProperties.tsx+++ b/apps/erp/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderProperties.tsx@@ -6,6 +6,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -133,9 +134,9 @@ const PurchaseOrderProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQExplorer.tsx b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQExplorer.tsxindex f9ed2694c9..172d7e0907 100644--- a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQExplorer.tsx+++ b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQExplorer.tsx@@ -101,7 +101,7 @@ export default function PurchasingRFQExplorer() {return (<div data-purchasing-rfq-explorer>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQProperties.tsx b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQProperties.tsxindex b1555d89ca..1d200fd717 100644--- a/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQProperties.tsx+++ b/apps/erp/app/modules/purchasing/ui/PurchasingRfq/PurchasingRFQProperties.tsx@@ -7,6 +7,7 @@ import {AvatarOverflowIndicator,Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -170,9 +171,9 @@ const PurchasingRFQProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteExplorer.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteExplorer.tsxindex 93cffec157..f6ce6f02ed 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteExplorer.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteExplorer.tsx@@ -105,7 +105,7 @@ export default function SupplierQuoteExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteProperties.tsx b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteProperties.tsxindex d86b073178..93435283ba 100644--- a/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteProperties.tsx+++ b/apps/erp/app/modules/purchasing/ui/SupplierQuote/SupplierQuoteProperties.tsx@@ -4,6 +4,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -111,9 +112,9 @@ const SupplierQuoteProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentEditor.tsx b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentEditor.tsxindex 259403d135..7f80835ae5 100644--- a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentEditor.tsx+++ b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentEditor.tsx@@ -1,15 +1,16 @@import { useCarbon } from "@carbon/auth";import type { JSONContent } from "@carbon/react";-import { generateHTML, Input, toast, useDebounce } from "@carbon/react";+import { generateHTML, toast, useDebounce } from "@carbon/react";import { Editor } from "@carbon/react/Editor";import { getLocalTimeZone, today } from "@internationalized/date";import { useLingui } from "@lingui/react/macro";import { nanoid } from "nanoid";-import { useState } from "react";+import { useEffect, useState } from "react";import { useFetcher, useLoaderData, useParams } from "react-router";import { usePermissions, useUser } from "~/hooks";import type { loader } from "~/routes/x+/quality-document+/$id";import type { action } from "~/routes/x+/quality-document+/update";+import { useDocumentStore } from "~/stores";import { getPrivateUrl, path } from "~/utils/path";export default function QualityDocumentEditor() {@@ -49,21 +50,26 @@ export default function QualityDocumentEditor() {);const nameFetcher = useFetcher<typeof action>();+ const setLiveTitle = useDocumentStore((s) => s.setLiveTitle);- const updateName = async (name: string) => {- const versions = await Promise.resolve(loaderData?.versions);- const formData = new FormData();- formData.append("ids", id);- if (Array.isArray(versions?.data) && versions.data.length > 0) {- for (const v of versions.data) formData.append("ids", v.id);- }- formData.append("field", "name");- formData.append("value", name);- nameFetcher.submit(formData, {- method: "post",- action: path.to.bulkUpdateQualityDocument- });- };+ const updateName = useDebounce(+ async (name: string) => {+ const versions = await Promise.resolve(loaderData?.versions);+ const formData = new FormData();+ formData.append("ids", id);+ if (Array.isArray(versions?.data) && versions.data.length > 0) {+ for (const v of versions.data) formData.append("ids", v.id);+ }+ formData.append("field", "name");+ formData.append("value", name);+ nameFetcher.submit(formData, {+ method: "post",+ action: path.to.bulkUpdateQualityDocument+ });+ },+ 500,+ true+ );const onUploadImage = async (file: File) => {const ext = file.name.split(".").pop();@@ -83,17 +89,28 @@ export default function QualityDocumentEditor() {const isDraft = loaderData?.document?.status === "Draft";const canEdit = permissions.can("update", "quality") && isDraft;+ // Mirror the live title only while editing; clear it when editing ends (e.g.+ // a Draft→Active transition that doesn't remount the route) or on unmount, so+ // the header title bar can never show a stale edited title.+ useEffect(() => {+ if (!canEdit) setLiveTitle(null);+ return () => setLiveTitle(null);+ }, [canEdit, setLiveTitle]);+return (- <div className="flex flex-col gap-6 w-full h-full p-6">- <Input- className="md:text-3xl text-2xl font-semibold leading-none tracking-tight text-foreground"- value={documentName}- borderless- onChange={canEdit ? (e) => setDocumentName(e.target.value) : undefined}- onBlur={canEdit ? (e) => updateName(e.target.value) : undefined}- />+ <div className="flex flex-col w-full h-full">{canEdit ? (<Editor+ toolbar+ title={{+ value: documentName,+ placeholder: t`Untitled`,+ onChange: (name) => {+ setDocumentName(name);+ setLiveTitle(name);+ updateName(name);+ }+ }}initialValue={content}onUpload={onUploadImage}onChange={(value) => {@@ -102,10 +119,15 @@ export default function QualityDocumentEditor() {}}/>) : (- <div- className="prose dark:prose-invert"- dangerouslySetInnerHTML={{ __html: generateHTML(content) }}- />+ <div className="flex flex-col gap-6 w-full h-full p-8">+ <h1 className="md:text-3xl text-2xl font-semibold leading-tight tracking-tight text-foreground">+ {documentName}+ </h1>+ <div+ className="prose dark:prose-invert"+ dangerouslySetInnerHTML={{ __html: generateHTML(content) }}+ />+ </div>)}</div>);diff --git a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentExplorer.tsx b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentExplorer.tsxindex 8c781db4cd..2f9f602ca0 100644--- a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentExplorer.tsx+++ b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentExplorer.tsx@@ -192,7 +192,7 @@ export default function QualityDocumentExplorer() {);return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="w-full flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentHeader.tsx b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentHeader.tsxindex 178433e652..6dd9328d02 100644--- a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentHeader.tsx+++ b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentHeader.tsx@@ -34,6 +34,7 @@ import { usePanels } from "~/components/Layout";import ConfirmDelete from "~/components/Modals/ConfirmDelete";import { usePermissions, useRouteData } from "~/hooks";import type { ApprovalDecision } from "~/modules/shared/types";+import { useDocumentStore } from "~/stores";import { path } from "~/utils/path";import type { QualityDocument } from "../../types";import QualityDocumentApprovalModal from "./QualityDocumentApprovalModal";@@ -57,6 +58,10 @@ const QualityDocumentHeader = () => {const { t } = useLingui();const permissions = usePermissions();const { toggleExplorer, toggleProperties } = usePanels();+ // Live title from the editor's locked title block, so the header updates as+ // the user types (before the loader revalidates).+ const liveTitle = useDocumentStore((s) => s.liveTitle);+ const displayName = liveTitle ?? routeData?.document?.name ?? "";const newVersionDisclosure = useDisclosure();const deleteDisclosure = useDisclosure();const statusFetcher = useFetcher<{ error?: { message: string } }>();@@ -123,7 +128,7 @@ const QualityDocumentHeader = () => {variant="ghost"/><Heading size="h4" className="flex items-center gap-2">- <span>{routeData?.document?.name}</span>+ <span>{displayName}</span><Badge variant="outline">V{routeData?.document?.version}</Badge><QualityDocumentStatus status={routeData?.document?.status} /></Heading>diff --git a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentProperties.tsx b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentProperties.tsxindex 3e2bb7da1d..e59a733042 100644--- a/apps/erp/app/modules/quality/ui/Documents/QualityDocumentProperties.tsx+++ b/apps/erp/app/modules/quality/ui/Documents/QualityDocumentProperties.tsx@@ -2,6 +2,7 @@ import { Select, ValidatedForm } from "@carbon/form";import {Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -104,13 +105,13 @@ const QualityDocumentProperties = () => {return (<VStackspacing={4}- className="w-[450px] bg-background/30 h-full overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent border-l border-border px-4 py-2 text-sm"+ className="w-[450px] bg-card h-full overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent border-l border-border px-4 py-2 text-sm"><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsxindex a818a324a8..cb0c0aaf8e 100644--- a/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx+++ b/apps/erp/app/modules/quality/ui/Issue/IssueProperties.tsx@@ -9,6 +9,7 @@ import {import {Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -160,9 +161,9 @@ const IssueProperties = () => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchProperties.tsx b/apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchProperties.tsxindex 8eb90295b2..c8e30faf28 100644--- a/apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchProperties.tsx+++ b/apps/erp/app/modules/resources/ui/Maintenance/MaintenanceDispatchProperties.tsx@@ -8,6 +8,7 @@ import {ModalFooter,ModalHeader,ModalTitle,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -125,9 +126,9 @@ const MaintenanceDispatchProperties = () => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/resources/ui/Training/TrainingExplorer.tsx b/apps/erp/app/modules/resources/ui/Training/TrainingExplorer.tsxindex c44ba48e68..f900f58e4d 100644--- a/apps/erp/app/modules/resources/ui/Training/TrainingExplorer.tsx+++ b/apps/erp/app/modules/resources/ui/Training/TrainingExplorer.tsx@@ -191,7 +191,7 @@ export default function TrainingExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="w-full flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/resources/ui/Training/TrainingProperties.tsx b/apps/erp/app/modules/resources/ui/Training/TrainingProperties.tsxindex d594c1357c..3de6442875 100644--- a/apps/erp/app/modules/resources/ui/Training/TrainingProperties.tsx+++ b/apps/erp/app/modules/resources/ui/Training/TrainingProperties.tsx@@ -3,6 +3,7 @@ import {Badge,Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -97,9 +98,9 @@ const TrainingProperties = () => {><VStack spacing={2}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx b/apps/erp/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsxindex c960eb0836..a47a08cf01 100644--- a/apps/erp/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx+++ b/apps/erp/app/modules/resources/ui/WorkCenters/WorkCenterForm.tsx@@ -25,6 +25,7 @@ import {SelectItem,SelectTrigger,SelectValue,+ Subheading,toast,VStack} from "@carbon/react";@@ -133,9 +134,9 @@ const WorkCenterForm = ({<Hidden name="id" /><Hidden name="type" value={type} /><VStack spacing={4}>- <p className="text-xs font-mono uppercase font-light text-muted-foreground">+ <Subheading variant="heavy" className="block"><Trans>Basic Information</Trans>- </p>+ </Subheading><Input name="name" label={t`Name`} />{showProcesses && (<Processes@@ -162,9 +163,9 @@ const WorkCenterForm = ({/><TextArea name="description" label={t`Description`} />- <p className="text-xs font-mono uppercase font-light text-muted-foreground pt-2">+ <Subheading variant="heavy" className="block pt-2"><Trans>Costing</Trans>- </p>+ </Subheading><div className="grid grid-cols-1 sm:grid-cols-3 gap-4 w-full"><Numbername="laborRate"@@ -195,9 +196,9 @@ const WorkCenterForm = ({/></div>- <p className="text-xs font-mono uppercase font-light text-muted-foreground pt-2">+ <Subheading variant="heavy" className="block pt-2"><Trans>Scheduling</Trans>- </p>+ </Subheading><FormControl><FormLabel htmlFor="scheduleMode">{t`Operating hours`}diff --git a/apps/erp/app/modules/sales/ui/CustomerPortal/JobOperationProgress.tsx b/apps/erp/app/modules/sales/ui/CustomerPortal/JobOperationProgress.tsxindex c7e96b1928..be0a93011a 100644--- a/apps/erp/app/modules/sales/ui/CustomerPortal/JobOperationProgress.tsx+++ b/apps/erp/app/modules/sales/ui/CustomerPortal/JobOperationProgress.tsx@@ -2,6 +2,7 @@ import {Badge,cn,Separator,+ Subheading,Tooltip,TooltipContent,TooltipTrigger@@ -86,9 +87,9 @@ export function JobOperationProgress({</div></TooltipTrigger><TooltipContent align="start" className="w-96 p-2">- <div className="text-[11px] font-medium text-muted-foreground px-2 py-1 uppercase tracking-wide">+ <Subheading variant="heavy" className="block px-2 py-1">Operations- </div>+ </Subheading><Separator className="mb-1" /><div className="flex flex-col gap-0.5 max-h-80 overflow-y-auto">{sorted.map((op) => {diff --git a/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx b/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsxindex 42e16ed722..57086f2bf6 100644--- a/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx+++ b/apps/erp/app/modules/sales/ui/Pricing/ScopePicker.tsx@@ -9,7 +9,8 @@ import {cn,Popover,PopoverContent,- PopoverTrigger+ PopoverTrigger,+ Subheading} from "@carbon/react";import { useLingui } from "@lingui/react/macro";import type { ComponentType } from "react";@@ -157,10 +158,10 @@ function GroupHeading({label: string;}) {return (- <span className="flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground">+ <Subheading variant="heavy" className="flex items-center gap-1.5"><Icon className="size-3" />{label}- </span>+ </Subheading>);}diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsxindex 86be7b30ae..b5971636be 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteExplorer.tsx@@ -172,7 +172,7 @@ export default function QuoteExplorer({ methods }: QuoteExplorerProps) {isOverExplorer && "bg-primary/10 border-2 border-dashed border-primary")}>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/sales/ui/Quotes/QuoteProperties.tsx b/apps/erp/app/modules/sales/ui/Quotes/QuoteProperties.tsxindex 8a0f138f75..06a7b20d4a 100644--- a/apps/erp/app/modules/sales/ui/Quotes/QuoteProperties.tsx+++ b/apps/erp/app/modules/sales/ui/Quotes/QuoteProperties.tsx@@ -5,6 +5,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -118,9 +119,9 @@ const QuoteProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderExplorer.tsx b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderExplorer.tsxindex ec31dec085..67c740aa06 100644--- a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderExplorer.tsx+++ b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderExplorer.tsx@@ -195,7 +195,7 @@ export default function SalesOrderExplorer() {return (<>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderProperties.tsx b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderProperties.tsxindex 1c22b942a4..3defb03269 100644--- a/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderProperties.tsx+++ b/apps/erp/app/modules/sales/ui/SalesOrder/SalesOrderProperties.tsx@@ -4,6 +4,7 @@ import {Button,HStack,IconButton,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -120,9 +121,9 @@ const SalesOrderProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQExplorer.tsx b/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQExplorer.tsxindex 36bbe90570..acd7fe5aeb 100644--- a/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQExplorer.tsx+++ b/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQExplorer.tsx@@ -142,7 +142,7 @@ export default function SalesRFQExplorer() {isOverExplorer && "bg-primary/10 border-2 border-dashed border-primary")}>- <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height))] justify-between">+ <VStack className="w-full h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] justify-between"><VStackclassName="flex-1 overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent"spacing={0}diff --git a/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQProperties.tsx b/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQProperties.tsxindex bd70151d3d..fdac2ba016 100644--- a/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQProperties.tsx+++ b/apps/erp/app/modules/sales/ui/SalesRFQ/SalesRFQProperties.tsx@@ -3,6 +3,7 @@ import { DatePicker, InputControlled, ValidatedForm } from "@carbon/form";import {Button,HStack,+ Subheading,Tooltip,TooltipContent,TooltipTrigger,@@ -106,9 +107,9 @@ const SalesRFQProperties = () => {><VStack spacing={4}><HStack className="w-full justify-between">- <h3 className="text-xxs text-foreground/70 uppercase font-light tracking-wide">+ <Subheading as="h3" variant="light"><Trans>Properties</Trans>- </h3>+ </Subheading><HStack spacing={1}><Tooltip><TooltipTrigger asChild>diff --git a/apps/erp/app/modules/settings/ui/Integrations/AccountMapping.tsx b/apps/erp/app/modules/settings/ui/Integrations/AccountMapping.tsxindex 8cdbc437c6..77170ba82a 100644--- a/apps/erp/app/modules/settings/ui/Integrations/AccountMapping.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/AccountMapping.tsx@@ -20,6 +20,7 @@ import {ModalHeader,ModalTitle,Spinner,+ Subheading,Table,Tbody,Td,@@ -346,9 +347,7 @@ export function AccountMapping({) : (grouped.map((group) => (<div key={group.class} className="flex w-full flex-col gap-1">- <span className="text-[0.625rem] font-semibold uppercase tracking-wider text-muted-foreground">- {group.class}- </span>+ <Subheading variant="heavy">{group.class}</Subheading><div className="w-full rounded-lg border border-border"><div className="flex w-full flex-col divide-y divide-border">{group.accounts.map((account) => {diff --git a/apps/erp/app/modules/settings/ui/Integrations/DimensionMapping.tsx b/apps/erp/app/modules/settings/ui/Integrations/DimensionMapping.tsxindex 5a9611bdbc..4ababd7eb6 100644--- a/apps/erp/app/modules/settings/ui/Integrations/DimensionMapping.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/DimensionMapping.tsx@@ -12,6 +12,7 @@ import {DrawerTitle,HStack,IconButton,+ Subheading,Switch,Table,Tbody,@@ -250,9 +251,9 @@ export function DimensionMapping({<section className="flex w-full flex-col gap-2"><div className="flex flex-col gap-0.5"><div className="flex items-center gap-2">- <span className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light"><Trans>Dimension slots</Trans>- </span>+ </Subheading><span className="text-[0.6875rem] tabular-nums text-muted-foreground">{rows.length}</span>@@ -559,9 +560,7 @@ function MappingSection({<section className="flex w-full flex-col gap-2"><div className="flex flex-col gap-0.5"><div className="flex items-center gap-2">- <span className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">- {title}- </span>+ <Subheading variant="light">{title}</Subheading><span className="text-[0.6875rem] tabular-nums text-muted-foreground">{count}</span>diff --git a/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx b/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsxindex 77f3301421..a238e067eb 100644--- a/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/IntegrationForm.tsx@@ -28,6 +28,7 @@ import {Heading,HStack,ScrollArea,+ Subheading,Switch,Tabs,TabsContent,@@ -521,9 +522,9 @@ function SettingsGroup({return (<div className="w-full border-t border-border pt-4"><div className="flex flex-col gap-1 pb-3">- <div className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light" className="block">{name}- </div>+ </Subheading>{description && (<p className="text-xs text-muted-foreground">{description}</p>)}@@ -770,9 +771,9 @@ export function IntegrationForm({{/* @ts-expect-error TS2339 */}{integration.setupInstructions && (<div className="flex flex-col gap-2">- <div className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light" className="block"><Trans>Setup instructions</Trans>- </div>+ </Subheading>{/* @ts-expect-error TS2339 */}<integration.setupInstructionscompanyId={companyId}@@ -806,9 +807,9 @@ export function IntegrationForm({// when every gated action is hidden, so the toggle live-controls// visibility without leaving an empty "Actions" header.<div className="hidden has-[button]:flex w-full flex-col gap-3 border-t border-border pt-4">- <div className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light" className="block"><Trans>Actions</Trans>- </div>+ </Subheading><VStack spacing={2} className="w-full">{integrationActions.map((action) =>action.enabledWhenSetting ? (diff --git a/apps/erp/app/modules/settings/ui/Integrations/PostingSyncSettings.tsx b/apps/erp/app/modules/settings/ui/Integrations/PostingSyncSettings.tsxindex 93c5b6b04c..95f4a11ef6 100644--- a/apps/erp/app/modules/settings/ui/Integrations/PostingSyncSettings.tsx+++ b/apps/erp/app/modules/settings/ui/Integrations/PostingSyncSettings.tsx@@ -11,7 +11,8 @@ import {Checkbox,DrawerBody,DrawerFooter,- HStack+ HStack,+ Subheading} from "@carbon/react";import { Trans, useLingui } from "@lingui/react/macro";import type { ReactNode } from "react";@@ -221,9 +222,9 @@ export function PostingSyncSettings({<section className="flex w-full flex-col gap-2"><div className="flex flex-col gap-0.5">- <span className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light"><Trans>Source types</Trans>- </span>+ </Subheading><p className="text-xs text-muted-foreground"><Trans>Posted journals with these source types always sync. Daily@@ -267,9 +268,9 @@ export function PostingSyncSettings({<section className="flex w-full flex-col gap-2 border-t border-border pt-4"><div className="flex flex-col gap-0.5">- <span className="text-[0.6875rem] font-semibold uppercase tracking-wider text-foreground/70">+ <Subheading variant="light"><Trans>AR / AP representation</Trans>- </span>+ </Subheading><p className="text-xs text-muted-foreground"><Trans>Documents pushes invoices, bills and payments as native providerdiff --git a/apps/erp/app/modules/storage-rules/ui/FieldCombobox.tsx b/apps/erp/app/modules/storage-rules/ui/FieldCombobox.tsxindex 6c7880a85e..a8293531d8 100644--- a/apps/erp/app/modules/storage-rules/ui/FieldCombobox.tsx+++ b/apps/erp/app/modules/storage-rules/ui/FieldCombobox.tsx@@ -11,6 +11,7 @@ import {Popover,PopoverContent,PopoverTrigger,+ Subheading,Tooltip,TooltipContent,TooltipProvider,@@ -189,10 +190,13 @@ export default function FieldCombobox({{gi > 0 && <CommandSeparator />}<CommandGroupheading={- <span className="flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground">+ <Subheading+ variant="heavy"+ className="flex items-center gap-1.5"+ >{meta.icon}{meta.label}- </span>+ </Subheading>}>{fields.map((f) => {diff --git a/apps/erp/app/modules/storage-rules/ui/RuleBuilder.tsx b/apps/erp/app/modules/storage-rules/ui/RuleBuilder.tsxindex 2cc72a55ad..dabd33f2af 100644--- a/apps/erp/app/modules/storage-rules/ui/RuleBuilder.tsx+++ b/apps/erp/app/modules/storage-rules/ui/RuleBuilder.tsx@@ -3,6 +3,7 @@ import {ChoiceSelect,type ChoiceSelectOption,Heading,+ Subheading,VStack} from "@carbon/react";import {@@ -138,15 +139,9 @@ export default function RuleBuilder({<div className="flex flex-col gap-2 w-full"><div className="hidden sm:flex w-full items-center gap-2" aria-hidden><div className={`${CONDITION_GRID_CLASS} flex-1 min-w-0 px-3`}>- <span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">- {t`Field`}- </span>- <span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">- {t`Operator`}- </span>- <span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">- {t`Value`}- </span>+ <Subheading variant="heavy">{t`Field`}</Subheading>+ <Subheading variant="heavy">{t`Operator`}</Subheading>+ <Subheading variant="heavy">{t`Value`}</Subheading></div><div className="w-8 shrink-0" /></div>diff --git a/apps/erp/app/modules/storage-rules/ui/StorageRulesGroups.tsx b/apps/erp/app/modules/storage-rules/ui/StorageRulesGroups.tsxindex 706ad3d16a..a387864a0a 100644--- a/apps/erp/app/modules/storage-rules/ui/StorageRulesGroups.tsx+++ b/apps/erp/app/modules/storage-rules/ui/StorageRulesGroups.tsx@@ -20,6 +20,7 @@ import {IconButton,ScrollArea,Status,+ Subheading,useDisclosure,VStack} from "@carbon/react";@@ -156,7 +157,7 @@ const StorageRulesGroups = memo(({ rules }: StorageRulesGroupsProps) => {);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))] bg-card">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] bg-card"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"@@ -280,17 +281,13 @@ const StorageRuleCard = memo(({ rule }: { rule: RuleListItem }) => {)}{rule.message && (<div className="flex flex-col gap-1">- <span className="text-xs uppercase tracking-wide font-medium text-muted-foreground">- Message- </span>+ <Subheading variant="heavy">Message</Subheading><p className="text-sm">{rule.message}</p></div>)}<div className="flex items-center gap-4 text-sm"><div className="flex flex-col gap-1">- <span className="text-xs uppercase tracking-wide font-medium text-muted-foreground">- Triggers- </span>+ <Subheading variant="heavy">Triggers</Subheading><SurfaceChipssurfaces={rule.surfaces}targetType={rule.targetType}@@ -298,9 +295,7 @@ const StorageRuleCard = memo(({ rule }: { rule: RuleListItem }) => {</div>{showAssignments && (<div className="flex flex-col gap-1">- <span className="text-xs uppercase tracking-wide font-medium text-muted-foreground">- Assignments- </span>+ <Subheading variant="heavy">Assignments</Subheading><span className="tabular-nums text-sm">{rule.assignmentCount ?? 0}</span>diff --git a/apps/erp/app/modules/workflows/ui/Runs/ConditionDetail.tsx b/apps/erp/app/modules/workflows/ui/Runs/ConditionDetail.tsxindex f255f40b41..e23c55481b 100644--- a/apps/erp/app/modules/workflows/ui/Runs/ConditionDetail.tsx+++ b/apps/erp/app/modules/workflows/ui/Runs/ConditionDetail.tsx@@ -1,3 +1,4 @@+import { Subheading } from "@carbon/react";import { OPERATOR_LABELS } from "@carbon/utils";import type {Clause,@@ -42,9 +43,9 @@ function ClauseLine({return (<div className="space-y-1">{showCombinator && (- <div className="text-xs text-muted-foreground uppercase font-medium py-0.5">+ <Subheading variant="heavy" className="block py-0.5">{combinator}- </div>+ </Subheading>)}<div className="flex items-start gap-2 flex-wrap text-sm">{label && <span className="font-medium">{label}</span>}diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.jsonindex 15631d78f0..3f69603932 100644--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json@@ -1,5 +1,5 @@{- "generated": "2026-09-03T04:29:35.054Z",+ "generated": "2026-09-03T15:31:57.926Z","totalTools": 1495,"modules": 15,"tools": [diff --git a/apps/erp/app/routes/x+/account+/_layout.tsx b/apps/erp/app/routes/x+/account+/_layout.tsxindex 0eb0d852fa..6581d9e649 100644--- a/apps/erp/app/routes/x+/account+/_layout.tsx+++ b/apps/erp/app/routes/x+/account+/_layout.tsx@@ -27,7 +27,7 @@ export default function AccountRoute() {<GroupedContentSidebar groups={groups} /><VStackspacing={0}- className="overflow-y-auto scrollbar-hide h-[calc(100dvh-var(--topbar-height))]"+ className="overflow-y-auto scrollbar-hide h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}diff --git a/apps/erp/app/routes/x+/accounting+/defaults.tsx b/apps/erp/app/routes/x+/accounting+/defaults.tsxindex c1182bd8b4..959eaba118 100644--- a/apps/erp/app/routes/x+/accounting+/defaults.tsx+++ b/apps/erp/app/routes/x+/accounting+/defaults.tsx@@ -119,7 +119,7 @@ export default function AccountDefaultsRoute() {}>(path.to.accounting);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/accounting+/reports.tsx b/apps/erp/app/routes/x+/accounting+/reports.tsxindex 7ece4dec1f..5417c0412f 100644--- a/apps/erp/app/routes/x+/accounting+/reports.tsx+++ b/apps/erp/app/routes/x+/accounting+/reports.tsx@@ -8,7 +8,8 @@ import {IconButton,Input,InputGroup,- InputLeftElement+ InputLeftElement,+ Subheading} from "@carbon/react";import { msg } from "@lingui/core/macro";import { Trans, useLingui } from "@lingui/react/macro";@@ -562,7 +563,5 @@ const PinToggle = ({);const SectionHeading = ({ children }: { children: ReactNode }) => (- <div className="mb-3 flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-muted-foreground">- {children}- </div>+ <Subheading className="mb-3 flex items-center gap-1.5">{children}</Subheading>);diff --git a/apps/erp/app/routes/x+/accounting+/years.tsx b/apps/erp/app/routes/x+/accounting+/years.tsxindex 0f59bf64bb..235eb88f91 100644--- a/apps/erp/app/routes/x+/accounting+/years.tsx+++ b/apps/erp/app/routes/x+/accounting+/years.tsx@@ -112,7 +112,7 @@ export default function FiscalYearSettingsRoute() {};return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/assembly+/$id.tsx b/apps/erp/app/routes/x+/assembly+/$id.tsxindex 20f6a22dc8..87dffcdbf3 100644--- a/apps/erp/app/routes/x+/assembly+/$id.tsx+++ b/apps/erp/app/routes/x+/assembly+/$id.tsx@@ -520,9 +520,9 @@ export default function AssemblyInstructionRoute() {return (<PanelProvider key={id}>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><AssemblyInstructionHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex grow overflow-hidden"><ResizablePanelsexplorer={@@ -547,7 +547,7 @@ export default function AssemblyInstructionRoute() {/>}content={- <div className="relative bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] w-full">+ <div className="relative bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] w-full">{glbPath && graphPath && isPlanning && (<div className="absolute left-1/2 top-3 z-10 flex -translate-x-1/2 items-center gap-2 rounded-full border border-border bg-card px-3 py-1.5 shadow-lg"><Spinner className="h-3.5 w-3.5" />diff --git a/apps/erp/app/routes/x+/consumable+/$itemId.tsx b/apps/erp/app/routes/x+/consumable+/$itemId.tsxindex ad455963f6..f99d326e45 100644--- a/apps/erp/app/routes/x+/consumable+/$itemId.tsx+++ b/apps/erp/app/routes/x+/consumable+/$itemId.tsx@@ -102,9 +102,9 @@ export default function ConsumableRoute() {const { usedIn } = useLoaderData<typeof loader>();return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ConsumableHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -235,7 +235,7 @@ export default function ConsumableRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/depreciation-run+/$depreciationRunId.tsx b/apps/erp/app/routes/x+/depreciation-run+/$depreciationRunId.tsxindex aa769cf8df..959519bc3a 100644--- a/apps/erp/app/routes/x+/depreciation-run+/$depreciationRunId.tsx+++ b/apps/erp/app/routes/x+/depreciation-run+/$depreciationRunId.tsx@@ -107,7 +107,7 @@ export default function DepreciationRunDetailRoute() {: "grid-cols-[auto_1fr_1fr_120px_120px_120px_120px]";return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 pb-16 w-full max-w-5xl mx-auto"><Card><CardHeader className="flex-row items-center justify-between">diff --git a/apps/erp/app/routes/x+/fixed-asset+/$fixedAssetId.tsx b/apps/erp/app/routes/x+/fixed-asset+/$fixedAssetId.tsxindex a65662bc5b..96334ab8f7 100644--- a/apps/erp/app/routes/x+/fixed-asset+/$fixedAssetId.tsx+++ b/apps/erp/app/routes/x+/fixed-asset+/$fixedAssetId.tsx@@ -134,7 +134,7 @@ export default function FixedAssetDetailRoute() {const canUpdate = permissions.can("update", "accounting");return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 pb-16 w-full max-w-5xl mx-auto space-y-4">{/* Main Details */}<Card>diff --git a/apps/erp/app/routes/x+/inspection-document+/$id.tsx b/apps/erp/app/routes/x+/inspection-document+/$id.tsxindex f70e5919fc..4a4689cf44 100644--- a/apps/erp/app/routes/x+/inspection-document+/$id.tsx+++ b/apps/erp/app/routes/x+/inspection-document+/$id.tsx@@ -102,7 +102,7 @@ export default function BalloonDetailRoute() {const content = diagram.content as InspectionDocumentContent | null;return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ClientOnlyfallback={<div className="flex h-full w-full items-center justify-center">diff --git a/apps/erp/app/routes/x+/inventory+/quantities+/$itemId.tsx b/apps/erp/app/routes/x+/inventory+/quantities+/$itemId.tsxindex 5b5dd2c657..bf165fe9e8 100644--- a/apps/erp/app/routes/x+/inventory+/quantities+/$itemId.tsx+++ b/apps/erp/app/routes/x+/inventory+/quantities+/$itemId.tsx@@ -89,7 +89,7 @@ export default function ItemInventoryRoute() {minSize={25}className="bg-muted">- <ScrollArea className="h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><InventoryItemHeaderitemReadableId={item.readableIdWithRevision ?? item.readableId}// @ts-ignorediff --git a/apps/erp/app/routes/x+/inventory-count+/$id.tsx b/apps/erp/app/routes/x+/inventory-count+/$id.tsxindex 11eaf2b994..c6a43e0293 100644--- a/apps/erp/app/routes/x+/inventory-count+/$id.tsx+++ b/apps/erp/app/routes/x+/inventory-count+/$id.tsx@@ -141,7 +141,7 @@ export default function InventoryCountDetailRoute() {return (<>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] w-full overflow-hidden">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] w-full overflow-hidden"><InventoryCountDetailsinventoryCount={inventoryCount}lines={lines}diff --git a/apps/erp/app/routes/x+/issue+/$id.tsx b/apps/erp/app/routes/x+/issue+/$id.tsxindex 8dc45afa7b..008cf2d816 100644--- a/apps/erp/app/routes/x+/issue+/$id.tsx+++ b/apps/erp/app/routes/x+/issue+/$id.tsx@@ -97,9 +97,9 @@ export default function IssueRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><IssueHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -211,7 +211,7 @@ export default function IssueRoute() {</Suspense>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/issue-workflow+/$id.tsx b/apps/erp/app/routes/x+/issue-workflow+/$id.tsxindex bbdb799cf8..1868eb2664 100644--- a/apps/erp/app/routes/x+/issue-workflow+/$id.tsx+++ b/apps/erp/app/routes/x+/issue-workflow+/$id.tsx@@ -124,7 +124,7 @@ export default function IssueWorkflowRoute() {};return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))] bg-card">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] bg-card"><IssueWorkflowForminitialValues={initialValues}requiredActions={requiredActions}diff --git a/apps/erp/app/routes/x+/issue-workflow+/new.tsx b/apps/erp/app/routes/x+/issue-workflow+/new.tsxindex f10fbd8d1f..16c530afb8 100644--- a/apps/erp/app/routes/x+/issue-workflow+/new.tsx+++ b/apps/erp/app/routes/x+/issue-workflow+/new.tsx@@ -75,7 +75,7 @@ export default function NewIssueWorkflowRoute() {};return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))] bg-card">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] bg-card"><IssueWorkflowForminitialValues={initialValues}requiredActions={requiredActions}diff --git a/apps/erp/app/routes/x+/items+/change-notice+/$id.tsx b/apps/erp/app/routes/x+/items+/change-notice+/$id.tsxindex 5260e5f98e..82a476823f 100644--- a/apps/erp/app/routes/x+/items+/change-notice+/$id.tsx+++ b/apps/erp/app/routes/x+/items+/change-notice+/$id.tsx@@ -299,14 +299,14 @@ export default function ChangeNoticeIdRoute() {// top), and the properties panel holds the CO-centric fields, details,// actions, impact, and the release dialog.<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ChangeNoticeHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<ChangeNoticeExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/items+/methods+/materials.tsx b/apps/erp/app/routes/x+/items+/methods+/materials.tsxindex f11aa13310..f907c973f7 100644--- a/apps/erp/app/routes/x+/items+/methods+/materials.tsx+++ b/apps/erp/app/routes/x+/items+/methods+/materials.tsx@@ -56,7 +56,10 @@ export default function MethodMaterialsRoute() {const { count, materials } = useLoaderData<typeof loader>();return (- <VStack spacing={0} className="h-[calc(100dvh-var(--topbar-height))]">+ <VStack+ spacing={0}+ className="h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"+ ><MethodMaterialsTable data={materials} count={count} /></VStack>);diff --git a/apps/erp/app/routes/x+/items+/methods+/operations.tsx b/apps/erp/app/routes/x+/items+/methods+/operations.tsxindex 8b4b965d1f..6f82538857 100644--- a/apps/erp/app/routes/x+/items+/methods+/operations.tsx+++ b/apps/erp/app/routes/x+/items+/methods+/operations.tsx@@ -56,7 +56,10 @@ export default function MethodOperationsRoute() {const { count, operations } = useLoaderData<typeof loader>();return (- <VStack spacing={0} className="h-[calc(100dvh-var(--topbar-height))]">+ <VStack+ spacing={0}+ className="h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"+ ><MethodOperationsTable data={operations} count={count} /></VStack>);diff --git a/apps/erp/app/routes/x+/job+/$jobId.dag.tsx b/apps/erp/app/routes/x+/job+/$jobId.dag.tsxindex 561f8598b5..a599ede694 100644--- a/apps/erp/app/routes/x+/job+/$jobId.dag.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.dag.tsx@@ -62,7 +62,7 @@ export default function JobDagRoute() {return (<VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]"><JobDag operations={operations} dependencies={dependencies} /></VStack>diff --git a/apps/erp/app/routes/x+/job+/$jobId.events.tsx b/apps/erp/app/routes/x+/job+/$jobId.events.tsxindex a367a23fab..7b50d8c135 100644--- a/apps/erp/app/routes/x+/job+/$jobId.events.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.events.tsx@@ -88,7 +88,7 @@ export default function ProductionEventsRoute() {<><VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]"><ProductionEventsTabledata={events}diff --git a/apps/erp/app/routes/x+/job+/$jobId.materials.tsx b/apps/erp/app/routes/x+/job+/$jobId.materials.tsxindex 7a3ac738da..b9940408a2 100644--- a/apps/erp/app/routes/x+/job+/$jobId.materials.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.materials.tsx@@ -165,7 +165,7 @@ export default function JobMaterialsRoute() {return (<VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]"><JobMaterialsTabledata={materials}diff --git a/apps/erp/app/routes/x+/job+/$jobId.operations.tsx b/apps/erp/app/routes/x+/job+/$jobId.operations.tsxindex 6f84ca8d7c..a0ddb9bd6e 100644--- a/apps/erp/app/routes/x+/job+/$jobId.operations.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.operations.tsx@@ -70,7 +70,7 @@ export default function JobOperationsRoute() {return (<VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]"><JobOperationsTable data={operations} count={count} /></VStack>diff --git a/apps/erp/app/routes/x+/job+/$jobId.quantities.tsx b/apps/erp/app/routes/x+/job+/$jobId.quantities.tsxindex 0f6ab76e8b..f654a88a52 100644--- a/apps/erp/app/routes/x+/job+/$jobId.quantities.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.quantities.tsx@@ -88,7 +88,7 @@ export default function ProductionQuantitiesRoute() {<><VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]"><ProductionQuantitiesTabledata={events}diff --git a/apps/erp/app/routes/x+/job+/$jobId.steps.tsx b/apps/erp/app/routes/x+/job+/$jobId.steps.tsxindex 4691f926e8..9062a9c24e 100644--- a/apps/erp/app/routes/x+/job+/$jobId.steps.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.steps.tsx@@ -63,7 +63,7 @@ export default function JobOperationStepRecordsRoute() {return (<VStackspacing={0}- className="h-[calc(100dvh-var(--topbar-height)-var(--header-height))]"+ className="h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))]">{/* @ts-expect-error TS2322 */}<JobOperationStepRecordsTable data={stepRecords} count={count} />diff --git a/apps/erp/app/routes/x+/job+/$jobId.tsx b/apps/erp/app/routes/x+/job+/$jobId.tsxindex 0b942a4fcd..eda4c0d40d 100644--- a/apps/erp/app/routes/x+/job+/$jobId.tsx+++ b/apps/erp/app/routes/x+/job+/$jobId.tsx@@ -127,9 +127,9 @@ export default function JobRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><JobHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -154,7 +154,7 @@ export default function JobRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/journal-entry+/$journalEntryId.tsx b/apps/erp/app/routes/x+/journal-entry+/$journalEntryId.tsxindex e19b6977ef..1964dbb394 100644--- a/apps/erp/app/routes/x+/journal-entry+/$journalEntryId.tsx+++ b/apps/erp/app/routes/x+/journal-entry+/$journalEntryId.tsx@@ -128,7 +128,7 @@ export default function JournalEntryRoute() {if (!journalEntryId) throw new Error("Could not find journalEntryId");return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 w-full max-w-5xl mx-auto"><Outlet /></div>diff --git a/apps/erp/app/routes/x+/maintenance+/$dispatchId.tsx b/apps/erp/app/routes/x+/maintenance+/$dispatchId.tsxindex eeff340272..bd0a59ed6a 100644--- a/apps/erp/app/routes/x+/maintenance+/$dispatchId.tsx+++ b/apps/erp/app/routes/x+/maintenance+/$dispatchId.tsx@@ -90,16 +90,16 @@ export default function MaintenanceDispatchRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><MaintenanceDispatchHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<MaintenanceDispatchExplorer items={items} events={events} />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><MaintenanceDispatchNotesid={dispatchId}diff --git a/apps/erp/app/routes/x+/material+/$itemId.tsx b/apps/erp/app/routes/x+/material+/$itemId.tsxindex cebc70da74..d280c1c140 100644--- a/apps/erp/app/routes/x+/material+/$itemId.tsx+++ b/apps/erp/app/routes/x+/material+/$itemId.tsx@@ -104,9 +104,9 @@ export default function MaterialRoute() {const { usedIn } = useLoaderData<typeof loader>();return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><MaterialHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -236,7 +236,7 @@ export default function MaterialRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/part+/$itemId.tsx b/apps/erp/app/routes/x+/part+/$itemId.tsxindex c8e5032746..522f7081ec 100644--- a/apps/erp/app/routes/x+/part+/$itemId.tsx+++ b/apps/erp/app/routes/x+/part+/$itemId.tsx@@ -197,9 +197,9 @@ export default function PartRoute() {const [filterText, setFilterText] = useState("");return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><PartHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -606,7 +606,7 @@ export default function PartRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/picking-list+/$pickingListId.tsx b/apps/erp/app/routes/x+/picking-list+/$pickingListId.tsxindex ffed11e56c..4b0bbf486d 100644--- a/apps/erp/app/routes/x+/picking-list+/$pickingListId.tsx+++ b/apps/erp/app/routes/x+/picking-list+/$pickingListId.tsx@@ -74,9 +74,9 @@ export default function PickingListDetailRoute() {if (!pickingListId) throw new Error("Could not find pickingListId");return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><PickingListHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 w-full max-w-5xl mx-auto flex flex-col gap-4 pb-16"><Outlet /></div>diff --git a/apps/erp/app/routes/x+/procedure+/$id.tsx b/apps/erp/app/routes/x+/procedure+/$id.tsxindex f65220260a..a272724647 100644--- a/apps/erp/app/routes/x+/procedure+/$id.tsx+++ b/apps/erp/app/routes/x+/procedure+/$id.tsx@@ -2,12 +2,13 @@ import { error, useCarbon } from "@carbon/auth";import { requirePermissions } from "@carbon/auth/auth.server";import { flash } from "@carbon/auth/session.server";import type { JSONContent } from "@carbon/react";-import { generateHTML, Input, toast, useDebounce } from "@carbon/react";+import { generateHTML, toast, useDebounce } from "@carbon/react";import { Editor } from "@carbon/react/Editor";import { getLocalTimeZone, today } from "@internationalized/date";import { msg } from "@lingui/core/macro";+import { useLingui } from "@lingui/react/macro";import { nanoid } from "nanoid";-import { useState } from "react";+import { useEffect, useState } from "react";import type { LoaderFunctionArgs } from "react-router";import {Outlet,@@ -24,6 +25,7 @@ import ProcedureHeader from "~/modules/production/ui/Procedures/ProcedureHeader"import ProcedureProperties from "~/modules/production/ui/Procedures/ProcedureProperties";import { getTagsList } from "~/modules/shared";import type { action } from "~/routes/x+/procedure+/update";+import { useDocumentStore } from "~/stores";import { detailBreadcrumb, type Handle } from "~/utils/handle";import { getPrivateUrl, path } from "~/utils/path";@@ -72,9 +74,9 @@ export default function ProcedureRoute() {return (<PanelProvider key={`${id}-${procedure.version}`}>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ProcedureHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex grow overflow-hidden"><ResizablePanelsexplorer={@@ -83,7 +85,7 @@ export default function ProcedureRoute() {/>}content={- <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><ProcedureEditor /><Outlet /></div>@@ -105,7 +107,9 @@ function ProcedureEditor() {const { id } = useParams();if (!id) throw new Error("Could not find id");+ const { t } = useLingui();const permissions = usePermissions();+ const setLiveTitle = useDocumentStore((s) => s.setLiveTitle);const loaderData = useLoaderData<typeof loader>();@@ -117,6 +121,18 @@ function ProcedureEditor() {(loaderData?.procedure?.content ?? {}) as JSONContent);+ const canEdit =+ permissions.can("update", "production") &&+ loaderData?.procedure?.status === "Draft";++ // Mirror the live title only while editing; clear it when editing ends (e.g.+ // a Draft→Active transition that doesn't remount the route) or on unmount, so+ // the header title bar can never show a stale edited title.+ useEffect(() => {+ if (!canEdit) setLiveTitle(null);+ return () => setLiveTitle(null);+ }, [canEdit, setLiveTitle]);+const { carbon } = useCarbon();const {id: userId,@@ -140,25 +156,29 @@ function ProcedureEditor() {const fetcher = useFetcher<typeof action>();- const updateProcedureName = async (name: string) => {- const formData = new FormData();+ const updateProcedureName = useDebounce(+ async (name: string) => {+ const formData = new FormData();- const versions = await Promise.resolve(loaderData?.versions);+ const versions = await Promise.resolve(loaderData?.versions);- formData.append("ids", id);- if (Array.isArray(versions?.data) && versions.data.length > 0) {- versions.data.forEach((version) => {- formData.append("ids", version.id);- });- }- formData.append("field", "name");- formData.append("value", name);+ formData.append("ids", id);+ if (Array.isArray(versions?.data) && versions.data.length > 0) {+ versions.data.forEach((version) => {+ formData.append("ids", version.id);+ });+ }+ formData.append("field", "name");+ formData.append("value", name);- fetcher.submit(formData, {- method: "post",- action: path.to.bulkUpdateProcedure- });- };+ fetcher.submit(formData, {+ method: "post",+ action: path.to.bulkUpdateProcedure+ });+ },+ 500,+ true+ );const onUploadImage = async (file: File) => {const fileType = file.name.split(".").pop();@@ -179,26 +199,19 @@ function ProcedureEditor() {};return (- <div className="flex flex-col gap-6 w-full h-full p-6">- <Input- className="md:text-3xl text-2xl font-semibold leading-none tracking-tight text-foreground"- value={procedureName}- borderless- onChange={- loaderData?.procedure?.status === "Draft"- ? (e) => setProcedureName(e.target.value)- : undefined- }- onBlur={- loaderData?.procedure?.status === "Draft"- ? (e) => updateProcedureName(e.target.value)- : undefined- }- />-- {permissions.can("update", "production") &&- loaderData?.procedure?.status === "Draft" ? (+ <div className="flex flex-col w-full h-full">+ {canEdit ? (<Editor+ toolbar+ title={{+ value: procedureName,+ placeholder: t`Untitled`,+ onChange: (name) => {+ setProcedureName(name);+ setLiveTitle(name);+ updateProcedureName(name);+ }+ }}initialValue={content}onUpload={onUploadImage}onChange={(value) => {@@ -207,12 +220,17 @@ function ProcedureEditor() {}}/>) : (- <div- className="prose dark:prose-invert"- dangerouslySetInnerHTML={{- __html: generateHTML(content)- }}- />+ <div className="flex flex-col gap-6 w-full h-full p-8">+ <h1 className="md:text-3xl text-2xl font-semibold leading-tight tracking-tight text-foreground">+ {procedureName}+ </h1>+ <div+ className="prose dark:prose-invert"+ dangerouslySetInnerHTML={{+ __html: generateHTML(content)+ }}+ />+ </div>)}</div>);diff --git a/apps/erp/app/routes/x+/production+/_index.tsx b/apps/erp/app/routes/x+/production+/_index.tsxindex c71ea0280f..580d180958 100644--- a/apps/erp/app/routes/x+/production+/_index.tsx+++ b/apps/erp/app/routes/x+/production+/_index.tsx@@ -307,7 +307,7 @@ export default function ProductionDashboard() {}, [kpiFetcher.data?.data]);return (- <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-muted dark:bg-card">+ <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-card"><div className="grid w-full gap-y-4 lg:gap-x-4 grid-cols-1 lg:grid-cols-6"><MetricCardclassName="col-span-1 lg:col-span-3"diff --git a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsxindex 2018e4e378..e0be255aaa 100644--- a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx+++ b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx@@ -109,14 +109,14 @@ export default function PurchaseInvoiceRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><PurchaseInvoiceHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<PurchaseInvoiceExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx b/apps/erp/app/routes/x+/purchase-order+/$orderId.tsxindex 6304d00427..ba1e73f533 100644--- a/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx+++ b/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx@@ -551,14 +551,14 @@ export default function PurchaseOrderRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><PurchaseOrderHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<PurchaseOrderExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/purchasing+/_index.tsx b/apps/erp/app/routes/x+/purchasing+/_index.tsxindex 8bb6fce720..2be280efc3 100644--- a/apps/erp/app/routes/x+/purchasing+/_index.tsx+++ b/apps/erp/app/routes/x+/purchasing+/_index.tsx@@ -394,7 +394,7 @@ export default function PurchaseDashboard() {}, [dateRange, kpiLabels, selectedKpiData.key]);return (- <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-muted dark:bg-card">+ <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-card"><div className="grid w-full gap-4 grid-cols-1 lg:grid-cols-3"><MetricCardicon={<LuPackageSearch />}diff --git a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.tsx b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.tsxindex d4c83e1222..e386ec1b4e 100644--- a/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.tsx+++ b/apps/erp/app/routes/x+/purchasing-rfq+/$rfqId.tsx@@ -116,14 +116,14 @@ export default function PurchasingRFQRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><PurchasingRFQHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<PurchasingRFQExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/quality+/_index.tsx b/apps/erp/app/routes/x+/quality+/_index.tsxindex 8283550114..a220f150c9 100644--- a/apps/erp/app/routes/x+/quality+/_index.tsx+++ b/apps/erp/app/routes/x+/quality+/_index.tsx@@ -378,7 +378,7 @@ export default function QualityDashboard() {(kpiFetcher.data as any)?.meta?.qualityIssueTarget ?? qualityIssueTarget;return (- <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-muted dark:bg-card">+ <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-card">{/* KPI Cards */}<div className="grid w-full gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"><MetricCarddiff --git a/apps/erp/app/routes/x+/quality-document+/$id.tsx b/apps/erp/app/routes/x+/quality-document+/$id.tsxindex 70bd5c73d3..ab0b8a1bcf 100644--- a/apps/erp/app/routes/x+/quality-document+/$id.tsx+++ b/apps/erp/app/routes/x+/quality-document+/$id.tsx@@ -264,9 +264,9 @@ export default function QualityDocumentRoute() {return (<PanelProvider key={`${id}-${document.version}`}>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><QualityDocumentHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -275,7 +275,7 @@ export default function QualityDocumentRoute() {/>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><QualityDocumentEditor /><Outlet /></div>diff --git a/apps/erp/app/routes/x+/quote+/$quoteId.tsx b/apps/erp/app/routes/x+/quote+/$quoteId.tsxindex 06c1c8d7dd..087c24819a 100644--- a/apps/erp/app/routes/x+/quote+/$quoteId.tsx+++ b/apps/erp/app/routes/x+/quote+/$quoteId.tsx@@ -240,14 +240,14 @@ export default function QuoteRoute() {return (<DndContext onDragEnd={handleDragEnd}><PanelProvider key={quoteId}>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full ">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full "><QuoteHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<QuoteExplorer methods={methods} />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/receipt+/$receiptId.tsx b/apps/erp/app/routes/x+/receipt+/$receiptId.tsxindex 7ea94f3cec..db364fd8bc 100644--- a/apps/erp/app/routes/x+/receipt+/$receiptId.tsx+++ b/apps/erp/app/routes/x+/receipt+/$receiptId.tsx@@ -135,7 +135,7 @@ export default function ReceiptRoute() {if (!receiptId) throw new Error("Could not find receiptId");return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 w-full max-w-5xl mx-auto"><div className="flex flex-col gap-2 pb-16 w-full"><Outlet />diff --git a/apps/erp/app/routes/x+/resources+/_index.tsx b/apps/erp/app/routes/x+/resources+/_index.tsxindex c8e169dacb..570daa6104 100644--- a/apps/erp/app/routes/x+/resources+/_index.tsx+++ b/apps/erp/app/routes/x+/resources+/_index.tsx@@ -352,7 +352,7 @@ export default function MaintenanceDashboard() {]);return (- <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-muted dark:bg-card">+ <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-card"><div className="grid w-full gap-4 grid-cols-1 lg:grid-cols-3"><MetricCardicon={<LuWrench />}diff --git a/apps/erp/app/routes/x+/sales+/_index.tsx b/apps/erp/app/routes/x+/sales+/_index.tsxindex 72c68b5e0d..5bdf8cc4f1 100644--- a/apps/erp/app/routes/x+/sales+/_index.tsx+++ b/apps/erp/app/routes/x+/sales+/_index.tsx@@ -380,7 +380,7 @@ export default function SalesDashboard() {]);return (- <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-muted dark:bg-card">+ <div className="flex flex-col gap-4 w-full p-4 h-[calc(100dvh-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-thumb-rounded-full scrollbar-thumb-muted-foreground bg-card"><div className="grid w-full gap-4 grid-cols-1 lg:grid-cols-3"><MetricCardicon={<RiProgress2Line />}diff --git a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.tsx b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.tsxindex cff7276b9f..8a9ae36229 100644--- a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.tsx+++ b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.tsx@@ -136,14 +136,14 @@ export default function SalesInvoiceRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><SalesInvoiceHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<SalesInvoiceExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/sales-order+/$orderId.tsx b/apps/erp/app/routes/x+/sales-order+/$orderId.tsxindex 9f72400d99..eee68cea84 100644--- a/apps/erp/app/routes/x+/sales-order+/$orderId.tsx+++ b/apps/erp/app/routes/x+/sales-order+/$orderId.tsx@@ -168,14 +168,14 @@ export default function SalesOrderRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><SalesOrderHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<SalesOrderExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx b/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsxindex afee768a32..9071720c5f 100644--- a/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx+++ b/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx@@ -152,14 +152,14 @@ export default function SalesRFQRoute() {return (<DndContext onDragEnd={handleDragEnd}><PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><SalesRFQHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<SalesRFQExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/scheduling+/forecast.tsx b/apps/erp/app/routes/x+/scheduling+/forecast.tsxindex 51e7167364..8f5b6cfaf7 100644--- a/apps/erp/app/routes/x+/scheduling+/forecast.tsx+++ b/apps/erp/app/routes/x+/scheduling+/forecast.tsx@@ -619,7 +619,7 @@ export default function ResourceGanttView() {}return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full bg-background">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full bg-background"><ForecastHeaderrange={range}date={date}diff --git a/apps/erp/app/routes/x+/service+/$itemId.tsx b/apps/erp/app/routes/x+/service+/$itemId.tsxindex f5936d3465..805fff9036 100644--- a/apps/erp/app/routes/x+/service+/$itemId.tsx+++ b/apps/erp/app/routes/x+/service+/$itemId.tsx@@ -217,9 +217,9 @@ export default function ServiceRoute() {};return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ServiceHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -321,7 +321,7 @@ export default function ServiceRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/settings+/_layout.tsx b/apps/erp/app/routes/x+/settings+/_layout.tsxindex 33d61270f2..2c300ddab5 100644--- a/apps/erp/app/routes/x+/settings+/_layout.tsx+++ b/apps/erp/app/routes/x+/settings+/_layout.tsx@@ -27,7 +27,7 @@ export default function SettingsRoute() {<GroupedContentSidebar groups={groups} /><VStackspacing={0}- className="overflow-y-auto scrollbar-hide h-[calc(100dvh-var(--topbar-height))]"+ className="overflow-y-auto scrollbar-hide h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/settings+/accounting.tsx b/apps/erp/app/routes/x+/settings+/accounting.tsxindex 523c4926ad..faf8eb3f01 100644--- a/apps/erp/app/routes/x+/settings+/accounting.tsx+++ b/apps/erp/app/routes/x+/settings+/accounting.tsx@@ -229,7 +229,7 @@ export default function AccountingSettingsRoute() {);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/audit-logs.tsx b/apps/erp/app/routes/x+/settings+/audit-logs.tsxindex 6ef86750b2..6525b8f3d9 100644--- a/apps/erp/app/routes/x+/settings+/audit-logs.tsx+++ b/apps/erp/app/routes/x+/settings+/audit-logs.tsx@@ -181,7 +181,7 @@ export default function AuditLogRoute() {}return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/backups.tsx b/apps/erp/app/routes/x+/settings+/backups.tsxindex 014a50d07e..a855c60551 100644--- a/apps/erp/app/routes/x+/settings+/backups.tsx+++ b/apps/erp/app/routes/x+/settings+/backups.tsx@@ -608,7 +608,7 @@ export default function BackupsRoute() {}, [fetcher.data, knownBackupNames]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><div className="py-12 px-4 max-w-[72rem] mx-auto flex flex-col gap-4"><Heading size="h3">Backups</Heading>diff --git a/apps/erp/app/routes/x+/settings+/billing.tsx b/apps/erp/app/routes/x+/settings+/billing.tsxindex 73992fe7e3..28c683310f 100644--- a/apps/erp/app/routes/x+/settings+/billing.tsx+++ b/apps/erp/app/routes/x+/settings+/billing.tsx@@ -190,7 +190,7 @@ export default function PaymentSettings() {const { t } = useLingui();return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/company.tsx b/apps/erp/app/routes/x+/settings+/company.tsxindex 365be701cf..590b0b5bcd 100644--- a/apps/erp/app/routes/x+/settings+/company.tsx+++ b/apps/erp/app/routes/x+/settings+/company.tsx@@ -136,7 +136,7 @@ export default function Company() {};return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/inventory.tsx b/apps/erp/app/routes/x+/settings+/inventory.tsxindex 947366135d..6afea2a8c0 100644--- a/apps/erp/app/routes/x+/settings+/inventory.tsx+++ b/apps/erp/app/routes/x+/settings+/inventory.tsx@@ -215,7 +215,7 @@ export default function InventorySettingsRoute() {}, [fetcher.data?.message, fetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/items.tsx b/apps/erp/app/routes/x+/settings+/items.tsxindex 694553f3ff..194f1f0651 100644--- a/apps/erp/app/routes/x+/settings+/items.tsx+++ b/apps/erp/app/routes/x+/settings+/items.tsx@@ -176,7 +176,7 @@ export default function ItemsSettingsRoute() {);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/logos.tsx b/apps/erp/app/routes/x+/settings+/logos.tsxindex 166e2b7aff..9efab3d17a 100644--- a/apps/erp/app/routes/x+/settings+/logos.tsx+++ b/apps/erp/app/routes/x+/settings+/logos.tsx@@ -76,7 +76,7 @@ export default function LogosRoute() {if (!company) throw new Error("Company not found");return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStack spacing={4} className="py-12 px-4 max-w-[60rem] h-full mx-auto"><div className="flex w-full justify-between items-center gap-1"><Heading size="h3">diff --git a/apps/erp/app/routes/x+/settings+/people.tsx b/apps/erp/app/routes/x+/settings+/people.tsxindex 274d8668e2..5693dd6bfb 100644--- a/apps/erp/app/routes/x+/settings+/people.tsx+++ b/apps/erp/app/routes/x+/settings+/people.tsx@@ -155,7 +155,7 @@ export default function PeopleSettingsRoute() {);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/printing.tsx b/apps/erp/app/routes/x+/settings+/printing.tsxindex f290b03960..66bf4614ba 100644--- a/apps/erp/app/routes/x+/settings+/printing.tsx+++ b/apps/erp/app/routes/x+/settings+/printing.tsx@@ -231,7 +231,7 @@ export default function PrintingSettingsRoute() {useLoaderData<typeof loader>();return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/production.tsx b/apps/erp/app/routes/x+/settings+/production.tsxindex 659bc43243..02eac789c2 100644--- a/apps/erp/app/routes/x+/settings+/production.tsx+++ b/apps/erp/app/routes/x+/settings+/production.tsx@@ -292,7 +292,7 @@ export default function ProductionSettingsRoute() {}, [notificationsFetcher.data?.message, notificationsFetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/purchasing.tsx b/apps/erp/app/routes/x+/settings+/purchasing.tsxindex 9486df8cda..da3b0aae19 100644--- a/apps/erp/app/routes/x+/settings+/purchasing.tsx+++ b/apps/erp/app/routes/x+/settings+/purchasing.tsx@@ -369,7 +369,7 @@ export default function PurchasingSettingsRoute() {}, [toggleFetcher.data?.message, toggleFetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/quality.tsx b/apps/erp/app/routes/x+/settings+/quality.tsxindex 2c472926c3..2013158640 100644--- a/apps/erp/app/routes/x+/settings+/quality.tsx+++ b/apps/erp/app/routes/x+/settings+/quality.tsx@@ -198,7 +198,7 @@ export default function QualitySettingsRoute() {}, [toggleFetcher.data?.message, toggleFetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/resources.tsx b/apps/erp/app/routes/x+/settings+/resources.tsxindex c74ca156a0..cf72d9780c 100644--- a/apps/erp/app/routes/x+/settings+/resources.tsx+++ b/apps/erp/app/routes/x+/settings+/resources.tsx@@ -148,7 +148,7 @@ export default function ResourcesSettingsRoute() {}, [fetcher.data?.message, fetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/sales.tsx b/apps/erp/app/routes/x+/settings+/sales.tsxindex 17bbbfeadf..ee137dfb48 100644--- a/apps/erp/app/routes/x+/settings+/sales.tsx+++ b/apps/erp/app/routes/x+/settings+/sales.tsx@@ -308,7 +308,7 @@ export default function SalesSettingsRoute() {}, [toggleFetcher.data?.message, toggleFetcher.data?.success]);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-4"diff --git a/apps/erp/app/routes/x+/settings+/security.tsx b/apps/erp/app/routes/x+/settings+/security.tsxindex 659f0be20f..a3d88ba3d5 100644--- a/apps/erp/app/routes/x+/settings+/security.tsx+++ b/apps/erp/app/routes/x+/settings+/security.tsx@@ -418,7 +418,7 @@ export default function Security() {);return (- <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height))]">+ <ScrollArea className="w-full h-[calc(100dvh-var(--topbar-height)-var(--content-inset))]"><VStackspacing={4}className="py-12 px-4 max-w-[60rem] h-full mx-auto gap-8"diff --git a/apps/erp/app/routes/x+/shipment+/$shipmentId.tsx b/apps/erp/app/routes/x+/shipment+/$shipmentId.tsxindex 614162667c..1342fa5809 100644--- a/apps/erp/app/routes/x+/shipment+/$shipmentId.tsx+++ b/apps/erp/app/routes/x+/shipment+/$shipmentId.tsx@@ -106,7 +106,7 @@ export default function ShipmentRoute() {if (!shipmentId) throw new Error("Could not find shipmentId");return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 w-full max-w-5xl mx-auto"><div className="flex flex-col gap-2 pb-16 w-full"><Outlet />diff --git a/apps/erp/app/routes/x+/stock-transfer+/$id.tsx b/apps/erp/app/routes/x+/stock-transfer+/$id.tsxindex 76cb1f3c9e..e214c44122 100644--- a/apps/erp/app/routes/x+/stock-transfer+/$id.tsx+++ b/apps/erp/app/routes/x+/stock-transfer+/$id.tsx@@ -64,9 +64,9 @@ export default function StockTransferRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><StockTransferHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><VStack spacing={4} className="h-full p-4 w-full max-w-5xl mx-auto"><StockTransferLines /><StockTransferNotesdiff --git a/apps/erp/app/routes/x+/supplier-quote+/$id.tsx b/apps/erp/app/routes/x+/supplier-quote+/$id.tsxindex 4fa3f39801..73c242a51a 100644--- a/apps/erp/app/routes/x+/supplier-quote+/$id.tsx+++ b/apps/erp/app/routes/x+/supplier-quote+/$id.tsx@@ -43,22 +43,19 @@ export async function loader({ request, params }: LoaderFunctionArgs) {if (!id) throw new Error("Could not find id");const serviceRole = await getCarbonServiceRole();- const [quote, lines, prices, siblingQuotes] = await Promise.all([- getSupplierQuote(serviceRole, id),- getSupplierQuoteLines(serviceRole, id),- getSupplierQuoteLinePricesByQuoteId(serviceRole, id),- getSiblingQuotesForQuote(serviceRole, id)- ]);+ // These reads run service-role (RLS bypassed), and `id` is the untrusted URL+ // param, so resolve the quote and confirm it belongs to the caller's company+ // BEFORE reading anything else keyed off it — otherwise a cross-company id+ // would load that quote's lines/prices/siblings (CWE-639 IDOR).+ const quote = await getSupplierQuote(serviceRole, id);- if (quote.error) {+ if (quote.error || !quote.data) {throw redirect(path.to.supplierQuotes,await flash(request, error(quote.error, "Failed to load quote")));}- // The reads above run service-role (RLS bypassed) — refuse a cross-company id- // before resolving anything against it.if (quote.data.companyId !== companyId) {throw redirect(path.to.supplierQuotes,@@ -66,6 +63,12 @@ export async function loader({ request, params }: LoaderFunctionArgs) {);}+ const [lines, prices, siblingQuotes] = await Promise.all([+ getSupplierQuoteLines(serviceRole, id),+ getSupplierQuoteLinePricesByQuoteId(serviceRole, id),+ getSiblingQuotesForQuote(serviceRole, id)+ ]);+const [supplierInteraction, presentationCurrency, supplier, companySettings] =await Promise.all([getSupplierInteraction(serviceRole, quote.data.supplierInteractionId!),@@ -146,14 +149,14 @@ export default function SupplierQuoteRoute() {return (<PanelProvider>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><SupplierQuoteHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<SupplierQuoteExplorer />}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><VStack spacing={4} className="p-4"><Outlet /></VStack>diff --git a/apps/erp/app/routes/x+/tool+/$itemId.tsx b/apps/erp/app/routes/x+/tool+/$itemId.tsxindex 6d59a66a49..322ea470a2 100644--- a/apps/erp/app/routes/x+/tool+/$itemId.tsx+++ b/apps/erp/app/routes/x+/tool+/$itemId.tsx@@ -181,9 +181,9 @@ export default function ToolRoute() {const [filterText, setFilterText] = useState("");return (- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><ToolHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={@@ -569,7 +569,7 @@ export default function ToolRoute() {</div>}content={- <div className="bg-muted dark:bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><Outlet /></div>}diff --git a/apps/erp/app/routes/x+/traceability+/graph.tsx b/apps/erp/app/routes/x+/traceability+/graph.tsxindex 025a153469..099b9005ba 100644--- a/apps/erp/app/routes/x+/traceability+/graph.tsx+++ b/apps/erp/app/routes/x+/traceability+/graph.tsx@@ -345,7 +345,7 @@ function TraceabilityRouteInner() {null);return (- <div className="flex bg-card h-[calc(100dvh-var(--topbar-height))] w-full overflow-hidden scrollbar-hide">+ <div className="flex bg-card h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] w-full overflow-hidden scrollbar-hide"><VStack className="flex-1 min-w-0 h-full" spacing={0}><div className="flex flex-1 w-full h-full overflow-hidden"><div className="w-full h-full">diff --git a/apps/erp/app/routes/x+/training+/$id.tsx b/apps/erp/app/routes/x+/training+/$id.tsxindex d462250d03..109f23a785 100644--- a/apps/erp/app/routes/x+/training+/$id.tsx+++ b/apps/erp/app/routes/x+/training+/$id.tsx@@ -70,14 +70,14 @@ export default function TrainingRoute() {return (<PanelProvider key={id}>- <div className="flex flex-col h-[calc(100dvh-var(--topbar-height))] overflow-hidden w-full">+ <div className="flex flex-col h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-hidden w-full"><TrainingHeader />- <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-hidden w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-hidden w-full"><div className="flex flex-grow overflow-hidden"><ResizablePanelsexplorer={<TrainingExplorer key={`explorer-${id}`} />}content={- <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">+ <div className="bg-card h-[calc(100dvh-var(--topbar-height)-var(--header-height)-var(--content-inset))] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full"><TrainingEditor /><Outlet /></div>@@ -182,6 +182,7 @@ function TrainingEditor() {{permissions.can("update", "people") &&loaderData?.training?.status === "Draft" ? (<Editor+ toolbarinitialValue={content}onUpload={onUploadImage}onChange={(value) => {diff --git a/apps/erp/app/routes/x+/warehouse-transfer+/$transferId.tsx b/apps/erp/app/routes/x+/warehouse-transfer+/$transferId.tsxindex 40c2038c37..bfee85952f 100644--- a/apps/erp/app/routes/x+/warehouse-transfer+/$transferId.tsx+++ b/apps/erp/app/routes/x+/warehouse-transfer+/$transferId.tsx@@ -67,7 +67,7 @@ export default function WarehouseTransferRoute() {if (!transferId) throw new Error("Could not find transferId");return (- <div className="flex h-[calc(100dvh-var(--topbar-height))] overflow-y-auto scrollbar-hide w-full">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] overflow-y-auto scrollbar-hide w-full"><div className="h-full p-4 w-full max-w-5xl mx-auto"><div className="flex flex-col gap-2 pb-16 w-full"><Outlet />diff --git a/apps/erp/app/routes/x+/workflow+/$id.tsx b/apps/erp/app/routes/x+/workflow+/$id.tsxindex 85f13ee977..f66a73c92b 100644--- a/apps/erp/app/routes/x+/workflow+/$id.tsx+++ b/apps/erp/app/routes/x+/workflow+/$id.tsx@@ -195,7 +195,7 @@ export default function WorkflowBuilderRoute() {canEdit={canEdit}isOwner={isOwner}>- <div className="flex h-[calc(100dvh-var(--topbar-height))] w-full flex-col">+ <div className="flex h-[calc(100dvh-var(--topbar-height)-var(--content-inset))] w-full flex-col"><BuilderHeaderworkflow={workflow}versions={versions}diff --git a/apps/erp/app/stores/document.ts b/apps/erp/app/stores/document.tsnew file mode 100644index 0000000000..63691e1794--- /dev/null+++ b/apps/erp/app/stores/document.ts@@ -0,0 +1,18 @@+import { create } from "zustand";++interface DocumentStore {+ /**+ * Live title of the currently-open full-screen document editor (quality+ * document, procedure). The editor streams the locked title block here so the+ * header title bar updates immediately, before the loader revalidates. The+ * persisted value is still `name` — this is a display-only mirror. Reset to+ * `null` when the editor unmounts so a stale title never leaks to the header.+ */+ liveTitle: string | null;+ setLiveTitle: (title: string | null) => void;+}++export const useDocumentStore = create<DocumentStore>()((set) => ({+ liveTitle: null,+ setLiveTitle: (liveTitle) => set({ liveTitle })+}));diff --git a/apps/erp/app/stores/index.ts b/apps/erp/app/stores/index.tsindex 4a1e87ddce..d92404005b 100644--- a/apps/erp/app/stores/index.ts+++ b/apps/erp/app/stores/index.ts@@ -1,4 +1,5 @@export * from "./customers";+export * from "./document";export * from "./items";export * from "./people";export * from "./stock-transfer";diff --git a/apps/erp/app/styles/tailwind.css b/apps/erp/app/styles/tailwind.cssindex 4a4335ed2c..d783304c33 100644--- a/apps/erp/app/styles/tailwind.css+++ b/apps/erp/app/styles/tailwind.css@@ -50,6 +50,11 @@ html.mode-transitioning *::after {--topbar-height: 49px;--header-height: 50px;--filters-height: 38px;+ /* Vertical space the inset app-shell panel gives up to its gutters+ (md:mt-2 + md:mb-2 in x+/_layout.tsx). Full-bleed below md → 0.+ Full-screen pages subtract this from their 100dvh height calcs so+ bottom-pinned content isn't clipped by the panel. */+ --content-inset: 0px;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;@@ -129,6 +134,13 @@ html.mode-transitioning *::after {inset 0px 1px 2px rgb(0 0 0 / 0.06),inset 0px -4px 8px -4px rgb(0 0 0 / 0.06);}++ /* The inset app-shell panel gains 8px top + 8px bottom gutters at md+. */+ @media (min-width: 768px) {+ :root {+ --content-inset: 1rem;+ }+ }}@layer base {diff --git a/packages/config/tailwind/theme.css b/packages/config/tailwind/theme.cssindex 2bd935d2f6..fe1e41b935 100644--- a/packages/config/tailwind/theme.css+++ b/packages/config/tailwind/theme.css@@ -145,6 +145,7 @@--container-2xl: 1400px;}+@keyframes accordion-down {from {height: 0;@@ -198,3 +199,24 @@opacity: 0.25;}}++/*+ * Full-screen document editor: the locked first block (see the `title` mode of+ * @carbon/react's Editor) reads as the page title — matching the old borderless+ * title input (text-2xl / md:text-3xl, font-semibold, tracking-tight).+ */+.has-document-title .ProseMirror > :first-child {+ font-size: 1.5rem;+ line-height: 2rem;+ font-weight: 600;+ letter-spacing: -0.025em;+ margin-top: 0;+ margin-bottom: 0.75rem;+}++@media (min-width: 768px) {+ .has-document-title .ProseMirror > :first-child {+ font-size: 1.875rem;+ line-height: 2.25rem;+ }+}diff --git a/packages/database/src/swagger-docs-schema.ts b/packages/database/src/swagger-docs-schema.tsindex 6647a3befe..43a718cd03 100644--- a/packages/database/src/swagger-docs-schema.ts+++ b/packages/database/src/swagger-docs-schema.ts@@ -106592,7 +106592,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"},@@ -106641,7 +106641,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/locale/locales/de/erp.po b/packages/locale/locales/de/erp.poindex d64dfea05f..a80701d66d 100644--- a/packages/locale/locales/de/erp.po+++ b/packages/locale/locales/de/erp.po@@ -17415,6 +17415,9 @@ msgstr "Nicht versendete Bestellungen"msgid "Unsupported source document type: {sourceDocument}"msgstr "Ursprungsbeleg-Typ nicht unterstützt: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Unbenanntes Diagramm"diff --git a/packages/locale/locales/en/erp.po b/packages/locale/locales/en/erp.poindex 5573a64dfb..fcdb598c51 100644--- a/packages/locale/locales/en/erp.po+++ b/packages/locale/locales/en/erp.po@@ -17415,6 +17415,9 @@ msgstr "Unshipped orders"msgid "Unsupported source document type: {sourceDocument}"msgstr "Unsupported source document type: {sourceDocument}"+msgid "Untitled"+msgstr "Untitled"+msgid "Untitled Diagram"msgstr "Untitled Diagram"diff --git a/packages/locale/locales/es/erp.po b/packages/locale/locales/es/erp.poindex 4a3a5becb6..c3b804f996 100644--- a/packages/locale/locales/es/erp.po+++ b/packages/locale/locales/es/erp.po@@ -17415,6 +17415,9 @@ msgstr "Pedidos no enviados"msgid "Unsupported source document type: {sourceDocument}"msgstr "Tipo de documento de origen no compatible: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Diagrama sin título"diff --git a/packages/locale/locales/fr/erp.po b/packages/locale/locales/fr/erp.poindex 93c36eb949..2a7386481a 100644--- a/packages/locale/locales/fr/erp.po+++ b/packages/locale/locales/fr/erp.po@@ -17415,6 +17415,9 @@ msgstr "Commandes non expédiées"msgid "Unsupported source document type: {sourceDocument}"msgstr "Type de document d'origine non pris en charge : {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Diagramme sans titre"diff --git a/packages/locale/locales/hi/erp.po b/packages/locale/locales/hi/erp.poindex 4b612c9f95..9b2d62186a 100644--- a/packages/locale/locales/hi/erp.po+++ b/packages/locale/locales/hi/erp.po@@ -17415,6 +17415,9 @@ msgstr "अभी भेजे जाने वाले ऑर्डर"msgid "Unsupported source document type: {sourceDocument}"msgstr "असमर्थित स्रोत दस्तावेज़ प्रकार: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "बिना शीर्षक वाला आरेख"diff --git a/packages/locale/locales/it/erp.po b/packages/locale/locales/it/erp.poindex 621b11fb78..3ba498c30f 100644--- a/packages/locale/locales/it/erp.po+++ b/packages/locale/locales/it/erp.po@@ -17415,6 +17415,9 @@ msgstr "Ordini non spediti"msgid "Unsupported source document type: {sourceDocument}"msgstr "Tipo di documento di origine non supportato: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Diagramma senza titolo"diff --git a/packages/locale/locales/ja/erp.po b/packages/locale/locales/ja/erp.poindex 420ed47503..ee97831e8b 100644--- a/packages/locale/locales/ja/erp.po+++ b/packages/locale/locales/ja/erp.po@@ -17415,6 +17415,9 @@ msgstr "未発送注文"msgid "Unsupported source document type: {sourceDocument}"msgstr "対応していない参照伝票タイプ:{sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "無題の図"diff --git a/packages/locale/locales/ko/erp.po b/packages/locale/locales/ko/erp.poindex b4bddc7677..de43103f50 100644--- a/packages/locale/locales/ko/erp.po+++ b/packages/locale/locales/ko/erp.po@@ -17415,6 +17415,9 @@ msgstr "미출하 주문"msgid "Unsupported source document type: {sourceDocument}"msgstr "지원되지 않는 원본 문서 유형: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "제목 없는 다이어그램"diff --git a/packages/locale/locales/pl/erp.po b/packages/locale/locales/pl/erp.poindex 6ff881b9ed..89992a29b2 100644--- a/packages/locale/locales/pl/erp.po+++ b/packages/locale/locales/pl/erp.po@@ -17415,6 +17415,9 @@ msgstr "Niewysłane zamówienia"msgid "Unsupported source document type: {sourceDocument}"msgstr "Nieobsługiwany typ dokumentu źródłowego: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Diagram bez tytułu"diff --git a/packages/locale/locales/pt/erp.po b/packages/locale/locales/pt/erp.poindex b180e5d017..50240c4bb3 100644--- a/packages/locale/locales/pt/erp.po+++ b/packages/locale/locales/pt/erp.po@@ -17415,6 +17415,9 @@ msgstr "Pedidos não enviados"msgid "Unsupported source document type: {sourceDocument}"msgstr "Tipo de documento de origem não suportado: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Diagrama sem título"diff --git a/packages/locale/locales/ru/erp.po b/packages/locale/locales/ru/erp.poindex bb6a5eb06e..43199a95c6 100644--- a/packages/locale/locales/ru/erp.po+++ b/packages/locale/locales/ru/erp.po@@ -17415,6 +17415,9 @@ msgstr "Невыполненные заказы"msgid "Unsupported source document type: {sourceDocument}"msgstr "Неподдерживаемый тип документа-основания: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Безымянная диаграмма"diff --git a/packages/locale/locales/tr/erp.po b/packages/locale/locales/tr/erp.poindex fee1785cfa..107df343fc 100644--- a/packages/locale/locales/tr/erp.po+++ b/packages/locale/locales/tr/erp.po@@ -17415,6 +17415,9 @@ msgstr "Gönderilmemiş siparişler"msgid "Unsupported source document type: {sourceDocument}"msgstr "Desteklenmeyen kaynak belge türü: {sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "Başlıksız Diyagram"diff --git a/packages/locale/locales/zh/erp.po b/packages/locale/locales/zh/erp.poindex a7a3055e74..84d7eccb71 100644--- a/packages/locale/locales/zh/erp.po+++ b/packages/locale/locales/zh/erp.po@@ -17415,6 +17415,9 @@ msgstr "未发货订单"msgid "Unsupported source document type: {sourceDocument}"msgstr "不支持的源单据类型:{sourceDocument}"+msgid "Untitled"+msgstr ""+msgid "Untitled Diagram"msgstr "未命名图表"diff --git a/packages/react/src/Editor/Editor.tsx b/packages/react/src/Editor/Editor.tsxindex d4a159cf26..b6e318d485 100644Binary files a/packages/react/src/Editor/Editor.tsx and b/packages/react/src/Editor/Editor.tsx differdiff --git a/packages/react/src/Editor/components/Toolbar.tsx b/packages/react/src/Editor/components/Toolbar.tsxnew file mode 100644index 0000000000..521330df10--- /dev/null+++ b/packages/react/src/Editor/components/Toolbar.tsx@@ -0,0 +1,48 @@+"use client";++import { lazy, Suspense, useState } from "react";+import { Separator } from "../../Separator";+import { cn } from "../../utils/cn";+import { ColorSelector } from "./ColorSelector";+import { LinkSelector } from "./LinkSelector";++const NodeSelector = lazy(() =>+ import("./NodeSelector").then((m) => ({ default: m.NodeSelector }))+);+const TextButtons = lazy(() =>+ import("./TextButton").then((m) => ({ default: m.TextButtons }))+);++/**+ * A persistent formatting toolbar for the full-screen `Editor` (procedures,+ * training, quality documents, …). It renders the SAME options exposed by the+ * floating bubble menu — the block/node selector, color, inline text styles,+ * and link — so it introduces no new capabilities, only a fixed surface for+ * them. Card-contained editors (notes) keep the bubble menu and omit this bar.+ */+export const Toolbar = ({ className }: { className?: string }) => {+ const [openNode, setOpenNode] = useState(false);+ const [openColor, setOpenColor] = useState(false);+ const [openLink, setOpenLink] = useState(false);++ return (+ <div+ className={cn(+ "sticky top-0 z-10 flex w-full flex-wrap items-center gap-1 border-b border-border bg-card p-2",+ className+ )}+ >+ <Suspense fallback={null}>+ <NodeSelector open={openNode} onOpenChange={setOpenNode} />+ </Suspense>+ <Separator orientation="vertical" className="mx-1 h-6" />+ <ColorSelector open={openColor} onOpenChange={setOpenColor} />+ <Separator orientation="vertical" className="mx-1 h-6" />+ <Suspense fallback={null}>+ <TextButtons />+ </Suspense>+ <Separator orientation="vertical" className="mx-1 h-6" />+ <LinkSelector open={openLink} onOpenChange={setOpenLink} />+ </div>+ );+};diff --git a/packages/react/src/Editor/document-title.ts b/packages/react/src/Editor/document-title.tsnew file mode 100644index 0000000000..82d92d151e--- /dev/null+++ b/packages/react/src/Editor/document-title.ts@@ -0,0 +1,145 @@+import { Extension } from "@tiptap/core";+import { Plugin, PluginKey } from "@tiptap/pm/state";++/**+ * Locks the document's first node as an H1 "title": it can't be deleted, merged+ * into (from either direction), or turned into another block type, and pressing+ * Enter inside it drops the cursor into the body rather than splitting the title.+ *+ * Modeled on Plane's document title behavior, but as a single-editor extension+ * (Carbon stores `name`/`content` separately and has no Yjs, so the consuming+ * component splits the title node out of the body on save).+ *+ * Only added when the `Editor` runs in title mode — every other editor keeps the+ * default schema and behavior.+ */+export const DocumentTitle = Extension.create({+ name: "documentTitle",+ // Run our Backspace/Delete/Enter handlers before StarterKit's defaults.+ priority: 1000,++ addKeyboardShortcuts() {+ // The title is always the first top-level node.+ const atTitleStart = () => {+ const { $from, empty } = this.editor.state.selection;+ return (+ empty &&+ $from.parent === this.editor.state.doc.firstChild &&+ $from.parentOffset === 0+ );+ };+ const atTitleEnd = () => {+ const { $from, empty } = this.editor.state.selection;+ const first = this.editor.state.doc.firstChild;+ return (+ empty &&+ !!first &&+ $from.parent === first &&+ $from.parentOffset === first.content.size+ );+ };+ const atBodyStart = () => {+ const { $from, empty } = this.editor.state.selection;+ const second = this.editor.state.doc.maybeChild(1);+ return (+ empty && !!second && $from.parent === second && $from.parentOffset === 0+ );+ };+ // Move the cursor to the end of the title's text (never merging content).+ const focusTitleEnd = () => {+ const first = this.editor.state.doc.firstChild;+ if (!first) return false;+ return this.editor+ .chain()+ .focus(first.nodeSize - 1)+ .run();+ };++ // Backspace at the very start of the title, and at the start of the body,+ // must never join the two nodes together.+ const guardBackspace = () => {+ if (atTitleStart()) return true;+ if (atBodyStart()) return focusTitleEnd();+ return false;+ };+ // Delete/forward-delete at the end of the title must not pull the body up+ // into the heading.+ const guardDelete = () => {+ if (!atTitleEnd()) return false;+ const first = this.editor.state.doc.firstChild;+ if (!first) return false;+ const hasBody = !!this.editor.state.doc.maybeChild(1);+ if (!hasBody) return true; // nothing after the title — swallow+ return this.editor+ .chain()+ .focus(first.nodeSize + 1)+ .run();+ };++ return {+ Backspace: guardBackspace,+ "Mod-Backspace": guardBackspace,+ Delete: guardDelete,+ "Mod-Delete": guardDelete,+ Enter: () => {+ const { state } = this.editor;+ const { $from } = state.selection;+ // Enter anywhere in the title moves into the body (creating a first+ // paragraph if the body is empty) — never a second title line.+ if ($from.parent !== state.doc.firstChild) return false;++ const titleNode = state.doc.firstChild;+ if (!titleNode) return false;+ const afterTitle = titleNode.nodeSize; // position just after the title+ const hasBody = !!state.doc.maybeChild(1);++ if (hasBody) {+ return this.editor+ .chain()+ .focus(afterTitle + 1)+ .run();+ }+ return this.editor+ .chain()+ .insertContentAt(afterTitle, { type: "paragraph" })+ .focus(afterTitle + 1)+ .run();+ }+ };+ },++ addProseMirrorPlugins() {+ const headingType = this.editor.schema.nodes.heading;+ if (!headingType) return [];++ return [+ new Plugin({+ key: new PluginKey("documentTitleLock"),+ // Coerce node 0 back to an H1 after any transaction that changed it —+ // the block-type dropdown turning it into a paragraph/H2 (a textblock,+ // preserve inline marks), or into a list/blockquote (not a textblock,+ // rebuild from its text so the schema stays valid).+ appendTransaction: (_transactions, _oldState, newState) => {+ const first = newState.doc.firstChild;+ if (!first) return null;+ const isTitle =+ first.type.name === "heading" && first.attrs.level === 1;+ if (isTitle) return null;++ const tr = newState.tr;+ if (first.isTextblock) {+ tr.setNodeMarkup(0, headingType, { ...first.attrs, level: 1 });+ } else {+ const text = first.textContent;+ const heading = headingType.createChecked(+ { level: 1 },+ text ? newState.schema.text(text) : undefined+ );+ tr.replaceWith(0, first.nodeSize, heading);+ }+ return tr.steps.length ? tr : null;+ }+ })+ ];+ }+});diff --git a/packages/react/src/Subheading.tsx b/packages/react/src/Subheading.tsxnew file mode 100644index 0000000000..f33ff904c5--- /dev/null+++ b/packages/react/src/Subheading.tsx@@ -0,0 +1,58 @@+import type { VariantProps } from "class-variance-authority";+import { cva } from "class-variance-authority";+import type { ComponentProps, ElementType } from "react";+import { forwardRef } from "react";++import { cn } from "./utils/cn";++const subheadingVariants = cva("uppercase tracking-wide", {+ variants: {+ variant: {+ heavy: "text-xs font-medium text-muted-foreground",+ light: "text-[11px]/[13px] font-light text-foreground/70"+ }+ },+ defaultVariants: {+ variant: "heavy"+ }+});++export interface SubheadingProps+ extends Omit<ComponentProps<"span">, "color">,+ VariantProps<typeof subheadingVariants> {+ /**+ * The element to render. Defaults to `span` (inline, no document semantics).+ * Pass a heading tag (`"h2"`/`"h3"`/`"h4"`) when the label is a real section+ * heading so it stays in the heading outline / screen-reader navigation.+ */+ as?: ElementType;+}++/**+ * Small uppercase label that groups related content into a section.+ *+ * - `heavy` (default): section labels for accounting reports and similar+ * `text-muted-foreground` eyebrow headings.+ * - `light`: group names in the grouped-content sidebar and entity Properties+ * panels.+ *+ * Renders a `span` by default; pass `as="h3"` (etc.) to preserve native heading+ * semantics. Spacing/layout is left to the caller — pass `className` for+ * margins, flex, etc.+ */+const Subheading = forwardRef<HTMLElement, SubheadingProps>(+ ({ as: Component = "span", className, variant, children, ...props }, ref) => {+ return (+ <Component+ className={cn(subheadingVariants({ variant, className }))}+ ref={ref}+ {...props}+ >+ {children}+ </Component>+ );+ }+);+Subheading.displayName = "Subheading";++export { Subheading, subheadingVariants };diff --git a/packages/react/src/Tabs.tsx b/packages/react/src/Tabs.tsxindex a084b53e45..86cbe56ba6 100644--- a/packages/react/src/Tabs.tsx+++ b/packages/react/src/Tabs.tsx@@ -18,7 +18,7 @@ const TabsList = forwardRef<// No fixed height and no border — p-1 sizes the box, so the space// around the triggers is uniform on every side (a fixed h-* squeezed// them, and a border-b read as an extra pixel of bottom padding)- "inline-flex items-center justify-center rounded-[0.5rem] bg-muted p-1 text-muted-foreground shadow-[inset_0_1px_2px_rgba(0,0,0,0.15)] border border-border",+ "inline-flex items-center justify-center rounded-[0.5rem] bg-muted p-1 text-muted-foreground border border-border",className)}{...props}diff --git a/packages/react/src/index.tsx b/packages/react/src/index.tsxindex 5596e610e5..b8189e1776 100644--- a/packages/react/src/index.tsx+++ b/packages/react/src/index.tsx@@ -313,6 +313,8 @@ import { Slider } from "./Slider";import { Spinner } from "./Spinner";import { SplitButton } from "./SplitButton";import { Status } from "./Status";+import type { SubheadingProps } from "./Subheading";+import { Subheading } from "./Subheading";import { Switch } from "./Switch";import { Table, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr } from "./Table";import { Tabs, TabsContent, TabsList, TabsTrigger } from "./Tabs";@@ -596,6 +598,7 @@ export {Spinner,SplitButton,Status,+ Subheading,Switch,Table,TableCaption,@@ -659,6 +662,7 @@ export type {OperatingSystemPlatform,Shortcut,ShortcutDefinition,+ SubheadingProps,TextareaProps,ExpiredEntityPolicy,TrackedEntityOption,