Web UI: BOM merge resolution view #47
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add merge resolution UI to the BOM tab in the web app. After an assembly BOM merge (#45), the BOM page should clearly distinguish assembly-sourced entries from manual ones, show unreferenced warnings, and let users explicitly remove or keep unreferenced items.
Requirements
1. Source badge on BOM entries
Each BOM entry row should display a small badge indicating its source:
assembly— synced from FreeCAD assembly via BOM mergemanual— added via web UI, CSV import, or APIThe
sourcefield is returned in the existingBOMEntryResponse(after #44).2. Unreferenced item warnings
When a BOM merge leaves unreferenced assembly-sourced entries (items previously synced from the assembly that are no longer present), the BOM tab should:
manual)3. Detecting unreferenced items
An entry is "unreferenced" if it has
source = 'assembly'and was included in thediff.removedarray from the last merge. Two approaches:Option A (simple): The frontend checks the merge response warnings when it arrives via SSE, and marks those part numbers in its local state. This is ephemeral — reloading the page clears the warnings.
Option B (persistent): Add an
unreferenced_attimestamp column to therelationshipstable. The merge endpoint sets this on removed entries. The BOM query returns it, and the frontend renders the warning. The column is cleared when the entry reappears in a future merge or is explicitly kept.Recommend Option B for persistence, but either approach works.
Implementation
Frontend (
web/src/components/items/BOMTab.tsx)PUT /api/items/{pn}/bom/{childPn}with{"source": "manual"}(requires Update handler to supportsourcefield change — or a new dedicated endpoint)Backend (if Option B)
ALTER TABLE relationships ADD COLUMN unreferenced_at TIMESTAMPTZHandleMergeBOM: setunreferenced_at = now()on removed entries, clear it on entries that reappearBOMEntryResponse: addunreferenced_atfieldHandleUpdateBOMEntry: allow changingsourcefieldDependencies
Mockup