feat: Improve VIN decode confidence reporting and make/model/trim editability #125

Closed
opened 2026-02-09 00:42:29 +00:00 by egullickson · 2 comments
Owner

Summary

Improve the VIN decode review flow so that:

  1. Confidence score reflects VIN recognition accuracy -- how confident the system is in the VIN number itself (OCR read quality), NOT how well the VIN matched to a Make/Model/Trim.
  2. Make/Model/Trim fields are editable dropdowns -- after a VIN match, the decoded Make/Model/Trim should be presented in dropdown selectors that the user can immediately adjust, rather than read-only fields requiring an "Edit" button click.

Current Behavior

  • The confidence level shown to the user conflates VIN OCR confidence with vehicle data matching confidence.
  • Once a VIN is matched, Make/Model/Trim are displayed as read-only text fields. The user must click an "Edit" button to change them.

Expected Behavior

VIN Confidence

  • Confidence score should represent how accurately the VIN characters were read (OCR quality).
  • A high confidence means the system is sure about the 17-character VIN string.
  • A low confidence means the OCR had difficulty reading one or more characters.
  • Vehicle data matching (Make/Model/Trim lookup) is a separate concern and should not affect the VIN confidence score.

Editable Dropdowns

  • After VIN decode, Make/Model/Trim should be pre-populated in dropdown selectors (using the existing cascade dropdown API).
  • Dropdowns should be immediately editable without needing to click an "Edit" button.
  • The cascade behavior should work: changing Make reloads Models, changing Model reloads Trims, etc.
  • Engine and Transmission dropdowns should also follow the same pattern (editable, cascade-filtered).

Technical Context

Relevant Components

  • Frontend: VinOcrReviewModal.tsx, VinCameraButton.tsx, VehicleForm.tsx
  • Backend: Platform feature (backend/src/features/platform/) provides cascade dropdown API
  • Dropdown API: GET /api/vehicles/dropdown/{years,makes,models,trims,engines,transmissions}
  • Pair-safe API: GET /api/vehicles/dropdown/options for engine/transmission compatibility

Approach Notes

  • The VIN OCR review modal should separate VIN string confidence from vehicle match results.
  • The dropdown cascade infrastructure already exists and should be reused for the editable fields.
  • Consider showing a visual indicator for VIN confidence (e.g., color-coded bar or percentage).

Acceptance Criteria

  • Confidence score reflects OCR accuracy of the VIN string only
  • Confidence does NOT factor in Make/Model/Trim matching success
  • Make/Model/Trim are presented as editable dropdown selectors after VIN decode
  • Dropdowns are pre-populated with decoded values but immediately changeable
  • Cascade behavior works (changing Make reloads Models, etc.)
  • Engine and Transmission follow the same editable dropdown pattern
  • No "Edit" button required to change Make/Model/Trim values
  • Works on both mobile and desktop viewports
  • Existing VIN camera capture flow is not regressed
