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.
Shared Nav Rail (ERP + MES) — implementation plan
Spec / source: .ai/specs/2026-09-29-shared-nav-rail.md (approved 2026-09-29)
Research: .ai/research/shared-sidebar.md
Branch: feat/shared-sidebar (worktree /Users/aashu/work/carbon/carbon-feat-shared-sidebar)
Progress
- Task 1: Create
NavRailcomponents in@carbon/react(+ tests, barrel export) — deviation: pure helpers live inpackages/react/src/utils/navRail.tsand the test covers only them (importingNavRail.tsxunder vitest pulls the hooks barrel →@carbon/env, which throws without server env; the markup render test was dropped) - Task 2: Mount
SidebarProviderin the ERP layout - Task 3: Rebuild ERP
PrimaryNavigationonNavRail - Task 4: Replace ERP mobile drawer with the shared rail drawer
- Task 5: Move MES tool buttons to
NavRailButton - Task 6: Rebuild MES
AppSidebaronNavRail - Task 7: Extract Lingui strings
- Task 8: Sync docs (AGENTS.md, carbon-design references)
- Task 9: End-to-end verification in the browser (ERP + MES) — PARTIAL: ERP collapsed 56px / hover 208px / leave 56px / ⌘B pin+unpin verified; OrbStack (Docker) quit mid-run, rest blocked. A "Maximum update depth exceeded" client warning appeared in the ERP log right after a
g,sgo-to — cause not yet determined
Deviations
Task 2: no inner
TooltipProvider—TooltipProvideralready defaults to delay 0 (packages/react/src/Tooltip.tsx:29), so nesting changes nothing.Task 3: ⌘K binding +
SearchModalmoved to aGlobalSearchsibling outsideNavRail(on phones the rail is a drawer that unmounts when closed). Escape uses a new named constantnavigationEditCancelShortcutinapps/erp/app/shortcuts.ts.Task 5:
closeOnClickNOT set on AdjustInventory / EndShift — their modals live inside the drawer and would unmount with it (old MES did not close the drawer for these either).Task 6: MES rail gets
className="sticky top-0 h-svh"— below lg the MES page scrolls as a whole and the old sidebar wasfixed.Thermo-nuclear review fixes (all blockers + should-fixes applied):
NavRailContext,NavRailButton,closeOnClick,data-collapsible,utils/navRail.ts+ its test are gone; oneNavRailItem(button /asChild) + thinNavRailLink; drawer closes on pathname change insideNavRail; rail ownssticky top-0 h-svh; MES queues + ⌥ shortcuts come from oneQUEUESlist;UserNavmoved toapps/mes/app/components/UserNav.tsx; the 2pxgroup-has-[[data-collapsible=icon]]header variant removed from 10 MES headers.
Dependencies
- Task 1 must be done before everything else.
- Tasks 2 → 3 → 4 run in order (ERP).
- Tasks 5 → 6 run in order (MES).
- The ERP chain (2–4) and the MES chain (5–6) are independent of each other.
- Task 7 needs Tasks 3–6.
- Task 8 needs Tasks 3 and 6.
- Task 9 needs all the others.
Stop-points
The user asked for check-ins between big steps. Stop and report after Task 1, after Task 4 (ERP done) and after Task 6 (MES done).
Conventions (all tasks)
- Use
cn(). Scope transitions to specific properties; never usetransition-all. - Every user-facing string goes through Lingui (
Trans/tfrom@lingui/react/macro). - Shortcut combos must be named constants. Never hand-roll
document.addEventListener("keydown"). - Never import from deep
@carbon/react/src/...paths. - Never name customers or sources in code or comments.
Task 1: Create NavRail components in @carbon/react
Depends on: none
Files:
- Create:
packages/react/src/NavRail.tsx - Create:
packages/react/src/__tests__/NavRail.test.tsx - Modify:
packages/react/src/index.tsx. Add the NavRail exports next to the existing./Sidebarimport/export blocks (~:292-316 and ~:591-662). - Precedents to copy from:
- Markup and classes:
apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx(wrapper :118-125, nav :126-139,NavigationIconLink:333-381, search button :273-311). - Context:
packages/react/src/Sidebar.tsx(useSidebar, :33-53). - Test style:
packages/react/src/__tests__/Number.test.tsx(renderToStaticMarkup, node env).
- Markup and classes:
Steps:
In
NavRail.tsx, export the pure helpers first, so they can be tested without a DOM:export function isNavRailExpanded(s: { forceExpanded?: boolean; pinned: boolean; hovered: boolean }) { return Boolean(s.forceExpanded || s.pinned || s.hovered); } // Taps must not hover-expand the rail on touch tablets. export function shouldHoverExpand(pointerType: string) { return pointerType === "mouse"; }Export
navRailItemClasses: the shared base class list for the item geometry. Copy it verbatim fromNavigationIconLink'sclasses, without the active/inactive lines:relative text-foreground/70 hover:text-foreground,h-10 w-10 group-data-[state=expanded]:w-full,flex items-center rounded-md,group-data-[state=collapsed]:justify-center,group-data-[state=expanded]:-space-x-2,font-medium shrink-0 inline-flex items-center justify-center select-none,disabled:opacity-50,transition-[background-color,color,width] duration-100 ease-out,focus:!outline-none focus:!ring-0 active:!outline-none active:!ring-0, theafter:focus-ring string, andgroup/item.Export
navRailItemStateClasses(isActive: boolean), which returns:- active:
bg-active text-active-foreground dark:shadow-button-base - inactive:
hover:bg-active/60 hover:text-active-foreground
- active:
Internal pieces:
NavRailIcon({children}):<span className="absolute left-2 top-2 flex size-6 items-center justify-center [&>svg]:size-4">. A 16px icon centred in this 24px box sits exactly where the ERP'sleft-3 top-3icon sits, and the box also fits anAvatar size="xs".NavRailLabel({children}): copy the ERP label span (min-w-[128px] text-sm text-left absolute left-7 group-data-[state=expanded]:left-12 opacity-0 group-data-[state=expanded]:opacity-100) witharia-hiddenset only when collapsed. Read the state fromNavRailContext(step 4).NavRailTag({children}): copy the ERP pill (absolute top-1 right-1 min-w-4 h-4 px-1 rounded-full bg-primary text-primary-foreground text-[10px] font-medium leading-4 text-center tabular-nums).trailingslot: copy the ERP ⌘K hint wrapper classes (pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-100 group-data-[state=expanded]:opacity-100).
Create
NavRailContext = createContext<{ expanded: boolean; inDrawer: boolean }>({ expanded: false, inDrawer: false }).NavRailprops:{ children: ReactNode; footer?: ReactNode; className?: string; forceExpanded?: boolean; disableHover?: boolean; drawerTitle?: ReactNode }.Body:
const { open, isMobile, openMobile, setOpenMobile } = useSidebar();const [hovered, setHovered] = useState(false);- When
disableHoverbecomes true,setHovered(false). - When it goes from true back to false, run
requestAnimationFrame(() => setHovered(false))and cancel it in cleanup. This moves in the ERP's phantom-mouseenterfix fromPrimaryNavigation.tsx:82-96; keep its comment. expanded = isNavRailExpanded({ forceExpanded, pinned: open, hovered }).- The inner content is a
VStack spacing={1} className="flex flex-col justify-between h-full px-2"holding twoVStack spacing={1}:childrenon top,footerat the bottom (same as the ERP :144-145). - Mobile (
isMobile): render<Drawer open={openMobile} onOpenChange={setOpenMobile}>→<DrawerContent position="left" size="content" className="w-[17rem] max-w-[85vw] p-0">→<DrawerTitle className="px-6 py-4">{drawerTitle ?? <Trans>Navigation</Trans>}</DrawerTitle>→<nav data-state="expanded" className="group flex-1 overflow-y-auto py-2">. The inner content uses context{expanded: true, inDrawer: true}. Copy the Drawer usage fromapps/erp/app/components/Layout/Navigation/MobileNavigation.tsx:56-72. - Desktop: copy the ERP wrapper and nav exactly.
- Wrapper:
h-full flex-col z-50 hidden md:flex shrink-0 w-14 data-[state=expanded]:w-[13rem] transition-[width] duration-200, withdata-stateanddata-collapsible={open ? undefined : "icon"}. MES page headers readgroup-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12; the attribute follows the pinned state, not hover, so headers do not jump on hover. - Nav:
bg-background py-2 group z-10 h-full w-full flex flex-col justify-between hide-scrollbar overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent, withdata-state. - Handlers:
onPointerEnter={(e) => !disableHover && shouldHoverExpand(e.pointerType) && setHovered(true)}andonPointerLeave={(e) => shouldHoverExpand(e.pointerType) && setHovered(false)}. - Context:
{expanded, inDrawer: false}.
- Wrapper:
NavRailLink: aforwardRef<HTMLAnchorElement>.Props:
{ to: string; icon: ReactNode; label: ReactNode; isActive?: boolean; tag?: ReactNode; external?: boolean; onClick?: MouseEventHandler<HTMLAnchorElement>; className?: string } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children">.Render the react-router
<Link>with:role="button",aria-current={isActive ? "page" : undefined}aria-label={typeof label === "string" ? label : undefined}to,prefetch={external ? "none" : "intent"}- classes
cn(navRailItemClasses, navRailItemStateClasses(isActive), className)
Children:
NavRailIcon,NavRailTag(whentag),NavRailLabel.onClick: call the prop, then callsetOpenMobile(false)whenisMobile.NavRailButton: aforwardRef<HTMLButtonElement>.Props:
{ icon: ReactNode; label: ReactNode; isActive?: boolean; tag?: ReactNode; trailing?: ReactNode } & ButtonHTMLAttributes<HTMLButtonElement>.- Render
<button type="button" aria-label={typeof label === "string" ? label : undefined} {...rest}>with the same classes. - Spread
...restbeforeclassNameandonClickhandling, so that when Radix passesonClickanddata-statethroughasChildtriggers, they are kept. - On mobile, close the drawer after
onClickonly whencloseOnClick(defaultfalse) is set. MES Time Card uses it; Popover/Dropdown triggers must not close the drawer.
- Render
NavRailDivider:<Separator className="my-1 mx-auto w-6 group-data-[state=expanded]:w-full transition-[width] duration-200" />. ReuseSeparatorfrom./Separator.In
index.tsx, import and exportNavRail,NavRailButton,NavRailDivider,NavRailLink,navRailItemClasses,navRailItemStateClasses,isNavRailExpandedandshouldHoverExpand.Write the test
NavRail.test.tsx:isNavRailExpanded: covers all combinations (forceExpanded wins; pinned or hovered expand; none collapses).shouldHoverExpand:"mouse"→ true,"touch"and"pen"→ false.- Render
<MemoryRouter><SidebarProvider defaultOpen={false}><NavRailLink to="/x/sales" icon={<svg/>} label="Sales" isActive tag="3" /></SidebarProvider></MemoryRouter>withrenderToStaticMarkup. Expect the output to containaria-current="page",bg-active,>3<andaria-label="Sales".
If
SidebarProvider/useIsMobilethrows under the node test environment, STOP and report. Do not add jsdom.
Verify:
pnpm --filter @carbon/react test -- NavRail
# Expected: NavRail.test.tsx passes, 0 failed
pnpm --filter @carbon/react typecheck
# Expected: exits 0, no errors
pnpm exec biome check packages/react/src/NavRail.tsx packages/react/src/__tests__/NavRail.test.tsx packages/react/src/index.tsx
# Expected: "Checked 3 files" with no errors
Out of scope: changing Sidebar.tsx primitives or SidebarProvider's API; apps/starter.
Task 2: Mount SidebarProvider in the ERP layout
Depends on: Task 1
Files:
- Modify:
apps/erp/app/routes/x+/_layout.tsx(~:495-503) - Precedent:
apps/mes/app/routes/x+/_layout.tsx:503-504
Steps:
Replace
<div className="flex h-screen">…</div>(which wraps<PrimaryNavigation />and the content panel) with:<SidebarProvider defaultOpen={false} className="h-screen min-h-0"> {/* SidebarProvider sets a 0ms tooltip delay; restore ERP's default for everything inside. */} <TooltipProvider> <PrimaryNavigation /> <div className="…unchanged content panel classes…">…</div> </TooltipProvider> </SidebarProvider>Import
SidebarProviderfrom@carbon/react.TooltipProviderrenders no DOM, so the flex row is unchanged.Do not add the content inset to the rail (
.ai/lessons.md~1470-1490).
Verify:
pnpm --filter erp typecheck
# Expected: exits 0
Manual check in Task 9: the ERP shell looks identical, and ⌘B toggles the rail.
Out of scope: TrainingPanel, AgentRoot, ShortcutHelp, TimeCardWarning placement.
Task 3: Rebuild ERP PrimaryNavigation on NavRail
Depends on: Task 2
Files:
- Modify:
apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx - Modify:
apps/erp/app/components/Layout/Navigation/SortableNavItem.tsx. Replace its duplicated geometry classes withnavRailItemClassesplus its drag-specific extras.
Steps:
Keep all of the existing logic: modules, settings, implementation nav,
matchedModules,goToModules/useShortcutSequence,editMode,sensors,getModule(still exported and used byMobileNavigation).Remove:
useDisclosure- The wrapper
<div>and<nav> - The hover handlers
- The rAF effect (it now lives inside
NavRail) NavigationIconLink
Return:
<NavRail forceExpanded={editMode.isEditing} disableHover={editMode.isEditing || isSearchModalOpen} footer={…settings NavRailLink (not editing) + NavigationEditBar or Customize NavRailButton…} > {permissions.is("employee") && <NavigationSearchButton />} {!editMode.isEditing && implementationNav ? <NavRailLink … /> : null} {editMode.isEditing ? <DndContext…>…SortableNavItem…</DndContext> : links.map(link => <NavRailLink key={link.name} to={link.to} icon={<link.icon />} label={link.name} tag={link.tag} external={link.external} isActive={…same calc…} />)} {editMode.isEditing && <HiddenModulesPopover … />} </NavRail>Customize button:
<NavRailButton icon={<LuSettings2 />} label={t\Customize`} onClick={editMode.enterEditMode} className="hover:bg-accent hover:text-accent-foreground" />. The ERP's Customize and Search hover usedbg-accent, notbg-active/60`; keep that.Customize is hidden on mobile, as it is today. Wrap it in
useSidebar().isMobile ? null : ….NavigationSearchButton: keepuseShortcutKeys(searchShortcut)and<SearchModal />, and render:<NavRailButton icon={<LuSearch />} label={t`Search`} onClick={openSearchModal} className="hover:bg-accent hover:text-accent-foreground" trailing={<ShortcutKey shortcut={searchShortcut} variant="small" className="mx-0" />} />On mobile, close the drawer before
openSearchModal. The oldMobileNavigationdiddisclosure.onClose(); openSearchModal(), so usecloseOnClick.Escape during edit mode: replace the hand-rolled
document.addEventListenereffect (:103-110) withuseShortcutKeys({ shortcut: SHORTCUTS.escape ?? "escape", action: editMode.cancelEditMode, disabled: !editMode.isEditing }).First check
packages/react/src/shortcuts.tsandpackages/react/src/hooks/useShortcutKeys.tsfor the exact escape constant name and thedisabledoption. If neither an escape constant nor a disable option exists, STOP and report. Do not add a new listener.SortableNavItem: importnavRailItemClassesand usecn(navRailItemClasses, "hover:bg-accent hover:text-accent-foreground border border-transparent", isDragging && "opacity-50 border-primary"). Keep its customleft-8/left-12icon and label offsets (drag handle). Removetext-foreground/70viacnoverride only if the visual differs. Compare in Task 9.
Verify:
pnpm --filter erp typecheck
# Expected: exits 0
pnpm exec biome check apps/erp/app/components/Layout/Navigation/
# Expected: no errors
grep -n "addEventListener\|NavigationIconLink\|onMouseEnter" apps/erp/app/components/Layout/Navigation/PrimaryNavigation.tsx
# Expected: no output
Out of scope: useModules, useNavigationEditMode, HiddenModulesPopover (its untranslated "Add module" is a separate fix), CollapsibleSidebar.
Task 4: Replace ERP mobile drawer with the shared rail drawer
Depends on: Task 3
Files:
- Modify:
apps/erp/app/components/Layout/Navigation/MobileNavigation.tsx. Reduce it to a trigger. - Precedent:
packages/react/src/Sidebar.tsx:279-300(SidebarTriggercallingtoggleSidebar).
Steps:
Replace the whole component body with:
const { t } = useLingui(); const { toggleSidebar } = useSidebar(); return <IconButton aria-label={t`Open navigation`} icon={<LuMenu />} variant="ghost" onClick={toggleSidebar} />;On mobile,
toggleSidebarflipsopenMobile, whichNavRailrenders as the drawer holding the same items as the desktop rail.Delete
NavRow, the drawer imports and the unused hooks. Update the doc comment: the drawer is now rendered by the sharedNavRail, and this is only its trigger.Topbar.tsx:28needs no change; it still renders<MobileNavigation />.
Verify:
pnpm --filter erp typecheck
# Expected: exits 0
pnpm exec biome check apps/erp/app/components/Layout/
# Expected: no errors
🛑 Stop-point: report to the user that the ERP side is done and ask before starting MES.
Out of scope: the Topbar "Sections" content sub-nav (useUIStore.toggleSidebar, a different sidebar).
Task 5: Move MES tool buttons to NavRailButton
Depends on: Task 1
Files:
- Modify:
apps/mes/app/components/AdjustInventory.tsx(:113-121) - Modify:
apps/mes/app/components/EndShift.tsx(:71-76) - Modify:
apps/mes/app/components/Suggestion.tsx(:141-146) - Modify:
apps/mes/app/components/TimeCardButton.tsx(allSidebarMenuItem/SidebarMenuButtonusages) - Precedent: the ERP Customize button from Task 3
Steps:
AdjustInventory:
<NavRailButton icon={add ? <LuGitPullRequestCreateArrow /> : <LuGitBranchPlus />} label={add ? t\Add Inventory` : t`Remove Inventory`} onClick={modal.onOpen} closeOnClick />`.EndShift:
<NavRailButton icon={<LuCircleStop />} label={t\End Operations`} onClick={openModal} closeOnClick />`.Suggestion:
<PopoverTrigger ref={popoverTriggerRef} asChild><NavRailButton icon={<LuMailbox />} label={t\Suggestion`} />. NocloseOnClick`, because the popover anchors to the button.TimeCardButton:
- Remove
SidebarMenuItemwrappers and return a fragment of rail items. - Clock In:
NavRailButton icon={<LuPlay />} label={t\Clock In`} onClick={handleClockIn} disabled={fetcher.state !== "idle"} closeOnClick`. - Clock Out: same with
LuSquare,trailing={openClockEntry && <Badge variant="red">{formatElapsed(openClockEntry.clockIn)}</Badge>}. - My Hours:
NavRailLink to={path.to.timeCardPage} icon={<LuClock />} label={t\My Hours`} isActive={isOnTimeCardPage}`. - Drop the manual
isMobile && setOpenMobile(false)calls, sinceNavRailLinkandcloseOnClickhandle them. - Read the entire file first. If it holds rows beyond Clock In, Clock Out and My Hours, convert each the same way.
- Remove
Remove the now-unused
SidebarMenuButton,SidebarMenuItemanduseSidebarimports.
Verify:
pnpm exec biome check apps/mes/app/components/AdjustInventory.tsx apps/mes/app/components/EndShift.tsx apps/mes/app/components/Suggestion.tsx apps/mes/app/components/TimeCardButton.tsx
# Expected: no errors
MES typecheck runs in Task 6, because AppSidebar still wraps these in SidebarMenuItem until then.
Out of scope: the modal and popover contents of these components.
Task 6: Rebuild MES AppSidebar on NavRail
Depends on: Task 5
Files:
- Modify:
apps/mes/app/components/AppSidebar.tsx - Modify:
apps/mes/app/routes/x+/_layout.tsx(:503). Change<SidebarProvider defaultOpen={false} touch>to<SidebarProvider defaultOpen={false}>. - Precedent: the ERP
PrimaryNavigationfrom Task 3
Steps:
Change the
AppSidebarprops type fromComponentProps<typeof Sidebar> & {…}to just the explicit{…}data props. Render:<NavRail footer={<>{timeCardEnabled && <Suspense…><Await…><TimeCardButton…/></Await></Suspense>}<UserNav …/></>}> <OperationsNav activeEvents={activeEvents} activeMaintenanceCount={activeMaintenanceCount} /> <NavRailDivider /> <ToolsNav /> </NavRail>Keep the existing
Suspense/Awaitblock as-is.Delete
TeamSwitcher. Grep for other importers first:grep -rn "TeamSwitcher" apps/mes/app. If anything else imports it, STOP and report.OperationsNav:- Keep the shortcut map and
go(). - Build
linkswith{ key, title, icon, to, count? }, and addmatch: path.to.operations.split("?")[0]for Schedule (other items:match = to). isActive = pathname.startsWith(item.match). This removes theitem.title === "Schedule"check, which was the translated-title bug.- Render
<NavRailLink key={item.key} to={item.to} icon={<item.icon />} label={item.title} isActive={isActive} tag={item.count ? String(item.count) : undefined} />. - No
SidebarGroup/SidebarGroupLabel, and no emerald class.
- Keep the shortcut map and
ToolsNav: return a fragment with<AdjustInventory add />,<AdjustInventory add={false} />,<EndShift />,<Suggestion />,<DisplaysLink />.DisplaysLinkbecomes<NavRailLink to={path.to.displays} icon={<LuMonitorPlay />} label={t\Displays`} external target="_blank" rel="noreferrer" />. Check thatNavRailLinkpassestarget/relthrough...rest`.UserNav:- Keep all dropdown content unchanged.
- Replace the trigger with
<DropdownMenuTrigger asChild><NavRailButton icon={<Avatar size="xs" src={displayAvatar ?? undefined} name={displayName} />} label={displayName} trailing={<LuChevronDown className="size-4" />} /></DropdownMenuTrigger>. - Change
side={isMobile ? "bottom" : "right"}to keep usinguseSidebar().isMobile. - Replace the trigger-width class on
DropdownMenuContentwithmin-w-56 rounded-lg; the rail is only 56px when collapsed. - Replace the outer
SidebarMenu/SidebarMenuItemwrappers with a fragment. Keep<ItarDisclosure>.
Remove unused imports (
Sidebar*,BsFillHexagonFill,ERP_URLif now unused,cnif unused).SidebarTriggerin the MES page headers needs no change: it callstoggleSidebar, which pins the rail on desktop and opens the drawer on mobile.
Verify:
pnpm --filter mes typecheck
# Expected: exits 0
pnpm exec biome check apps/mes/app/components/ apps/mes/app/routes/x+/_layout.tsx
# Expected: no errors
grep -n "SidebarMenuButton\|SidebarGroup\|TeamSwitcher\|=== \"Schedule\"" apps/mes/app/components/AppSidebar.tsx
# Expected: no output
🛑 Stop-point: report to the user that the MES side is done and ask before continuing.
Out of scope: MES page headers, MES_NAV_SHORTCUTS, the display+ layout, and apps/mes/app/styles/tailwind.css --sidebar-width.
Task 7: Extract Lingui strings
Depends on: Tasks 3–6
Files:
- Modify (generated):
packages/locale/locales/*/*.po
Steps:
- Run the extract.
- Confirm the new and moved msgids exist in both the erp and mes catalogs: "Navigation", "Customize", "Search", "Displays" and "My Hours".
- Leave filling non-English msgstrs to the
/translateskill, which runs at commit time (check-and-commit). Do not hand-write translations.
Verify:
pnpm run lingui:extract
# Expected: completes; the summary table lists erp and mes with 0 errors
grep -c 'msgid "Navigation"' packages/locale/locales/en/mes.po
# Expected: 1 (if the catalog file names differ, `ls packages/locale/locales/en/` and use the mes catalog)
Out of scope: changing lingui.config.js.
Task 8: Sync docs
Depends on: Tasks 3, 6
Files:
- Modify:
packages/react/AGENTS.md. Add a one-line entry: app shells useNavRail*for the primary left nav; theSidebar*primitives remain for other layouts. - Modify:
.claude/skills/carbon-design/references/page-archetypes.md:- §1: the rail is the shared
NavRail, used by ERP and MES. - §14: below md the rail's own drawer opens from the Topbar hamburger (ERP) or the page-header trigger (MES).
- §1: the rail is the shared
- Modify:
.claude/skills/carbon-design/references/shop-floor-mes.md:- The ERP/MES nav row now says both use
NavRail. - The exemplar points to
apps/mes/app/components/AppSidebar.tsxonNavRail. - The no-hover rule becomes "hover-expand is mouse-only; touch uses the pin toggle (header trigger / ⌘B)".
- The ERP/MES nav row now says both use
Steps:
- Before editing,
grep -rn "PrimaryNavigation\|AppSidebar" .claude/ packages/react/AGENTS.md apps/*/AGENTS.mdand update every hit that describes the old behaviour. - Keep the edits to the minimum wording change.
Verify:
grep -rn "NavRail" packages/react/AGENTS.md .claude/skills/carbon-design/references/page-archetypes.md .claude/skills/carbon-design/references/shop-floor-mes.md
# Expected: at least one hit in each of the three files
Out of scope: the docs site (docs/).
Task 9: End-to-end verification in the browser
Depends on: Tasks 1–8
Files: none (evidence goes to .ai/scratch/e2e/, which is gitignored)
Steps:
- Boot the stack from the worktree:
crbn up(both ERP and MES). - Log in with the
/authskill. - Walk each acceptance criterion in the spec using
agent-browser, and take a screenshot for each:- ERP desktop:
- Rail at 56px, 208px on hover.
- Active module highlighted.
- Get Started pill.
- Customize → drag → Save persists after reload.
- ⌘K opens search.
gsgoes to Sales.- ⌘B pins and unpins the rail.
- MES desktop:
- Same widths and hover.
- Active highlights on
/x/active. - Schedule highlights on
/x/operationsafter switching locale to Spanish via the ERP avatar menu → Language. - Pill counts; no pill at 0.
- Header toggle and ⌘B pin the rail.
- Alt+1 goes to Schedule.
- MES footer:
- Clock In, then Clock Out.
- Avatar menu: company, location, dark mode, console mode, sign out.
- MES tools: each modal or popover opens; Displays opens a new tab.
- Phone width:
agent-browser set viewport 390 844in both apps. The trigger opens the drawer, and clicking a link closes it. - Touch:
agent-browser set device "iPad"(or the closest available). Tapping a MES item navigates without the rail expanding first.
- ERP desktop:
- On any error screen, use the
/errorskill and fix the cause before continuing.
Verify:
pnpm exec turbo run typecheck --filter=@carbon/react --filter=erp --filter=mes
# Expected: 3 successful tasks, 0 failed
pnpm --filter @carbon/react test
# Expected: all tests pass
Every acceptance-criteria box in the spec is ticked, each with a screenshot path.
Out of scope: committing. The user commits only on explicit request (check-and-commit).