fix: null model display on Settings vehicle list (#162) #165
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?
Relates to #162
Severity: Critical
Problem
On the Settings page vehicle list, one vehicle shows "2022 Volkswagen null". The
nullshould be replaced with a fallback like "Unknown Model" or hidden entirely. The mobile Vehicles page already shows "Unknown Model" for the same vehicle, so the fallback is inconsistent across views.Acceptance Criteria
nullvalues displayed in vehicle names anywhere in the appImplementation Plan (from #162 -- Milestone 1)
Phase: 1 (Foundation) | Priority: Critical | Depends on: None | Blocks: #167, #171
Context
Multiple locations across the frontend concatenate
${year} ${make} ${model}directly, resulting in "null" text when fields are missing. A shared utility exists infrontend/src/features/documents/utils/vehicleLabel.tsbut is only used by the documents feature. This milestone promotes and extends that utility for project-wide use.Implementation
1. Create
frontend/src/core/utils/directory (does not currently exist)2. Create
frontend/src/core/utils/vehicleDisplay.ts:3. Delete
frontend/src/features/documents/utils/vehicleLabel.tsand update all imports to use the new location.4. Replace direct concatenation in these files:
frontend/src/pages/SettingsPage.tsx${year} ${make} ${model}concatgetVehicleSubtitle()frontend/src/features/settings/mobile/MobileSettingsScreen.tsx${year} ${make} ${model}concatgetVehicleSubtitle()frontend/src/features/dashboard/components/VehicleAttention.tsxgetVehicleLabel()frontend/src/features/vehicles/pages/VehicleDetailPage.tsxfilter(Boolean)pattern in displayNamegetVehicleLabel()frontend/src/features/vehicles/pages/VehicleDetailPage.tsxgetVehicleSubtitle()5. Documentation: After completion, add to
frontend/README.mdStructure section:Commit Convention
Test Criteria
nulltext visible anywhere in the UIBranch
Work on branch
issue-162-ux-design-audit-cleanup(shared with all #162 sub-issues)Milestone: Execution Complete
Phase: Execution | Agent: Developer | Status: PASS
Changes Summary
Created:
frontend/src/core/utils/vehicleDisplay.tsVehicleLikeinterface for flexible type compatibilitygetVehicleLabel()-- primary display name with fallback chain: nickname -> year/make/model/trim -> VIN -> IDgetVehicleSubtitle()-- "Year Make Model" line with null safetyDeleted:
frontend/src/features/documents/utils/vehicleLabel.ts(promoted to core)Updated 17 consumer files replacing direct
${vehicle.year} ${vehicle.make} ${vehicle.model}concatenation:SettingsPage.tsx,MobileSettingsScreen.tsx-- Settings vehicle listVehicleAttention.tsx-- Dashboard attention cardsVehicleDetailPage.tsx-- Vehicle detail name + subtitleVehicleDetailMobile.tsx,VehicleMobileCard.tsx,VehicleCard.tsx-- Vehicle list/cardsMaintenancePage.tsx,MaintenanceMobileScreen.tsx-- Maintenance vehicle displayMaintenanceRecordForm.tsx,MaintenanceScheduleForm.tsx-- Form vehicle selectorsMaintenanceRecordEditDialog.tsx,MaintenanceScheduleEditDialog.tsx-- Edit dialogsResolveAssociationDialog.tsx-- Email ingestion vehicle associationVehicleSelectionDialog.tsx-- Subscription vehicle selectionAdminUsersMobileScreen.tsx-- Admin user vehicle listDocumentDetailPage.tsx,DocumentsMobileScreen.tsx,DocumentsPage.tsx-- Document imports migratedDocumentation: Updated
frontend/README.mdandfrontend/src/features/documents/CLAUDE.mdVerification
vehicleDisplay.tsCommit
325cf08--fix: promote vehicle display utils to core with null safety (refs #165)Verdict: PASS | Next: Visual verification on mobile/desktop viewports