Skip to content

VSN-2685/ feat: draft save, YOLO anomaly weights, and edit-form fixes

fatima senan a demandé de fusionner feature/VSN-2685 vers develop

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 anomalyWeights map. Auto-detected slots carry aiResult.detections (YOLO bounding-box count); manually uploaded slots carry 1. Total is a useMemo — no more setAnomalyCount spread across
    handlers
  • Image slot restoration: multi-slot photo fields (vehicle views, anomaly photos) now use file.slotIndex from the API
  • Edit-form company section: Société / Inspecteur fields now render as pre-filled plain TextFields instead of empty dropdowns.
  • Detail view deduplication: buildMergedSections now deduplicates the "missing fields" pass by both formFieldId and fieldName, 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 _0 key); initial weights now distribute the saved inspection.anomaly total 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).

Modification effectuée par fatima senan

Rapports de requête de fusion