## Summary Improve the VIN decode review flow so that: 1. **Confidence score reflects VIN recognition accuracy** -- how confident the system is in the VIN number itself (OCR read quality), NOT how well the VIN matched to a Make/Model/Trim. 2. **Make/Model/Trim fields are editable dropdowns** -- after a VIN match, the decoded Make/Model/Trim should be presented in dropdown selectors that the user can immediately adjust, rather than read-only fields requiring an "Edit" button click. ## Current Behavior - The confidence level shown to the user conflates VIN OCR confidence with vehicle data matching confidence. - Once a VIN is matched, Make/Model/Trim are displayed as read-only text fields. The user must click an "Edit" button to change them. ## Expected Behavior ### VIN Confidence - Confidence score should represent how accurately the VIN characters were read (OCR quality). - A high confidence means the system is sure about the 17-character VIN string. - A low confidence means the OCR had difficulty reading one or more characters. - Vehicle data matching (Make/Model/Trim lookup) is a separate concern and should not affect the VIN confidence score. ### Editable Dropdowns - After VIN decode, Make/Model/Trim should be pre-populated in dropdown selectors (using the existing cascade dropdown API). - Dropdowns should be immediately editable without needing to click an "Edit" button. - The cascade behavior should work: changing Make reloads Models, changing Model reloads Trims, etc. - Engine and Transmission dropdowns should also follow the same pattern (editable, cascade-filtered). ## Technical Context ### Relevant Components - **Frontend**: `VinOcrReviewModal.tsx`, `VinCameraButton.tsx`, `VehicleForm.tsx` - **Backend**: Platform feature (`backend/src/features/platform/`) provides cascade dropdown API - **Dropdown API**: `GET /api/vehicles/dropdown/{years,makes,models,trims,engines,transmissions}` - **Pair-safe API**: `GET /api/vehicles/dropdown/options` for engine/transmission compatibility ### Approach Notes - The VIN OCR review modal should separate VIN string confidence from vehicle match results. - The dropdown cascade infrastructure already exists and should be reused for the editable fields. - Consider showing a visual indicator for VIN confidence (e.g., color-coded bar or percentage). ## Acceptance Criteria - [ ] Confidence score reflects OCR accuracy of the VIN string only - [ ] Confidence does NOT factor in Make/Model/Trim matching success - [ ] Make/Model/Trim are presented as editable dropdown selectors after VIN decode - [ ] Dropdowns are pre-populated with decoded values but immediately changeable - [ ] Cascade behavior works (changing Make reloads Models, etc.) - [ ] Engine and Transmission follow the same editable dropdown pattern - [ ] No "Edit" button required to change Make/Model/Trim values - [ ] Works on both mobile and desktop viewports - [ ] Existing VIN camera capture flow is not regressed
egullickson added the
status
backlog
type
feature
labels 2026-02-09 00:42:37 +00:00
egullickson added
status
in-progress
and removed
status
backlog
labels 2026-02-09 01:14:33 +00:00
Author
Owner

Milestone: Execution Tracking

Phase: Execution | Agent: Developer | Status: IN_PROGRESS

Milestones

# Milestone Status
M1 Update VinOcrReviewModal confidence to OCR-only IN_PROGRESS
M2 Replace read-only fields with editable cascade dropdowns in modal PENDING
M3 Update VehicleForm to receive edited dropdown values from modal PENDING
M4 Responsive design, lint, type-check, and test PENDING

Branch

issue-125-improve-vin-confidence-editability

Files to Modify

  • frontend/src/features/vehicles/types/vehicles.types.ts - Add VinReviewSelections type
  • frontend/src/features/vehicles/components/VinOcrReviewModal.tsx - Major rewrite: OCR confidence + editable cascade dropdowns
  • frontend/src/features/vehicles/components/VehicleForm.tsx - Update to receive modal selections

Verdict: IN_PROGRESS | Next: Begin M1+M2 implementation

## Milestone: Execution Tracking **Phase**: Execution | **Agent**: Developer | **Status**: IN_PROGRESS ### Milestones | # | Milestone | Status | |---|-----------|--------| | M1 | Update VinOcrReviewModal confidence to OCR-only | IN_PROGRESS | | M2 | Replace read-only fields with editable cascade dropdowns in modal | PENDING | | M3 | Update VehicleForm to receive edited dropdown values from modal | PENDING | | M4 | Responsive design, lint, type-check, and test | PENDING | ### Branch `issue-125-improve-vin-confidence-editability` ### Files to Modify - `frontend/src/features/vehicles/types/vehicles.types.ts` - Add VinReviewSelections type - `frontend/src/features/vehicles/components/VinOcrReviewModal.tsx` - Major rewrite: OCR confidence + editable cascade dropdowns - `frontend/src/features/vehicles/components/VehicleForm.tsx` - Update to receive modal selections *Verdict*: IN_PROGRESS | *Next*: Begin M1+M2 implementation
Author
Owner

Milestone: Execution Complete

Phase: Execution | Agent: Developer | Status: PASS

Milestones

# Milestone Status
M1 Update VinOcrReviewModal confidence to OCR-only COMPLETE
M2 Replace read-only fields with editable cascade dropdowns in modal COMPLETE
M3 Update VehicleForm to receive edited dropdown values from modal COMPLETE
M4 Responsive design, lint, type-check, and test COMPLETE

