VSN-2685/ feat: draft save, YOLO anomaly weights, and edit-form fixes
Summary
-
Draft save: new "Enregistrer en brouillon" button saves the inspection with status
DRAFT -
Anomaly counter refactor: replaced the flat image-count state with a per-slot
anomalyWeightsmap. Auto-detected slots carryaiResult.detections(YOLO bounding-box count); manually uploaded slots carry 1. Total is auseMemo— no moresetAnomalyCountspread across
handlers -
Image slot restoration: multi-slot photo fields (vehicle views, anomaly photos) now use
file.slotIndexfrom the API - Edit-form company section: Société / Inspecteur fields now render as pre-filled plain TextFields instead of empty dropdowns.
-
Detail view deduplication:
buildMergedSectionsnow deduplicates the "missing fields" pass by bothformFieldIdandfieldName, preventing company-section fields from appearing twice when IDs don't match -
Anomaly count in edit mode: fixed double-counting of slot 0 (stored at both base key and
_0key); initial weights now distribute the savedinspection.anomalytotal evenly across occupied slots - UX / polish: edit icon opens edit mode directly, DRAFT translated to button hidden in edit mode, anomaly summary label simplified
note (point 4) : Société and Inspecteur are created as TEXT (not DROPDOWN) in DefaultCompanySection — the vehicle selection step is mandatory before reaching the form, so these fields are always pre-filled from vehicle data and never rendered as dropdowns. Removed isCompanyNameField / isInspectorField predicates and the companySectionFromVehicle special cases in FieldRenderer. Label lookup is kept only for pre-filling (data mapping, not UI behaviour).