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.
Assembly editor side panels — small UX changes — implementation plan
Spec / source: approved design /Users/aashu/work/carbon/local-docs/assembly-editor-ux-review.html, section "The final version" (changes L1–L5, R1–R7). User approved it ("i liked it lets build this one") and chose glossary terms (LabelWithHelp) for the ⓘ help.
Branch: feat/asembly-view-isolation (worktree /Users/aashu/work/carbon/carbon-feat-asembly-view-isolation). Never commit without the user's permission.
Design rules: /Users/aashu/work/carbon/carbon/.claude/skills/carbon-design/references/ (foundations.md, status-and-feedback.md, forms.md, anti-patterns.md). Quiet chrome, no coloured prose (amber only as an icon), Subheading instead of hand-rolled uppercase labels, status colour by lifecycle position from status-colors.ts, icon-only status in dense rows + tooltip, help via termId → LabelWithHelp, every string in Lingui.
Scope: left panel (Steps list, Components tree) and right panel (Properties header, Details form, BOM tab, Slides). Out of scope for every task: the 3D viewer, AssemblyPlayer, the editor header, the instructions list, any service/route/DB change.
Progress
- Task 1: Glossary terms for the four help icons
- Task 2: Shared assembly-step status colours + status components
- Task 3: Steps list rows (L1, L2, L3)
- Task 4: Components tree rows (L4, L5)
- Task 5: Properties header (R1) + status pill
- Task 6: Details form order, Components + Hidden blocks (R4, part of R3)
- Task 7: One Playback box + compact "Build off to the side" (R2, R3)
- Task 8: Save pinned to the bottom (R5)
- Task 9: BOM tab without the duplicate list (R6)
- Task 10: Slides copy + tooltips (R7)
- Task 11: Lingui extract
- Task 12: End-to-end verification
Dependencies
Task 1 before Task 6/7. Task 2 before Tasks 3 and 5. Tasks 3, 4, 9, 10 are independent of each other. Tasks 6 → 7 → 8 touch the same file (AssemblyInstructionProperties.tsx) — run in order. Task 11 after all code tasks; Task 12 last.
Task 1: Glossary terms for the four help icons
Depends on: none Files:
- Modify:
packages/glossary/src/terms.ts— add four entries. - Copy from (precedent): existing entries in the same file (e.g.
subassembly, ~line 89).
Steps:
- Add these keys to the
termsobject (place them next tosubassembly), one-sentence definitions, nohref:"assembly-step-motion": { term: msg`Motion`, definition: msg`The path this step's components travel into place during playback; worked out from the model, or drawn by hand with Edit Path.` }, "assembly-step-camera": { term: msg`Camera`, definition: msg`The view a step plays from; without a saved view the step frames its own components.` }, "assembly-step-build-aside": { term: msg`Build off to the side`, definition: msg`Builds this step's components beside the model as a group, then carries the group in at a later join step.` }, "assembly-step-hidden-components": { term: msg`Hidden on this step`, definition: msg`Components hidden only while this step plays, such as a fixture in the way; use the eye in the Components tab to hide one.` } - If
terms.test.tsasserts a fixed count or a list of keys, update it to include the four keys (read it first).
Verify:
pnpm --filter @carbon/glossary typecheck && pnpm --filter @carbon/glossary test
# Expected: no type errors; all tests pass
Out of scope: any other glossary entry, docs pages.
Task 2: Shared assembly-step status colours + status components
Depends on: none Files:
- Modify:
packages/utils/src/status-colors.ts— addASSEMBLY_STEP_STATUS_COLOR_MAPand register it. - Create:
apps/erp/app/modules/production/ui/Assemblies/AssemblyStepStatus.tsx - Copy from (precedent):
apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionStatus.tsx(wrapper) andpackages/react/src/Status.tsx(icon per colour).
Steps:
- In
status-colors.ts, next toJOB_OPERATION_STATUS_COLOR_MAP:
and add/* assemblyInstructionStep.status (production.models.ts `assemblyStepStatuses`): * not started → gray, waiting on a reviewer → yellow, finished → green. */ export const ASSEMBLY_STEP_STATUS_COLOR_MAP = { Todo: "gray", Review: "yellow", Done: "green" } as const satisfies Record<string, StatusColor>;assemblyStep: ASSEMBLY_STEP_STATUS_COLOR_MAP,tostatusColorMaps. - Create
AssemblyStepStatus.tsxexporting:assemblyStepStatusesre-used from../../production.models(assemblyStepStatuses = ["Todo","Review","Done"], line ~1209) andtype AssemblyStepStatusValue.normalizeStepStatus(status: string | null | undefined): AssemblyStepStatusValue→ the value if it is in the list, else"Todo".stepStatusLabel(t, status)returning translatedt\Todo`/t`Review`/t`Done`(useuseLingui` inside the components instead if simpler — no raw enum rendering).AssemblyStepStatus({ status })→<Status color={ASSEMBLY_STEP_STATUS_COLOR_MAP[status]}>{label}</Status>(the header pill).AssemblyStepStatusIcon({ status, className })→ the same iconStatususes per colour (grayLuCircleDashed, yellowLuClock, greenLuCircleCheck) with hue classestext-muted-foreground/text-yellow-500/text-emerald-500,aria-hidden.
- Import
ASSEMBLY_STEP_STATUS_COLOR_MAPfrom@carbon/utils(check how other ERP files import status maps:grep -rn "STATUS_COLOR_MAP" apps/erp/app | head; use the same import path).
Verify:
pnpm --filter @carbon/utils test && pnpm --filter @carbon/utils typecheck
# Expected: status-colors tests pass; no type errors
Out of scope: other status maps; Status.tsx.
Task 3: Steps list rows (L1, L2, L3)
Depends on: Task 2 Files:
- Modify:
apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsx—StepStatusDot,StepStatusControl,StepItem(lines ~920–1166). - Copy from (precedent): icon-only status in dense rows per
status-and-feedback.md§2.5;TruncatedTooltipText(packages/react/src/TruncatedTooltipText.tsx); existingLuBoxesicon span inStepItemfor icon + tooltip.
Steps:
- Delete the local
stepStatusStylesmap andStepStatusDot; useAssemblyStepStatusIcon/normalizeStepStatusfrom Task 2. StepStatusControl: trigger becomes an icon-only ghost button (size-6,rounded-md, hoverbg-accent, focus ring as today) showingAssemblyStepStatusIcon(size-4), wrapped inTooltipwith the translated status label.aria-label={t\Step status: ${label}. Change status`}. Dropdown items keep icon + translated label. Disabled: the icon alone inside aTooltip(no chip). Keep the optimisticdisplayed` logic and the submit path unchanged.StepItem:- Render
ProcedureStepTypeIcononly when(step.type ?? "Task") !== "Task". - Replace the title
<span title>with<TruncatedTooltipText tooltip={title} className="min-w-0 flex-1 truncate text-sm text-foreground">{title}</TruncatedTooltipText>(check itsclassNamelands on the truncating span; if not, wrap it in amin-w-0 flex-1span). - Add a flagged icon: compute
flaggedwithstepPlanWarningsSchema.safeParse(step.warnings).data?.flagged === true(import from../../production.models); render<LuTriangleAlert className="size-3.5 text-amber-500" />in aTooltip"No collision-free path" (role="img", translatedaria-label), placed before the×count. - Convert the existing
title=attributes on theLuHandandLuBoxesspans toTooltips with the same (translated) text. - Translate remaining literals in these components ("Delete Step", "More", "Drag handle", "Double-click to play this step", the component-count title) with
t/Trans.
- Render
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionExplorer.tsx
# Expected: no type errors; Biome reports no errors (the 7 existing useExhaustiveDependencies warnings in this file are pre-existing)
Out of scope: reordering, the explorer's toolbar/footer, generate/re-plan flows.
Task 4: Components tree rows (L4, L5)
Depends on: none Files:
- Modify:
apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsx— unit row (1115–1131),1234–1238), group row (UnitChildRow(1609–1614),1657), hover-reveal classes (~1147, 1160, 1632, 1695, 1711).ThisStepBadge(
Steps:
- Unit row: replace the
AutoBadgewithLuSparkles(size-3.5 text-muted-foreground,role="img", translatedaria-label) in aTooltip"Detected by the motion planner". - Replace
ThisStepBadgewithThisStepIcon:LuCircleDotsize-3.5 text-blue-500(blue = the viewer's active-step tint, as the badge comment says) in aTooltip"In this step",role="img", translatedaria-label. - Row counts: in the three tree rows (unit
memberCount,UnitChildRowcount, group rowgroup.count) render the×NBadgeonly when the value is> 1. Leave the popover detail (1450) and the unit editor list (1840) unchanged. - Every
opacity-0 group-hover:opacity-100in these rows also getsgroup-focus-within:opacity-100(keyboard reveal,anti-patterns.md§3). - Translate the literals touched (
Collapse/Expand …,Edit/Delete subassembly …,Component details: …, "Detected by the motion planner").
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies/AssemblyBomTree.tsx
# Expected: no type errors; no Biome errors
Out of scope: tree data, selection, hide logic, mapping popover content.
Task 5: Properties header (R1) + status pill
Depends on: Task 2 Files:
- Modify:
apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx— header block (164–199), delete296–319), movestepStatusStyles/normalizeStatus/StepStatusPill(planFlagcomputation (~429–438) into a shared helper.
Steps:
- Add a module-level helper
getPlanFlag(warnings: unknown, graphIndex: AssemblyGraphIndex | null): { blockers: string[] } | nullwith the exact body of today'splanFlagmemo; use it in both the header (memoised) andStepForm. - Header:
StepStatusPill→<AssemblyStepStatus status={normalizeStepStatus(step.status)} />. "Step N of M" and "components" via Lingui (<Plural>for the component count). - Flag line:
<span className="inline-flex items-center gap-1 text-muted-foreground"><LuTriangleAlert className="size-3 text-amber-500" />{t\No clear path`}, wrapped in aTooltipwhose content ist`Blocked by ${blockers.join(", ")}`whenblockers.length > 0` (no tooltip otherwise). No amber text. - Translate the header/empty-state literals ("Step", "Untitled step", "No step selected", the pick-a-step sentence, tab labels "Details"/"BOM"/"Slides").
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx
# Expected: no type errors; no Biome errors
Out of scope: tabs structure, StepForm body (Tasks 6–8).
Task 6: Details form order, Components + Hidden blocks (R4, part of R3)
Depends on: Tasks 1, 5 Files:
- Modify:
AssemblyInstructionProperties.tsx—StepFormJSX order (466–646),659–776),StepComponentsEditor(StepHiddenComponentsEditor(~779–886). - Copy from (precedent):
Subheadingusage already at line ~529;LabelWithHelpfrom@carbon/react(packages/react/src/LabelWithHelp.tsx).
Steps:
StepFormorder becomes: Type, Title, Instruction, [Measurement / List fields], Required, Components (StepComponentsEditor), Hidden on this step (StepHiddenComponentsEditor), Playback (Task 7), Save (Task 8). Remove the "Playback & components"Subheading.- Required:
description={t\Operator must record this step`},label={t`Required`}`. Translate the Type/Title/Instruction/Unit of Measure/Minimum/Maximum/List Options labels. Keep the "Optional" tags (automatic). StepComponentsEditor: drop the borderedbg-muted/40wrapper box; heading row =<Subheading variant="heavy">{t\Components`} · {count}(count = number of node ids, tabular-nums) + the existing Add/Done button (labelst`Add`/t`Done Adding`). Keep the adding-mode hint but shorten it tot`Click components in the viewer to add them. Shift-click adds several.`. Empty state:t`No components yet`. List rows:×Nbadge only whengroup.count > 1`; translate the remove aria-label.StepHiddenComponentsEditor: drop the wrapper box; heading row =<Subheading variant="heavy"><LabelWithHelp termId="assembly-step-hidden-components" variant="inline">{t\Hidden on this step`}+ (when nothing hidden) a mutedt`None`on the right, else the existing Show all / Hide again buttons. Remove the "Nothing hidden. Use the eye…" paragraph (the glossary help now carries it). List rows:×Nonly when> 1`.- Remove the three hand-rolled
Label className="text-xxs font-medium uppercase tracking-wide …"usages in these blocks.
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx
# Expected: no type errors; no Biome errors
Out of scope: add/remove/hide behaviour and their fetchers.
Task 7: One Playback box + compact "Build off to the side" (R2, R3)
Depends on: Tasks 1, 6 Files:
- Modify:
AssemblyInstructionProperties.tsx— replace the Motion and Camera boxes (~533–613) with one Playback block. - Modify:
apps/erp/app/modules/production/ui/Assemblies/AssemblyStepJoin.tsx— render as a row (no box, no uppercase label, no paragraph).
Steps:
- Playback block:
<Subheading variant="heavy">{t\Playback`}followed bywith three rows, eachflex items-center justify-between gap-2 px-3 py-2`:- Motion — left:
<LabelWithHelp termId="assembly-step-motion" variant="inline">label (text-xs font-medium text-muted-foreground) and under it a value line (text-sm):planFlag→ amberLuTriangleAlerticon +t\No clear path`;isEditingMotion→t`Drag the red waypoints in the viewer`; no components →t`Add components first`; otherwiset`Automatic`. Right: the existing Edit Path / Done Editing Path button (labels translated, same disabled rule, hidden whenisDisabled`). - Camera — label with
termId="assembly-step-camera"; valuehasCamera ? t\Saved view` : t`Automatic`; right:Button variant="secondary" size="sm"t`Use Current View`(sameonSetCamera) and, whenhasCamera, ghostt`Clear`(sameonClearCamera); hidden whenisDisabled`. - Build off to the side —
<AssemblyStepJoin … />. Delete the old helper paragraphs ("Edit the path to adjust…", "A saved view frames…", "This step auto-frames…", the long flagged sentence, the waypoint instructions).
- Motion — left:
AssemblyStepJoin.tsx: return a row fragment matching the rows above — left<LabelWithHelp termId="assembly-step-build-aside" variant="inline">{t\Build off to the side`}`; right the control:- trigger label
selected ? t\Joins step ${selected.number}` : t`No`; dropdown itemst`No, build in place`andt`Joins step ${number}: ${title}`` (full title stays in the menu); locked === "base"→ muted textt\No, it's the base`;locked === "join"→t`Brings in steps`+ the existing step-number link buttons;isDisabled→ the label text. Remove the wrapperVStackbox, the uppercaseLabel, and the helper. KeepjoinTargets, the fetcher submit and the optimistic value exactly as they are. Trigger stays compact (h-6,text-xs, border,max-w-[10rem] truncate`).
- trigger label
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies/AssemblyInstructionProperties.tsx apps/erp/app/modules/production/ui/Assemblies/AssemblyStepJoin.tsx
# Expected: no type errors; no Biome errors
Out of scope: motion editing, camera capture, joinTargets, the join route/service.
Task 8: Save pinned to the bottom (R5)
Depends on: Task 7 Files:
- Modify:
AssemblyInstructionProperties.tsx— theSubmitat the end ofStepForm.
Steps:
- Wrap
Submitin<div className="sticky bottom-0 z-10 -mx-4 w-[calc(100%+2rem)] border-t border-border bg-background/95 px-4 py-3 backdrop-blur">(mirrors the sticky header's surface at line ~166; the panelVStackis the scroll container, andpx-4comes from theTabswrapper). - Label
<Trans>Save</Trans>(the ⌘↵ shortcut is Submit's default). KeepisDisabled/isLoadingas they are. - If the sticky bar doesn't stick because an ancestor between it and the panel has
overflowset, STOP and report — do not restructure the panel.
Verify:
pnpm --filter erp typecheck
# Expected: no type errors
Out of scope: save behaviour, validators, the step route.
Task 9: BOM tab without the duplicate list (R6)
Depends on: none (touches AssemblyInstructionProperties.tsx — if Tasks 5–8 are in flight, run after Task 8)
Files:
- Modify:
AssemblyInstructionProperties.tsx— remove<AssemblyStepBom …/>from the BOM tab (~259–264) and change the import toimport { ComponentColorSwatch } from "./AssemblyStepBom";. - Modify:
AssemblyStepBom.tsx— delete the now-unused default-export component (keepComponentColorSwatch, used byAssemblyBomTree.tsx).
Steps: as above; confirm with grep -rn "AssemblyStepBom" apps/erp/app that nothing else imports the default export.
Verify:
pnpm --filter erp typecheck
# Expected: no type errors
Out of scope: AssemblyStepMaterials, AssemblyStepTools, the Empty component.
Task 10: Slides copy + tooltips (R7)
Depends on: none Files:
- Modify:
apps/erp/app/components/SlidesEditor.tsx— "No slides" (236), Add slide / Add model buttons (210–231). Shared with the BOP step editor; the copy works for both.
Steps:
No slides→<Trans>No slides yet</Trans>.- Button labels
<Trans>Add Slide</Trans>/<Trans>Add Model</Trans>(Title Case percontent-and-copy.md); wrap each in aTooltip(@carbon/react):t\A photo or PDF the operator sees on this step`andt`A 3D model the operator can turn around``.
Verify:
pnpm --filter erp typecheck && pnpm exec biome check apps/erp/app/components/SlidesEditor.tsx
# Expected: no type errors; no Biome errors
Out of scope: upload, annotation and caption logic.
Task 11: Lingui extract
Depends on: Tasks 1–10 Steps:
pnpm run lingui:extractthenpnpm run lingui:clean.git diff --stat packages/locale/locales— onlyerp.po/mes.pocatalogs should change. New non-English entries stay empty (no translate run).
Verify:
git diff --stat packages/locale/locales | tail -1
# Expected: only files under packages/locale/locales/*/ changed
Task 12: End-to-end verification
Depends on: Task 11 Steps:
pnpm --filter erp typecheck,pnpm --filter @carbon/utils test,pnpm --filter @carbon/glossary test,pnpm exec biome check apps/erp/app/modules/production/ui/Assemblies apps/erp/app/components/SlidesEditor.tsx packages/utils/src/status-colors.ts packages/glossary/src/terms.ts.- Browser (agent-browser,
DEV_BYPASS_EMAIL[email protected],https://erp.asembly-view-isolation.dev/x/assembly/GkCD68SBwhaY5fEY-7two), screenshot and confirm:- rows show full titles ("Add 32006JR Roller"), no Task icon, a status icon with tooltip, Todo gray; step 3 shows the amber warning icon;
- Components tab: "Main Frame" unit row readable, sparkle + dot icons with tooltips, no ×1 badges;
- right panel: status pill, "No clear path" grey with tooltip on step 3; order Type/Title/Instruction/Required/Components/Hidden/Playback; ⓘ opens the glossary card; Save visible without scrolling;
- status change, Add components, Edit path, Use current view and Build off to the side still work (then restore any change made).
- Update
apps/erp/app/modules/production/AGENTS.mdonly if a documented name changed (none expected).
Verify: all commands exit 0; screenshots match the checklist above.