Changes Summary

vehicles.types.ts - Added VinReviewSelections interface for passing user-edited dropdown values from review modal to form.

VinOcrReviewModal.tsx - Major rewrite:

  • Confidence indicator now shows OCR accuracy percentage only (not per-field matching confidence)
  • Removed read-only DecodedFieldRow components
  • Added 6 editable cascade dropdown selectors (Year, Make, Model, Trim, Engine, Transmission)
  • Pre-populated from NHTSA decode results
  • Cascade behavior: changing Make reloads Models, etc.
  • NHTSA reference hints shown for unmatched fields
  • Removed "Edit Manually" button (fields are directly editable)
  • onAccept now passes VinReviewSelections with user's choices
  • Mobile: scrollable bottom drawer with 1-column dropdowns
  • Desktop: dialog with 2-column dropdown grid

VehicleForm.tsx - Updated to receive VinReviewSelections:

  • handleAcceptVinOcr accepts selections from modal instead of raw decoded data
  • Removed handleEditVinManually function and onEdit prop
  • Form loads dropdown options hierarchically for the selected values

Quality Checks

  • Type-check: PASS (zero errors)
  • Lint: PASS (zero new warnings, 1 pre-existing any in catch block)
  • Tests: 11 suites pass, 14 pre-existing failures (stations/admin unrelated to vehicles)
  • Mobile responsive: Bottom drawer with overflowY: auto, 1-column dropdowns on xs
  • Desktop responsive: Dialog with 2-column dropdown grid on sm+

Commit

e9020db feat: improve VIN confidence reporting and editable review dropdowns (refs #125)

Verdict: PASS | Next: Open PR for review

## Milestone: Execution Complete **Phase**: Execution | **Agent**: Developer | **Status**: PASS ### Milestones | # | Milestone | Status | |---|-----------|--------| | M1 | Update VinOcrReviewModal confidence to OCR-only | COMPLETE | | M2 | Replace read-only fields with editable cascade dropdowns in modal | COMPLETE | | M3 | Update VehicleForm to receive edited dropdown values from modal | COMPLETE | | M4 | Responsive design, lint, type-check, and test | COMPLETE | ### Changes Summary **`vehicles.types.ts`** - Added `VinReviewSelections` interface for passing user-edited dropdown values from review modal to form. **`VinOcrReviewModal.tsx`** - Major rewrite: - Confidence indicator now shows OCR accuracy percentage only (not per-field matching confidence) - Removed read-only `DecodedFieldRow` components - Added 6 editable cascade dropdown selectors (Year, Make, Model, Trim, Engine, Transmission) - Pre-populated from NHTSA decode results - Cascade behavior: changing Make reloads Models, etc. - NHTSA reference hints shown for unmatched fields - Removed "Edit Manually" button (fields are directly editable) - `onAccept` now passes `VinReviewSelections` with user's choices - Mobile: scrollable bottom drawer with 1-column dropdowns - Desktop: dialog with 2-column dropdown grid **`VehicleForm.tsx`** - Updated to receive `VinReviewSelections`: - `handleAcceptVinOcr` accepts selections from modal instead of raw decoded data - Removed `handleEditVinManually` function and `onEdit` prop - Form loads dropdown options hierarchically for the selected values ### Quality Checks - Type-check: PASS (zero errors) - Lint: PASS (zero new warnings, 1 pre-existing `any` in catch block) - Tests: 11 suites pass, 14 pre-existing failures (stations/admin unrelated to vehicles) - Mobile responsive: Bottom drawer with `overflowY: auto`, 1-column dropdowns on xs - Desktop responsive: Dialog with 2-column dropdown grid on sm+ ### Commit `e9020db` feat: improve VIN confidence reporting and editable review dropdowns (refs #125) *Verdict*: PASS | *Next*: Open PR for review
egullickson added
status
review
and removed
status
in-progress
labels 2026-02-09 01:24:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#125